from retail

This commit is contained in:
NoM0Re
2025-01-16 17:36:46 +01:00
parent 64a21e9030
commit b0854d38e0
5 changed files with 58 additions and 16 deletions
+21 -7
View File
@@ -582,6 +582,27 @@ function WeakAuras.CheckNumericIds(loadids, currentId)
return false;
end
function WeakAuras.ValidateNumeric(info, val)
if val ~= nil and val ~= "" and (not tonumber(val) or tonumber(val) >= 2^31) then
return false;
end
return true
end
function WeakAuras.ValidateTime(info, val)
if val ~= nil and val ~= "" then
if not tonumber(val) then
if val:sub(1,1) == "-" then
val = val:sub(2, #val)
end
return (val:match("^%d+:%d+:[%d%.]+$") or val:match("^%d+:[%d+%.]+$")) and true or false
elseif tonumber(val) >= 2^31 then
return false
end
end
return true
end
function WeakAuras.TimeToSeconds(val)
if tonumber(val) then
return tonumber(val)
@@ -626,13 +647,6 @@ Private.tinySecondFormat = function(value)
end
end
function WeakAuras.ValidateNumeric(info, val)
if val ~= nil and val ~= "" and (not tonumber(val) or tonumber(val) >= 2^31) then
return false;
end
return true
end
function WeakAuras.ValidateNumericOrPercent(info, val)
if val ~= nil and val ~= "" then
local percent = string.match(val, "(%d+)%%")