Fix scale number check
This commit is contained in:
@@ -519,9 +519,12 @@ function shared.Config.Init()
|
||||
local scale = CreateBasicSmallEditBox("HeimdallConfigScale", configFrame.frame, "Scale", Heimdall_Data.config.scale,
|
||||
function(self)
|
||||
local text = self:GetText()
|
||||
if string.match(text, "%d+") then
|
||||
if string.match(text, "^%d+%.*%d*$") then
|
||||
Heimdall_Data.config.scale = tonumber(text)
|
||||
configFrame.frame:SetScale(Heimdall_Data.config.scale)
|
||||
else
|
||||
print(string.format("Invalid scale: %s, please use numbers", text))
|
||||
self:SetText(Heimdall_Data.config.scale)
|
||||
end
|
||||
end)
|
||||
configFrame:Add(scale, 2, 2)
|
||||
|
||||
Reference in New Issue
Block a user