This commit is contained in:
NoM0Re
2025-05-31 22:54:39 +02:00
committed by GitHub
parent 9def6a5ab8
commit bda851552d
58 changed files with 2518 additions and 1671 deletions
+6 -5
View File
@@ -292,7 +292,7 @@ local function CreateTestForCondition(data, input, allConditionsTemplate, usedSt
end
elseif (cType == "customcheck") then
if value then
local customCheck = WeakAuras.LoadFunction("return " .. value)
local customCheck = WeakAuras.LoadFunction("return " .. value, data.id)
if customCheck then
Private.ExecEnv.conditionHelpers[uid] = Private.ExecEnv.conditionHelpers[uid] or {}
Private.ExecEnv.conditionHelpers[uid].customTestFunctions
@@ -378,7 +378,7 @@ local function CreateTestForCondition(data, input, allConditionsTemplate, usedSt
fn = fn:format(input.op_range, input.range, op, value)
end
if fn then
local customCheck = WeakAuras.LoadFunction(fn)
local customCheck = WeakAuras.LoadFunction(fn, data.id)
if customCheck then
Private.ExecEnv.conditionHelpers[uid] = Private.ExecEnv.conditionHelpers[uid] or {}
Private.ExecEnv.conditionHelpers[uid].customTestFunctions
@@ -654,7 +654,7 @@ function Private.LoadConditionPropertyFunctions(data)
else
prefix, suffix = "return function()", "\nend";
end
local customFunc = WeakAuras.LoadFunction(prefix .. custom .. suffix);
local customFunc = WeakAuras.LoadFunction(prefix .. custom .. suffix, data.id);
if (customFunc) then
Private.ExecEnv.customConditionsFunctions[id][conditionNumber] = Private.ExecEnv.customConditionsFunctions[id][conditionNumber] or {};
Private.ExecEnv.customConditionsFunctions[id][conditionNumber].changes = Private.ExecEnv.customConditionsFunctions[id][conditionNumber].changes or {};
@@ -835,7 +835,7 @@ function Private.LoadConditionFunction(data)
CancelTimers(data.uid)
local checkConditionsFuncStr = ConstructConditionFunction(data);
local checkConditionsFunc = checkConditionsFuncStr and Private.LoadFunction(checkConditionsFuncStr)
local checkConditionsFunc = checkConditionsFuncStr and Private.LoadFunction(checkConditionsFuncStr, data.id)
checkConditions[data.uid] = checkConditionsFunc;
end
@@ -1014,7 +1014,8 @@ function Private.RegisterForGlobalConditions(uid)
dynamicConditionsFrame.units[unit] = CreateFrame("Frame");
dynamicConditionsFrame.units[unit]:SetScript("OnEvent", handleDynamicConditionsPerUnit);
end
pcall(dynamicConditionsFrame.units[unit].RegisterUnitEvent, dynamicConditionsFrame.units[unit], unitEvent, unit);
dynamicConditionsFrame.units[unit].unit = unit;
pcall(dynamicConditionsFrame.units[unit].RegisterEvent, dynamicConditionsFrame.units[unit], unitEvent, unit);
UpdateDynamicConditionsPerUnitState(dynamicConditionsFrame, event, unit)
else
pcall(dynamicConditionsFrame.RegisterEvent, dynamicConditionsFrame, event);