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
+22 -9
View File
@@ -381,7 +381,9 @@ Private.event_prototypes["DBM Announce"] = {
name = "spellId",
init = "arg",
display = L["Spell Id"],
type = "string"
type = "spell",
noValidation = true,
showExactOption = false,
},
{
name = "message",
@@ -584,9 +586,11 @@ Private.event_prototypes["DBM Timer"] = {
{
name = "spellId",
display = L["Spell Id"],
type = "string",
store = true,
conditionType = "string"
type = "spell",
conditionType = "string",
noValidation = true,
showExactOption = false,
},
{
name = "message",
@@ -986,7 +990,10 @@ Private.event_prototypes["BigWigs Message"] = {
init = "arg",
display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "longstring"
type = "spell",
conditionType = "string",
noValidation = true,
showExactOption = false,
},
{
name = "text",
@@ -1175,8 +1182,10 @@ Private.event_prototypes["BigWigs Timer"] = {
name = "spellId",
display = L["Key"],
desc = L["The 'Key' value can be found in the BigWigs options of a specific spell"],
type = "string",
type = "spell",
conditionType = "string",
noValidation = true,
showExactOption = false,
},
{
name = "text",
@@ -1339,9 +1348,11 @@ Private.event_prototypes["Boss Mod Announce"] = {
name = "spellId",
init = "arg",
display = L["Key"],
type = "string",
store = true,
conditionType = "string"
type = "spell",
conditionType = "string",
noValidation = true,
showExactOption = false,
},
{
name = "message",
@@ -1544,9 +1555,11 @@ Private.event_prototypes["Boss Mod Timer"] = {
{
name = "spellId",
display = L["Key"],
type = "string",
store = true,
conditionType = "string"
type = "spell",
conditionType = "string",
noValidation = true,
showExactOption = false,
},
{
name = "message",
+8
View File
@@ -3786,6 +3786,13 @@ local commonConditions = {
display = L["Total Duration"],
type = "number",
},
paused = {
display = L["Is Paused"],
type = "bool",
test = function(state, needle)
return (state.paused and 1 or 0) == needle
end
},
value = {
display = L["Progress Value"],
type = "number",
@@ -3844,6 +3851,7 @@ function GenericTrigger.GetTriggerConditions(data, triggernum)
if (timedDuration) then
result.expirationTime = commonConditions.expirationTime;
result.duration = commonConditions.duration;
result.paused = commonConditions.paused
end
if (valueDuration) then
+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+)%%")
+1
View File
@@ -205,6 +205,7 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell
end,
validate = isExactSpellId and WeakAuras.ValidateNumeric or nil,
control = "WeakAurasInputFocus",
getWithFocus = function() return trigger[optionKey] and trigger[optionKey][i] or "" end
}
end
-- VALIDATE ?
+6
View File
@@ -721,6 +721,12 @@ local function replaceNameDescFuncs(intable, data, subOption)
if(type(display) == "number") then
display = math.floor(display * 100) / 100;
else
local nullBytePos = display:find("\0", nil, true)
if nullBytePos then
display = display:sub(1, nullBytePos - 1)
end
if #display > 50 then
display = display:sub(1, 50) .. "..."
end