Fix scale number check

This commit is contained in:
2025-01-10 21:42:47 +01:00
parent d41554271d
commit 744098abc7
3 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
## Interface: 70300
## Title: Heimdall
## Version: 3.2.0
## Version: 3.2.1
## Notes: Watches over areas and alerts when hostiles spotted
## Author: Cyka
## SavedVariables: Heimdall_Data

BIN
Heimdall.zip (Stored with Git LFS)

Binary file not shown.

View File

@@ -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)