from retail

This commit is contained in:
NoM0Re
2025-01-11 21:04:42 +01:00
parent 794d8eef84
commit 5022fe7ffd
9 changed files with 51 additions and 26 deletions
+3 -1
View File
@@ -2696,7 +2696,9 @@ function BuffTrigger.GetTriggerConditions(data, triggernum)
}
end
if not IsGroupTrigger(trigger) and trigger.matchesShowOn == "showAlways" then
if not IsGroupTrigger(trigger) and trigger.matchesShowOn == "showAlways"
or IsGroupTrigger(trigger) and trigger.showClones and trigger.unit ~= "multi" and trigger.combinePerUnit
then
result["buffed"] = {
display = L["Aura(s) Found"],
type = "bool",
+3
View File
@@ -853,6 +853,7 @@ function Private.RegisterForGlobalConditions(uid)
if (not dynamicConditionsFrame.onUpdate) then
dynamicConditionsFrame:SetScript("OnUpdate", handleDynamicConditionsOnUpdate);
dynamicConditionsFrame.onUpdate = true;
handleDynamicConditionsOnUpdate(dynamicConditionsFrame, event)
end
else
local unitEvent, unit = event:match("([^:]+):([^:]+)")
@@ -864,8 +865,10 @@ function Private.RegisterForGlobalConditions(uid)
end
dynamicConditionsFrame.units[unit].unit = unit;
pcall(dynamicConditionsFrame.RegisterEvent, dynamicConditionsFrame.units[unit], unitEvent);
handleDynamicConditionsPerUnit(dynamicConditionsFrame, event, unit)
else
pcall(dynamicConditionsFrame.RegisterEvent, dynamicConditionsFrame, event);
handleDynamicConditions(dynamicConditionsFrame, event)
end
end
end
+15 -3
View File
@@ -1410,14 +1410,19 @@ function GenericTrigger.Add(data, region)
overlayFuncs = {};
local dest = 1;
for i, v in ipairs(prototype.overlayFuncs) do
if (v.enable(trigger)) then
local enable = true
if type(v.enable) == "function" then
enable = v.enable(trigger)
elseif type(v.enable) == "boolean" then
enable = v.enable
end
if enable then
overlayFuncs[dest] = v.func;
dest = dest + 1;
end
end
end
if (prototype.automaticrequired) then
untriggerFunc = trueFunction
elseif prototype.timedrequired then
@@ -3789,7 +3794,13 @@ function GenericTrigger.GetOverlayInfo(data, triggernum)
result = {};
local dest = 1;
for i, v in ipairs(Private.event_prototypes[trigger.event].overlayFuncs) do
if (v.enable(trigger)) then
local enable = true
if type(v.enable) == "function" then
enable = v.enable(trigger)
elseif type(v.enable) == "boolean" then
enable = v.enable
end
if enable then
result[dest] = v.name;
dest = dest + 1;
end
@@ -4209,6 +4220,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state)
state.expirationTime = math.huge;
state.value = nil;
state.total = nil;
Private.ActivateAuraEnvironment(nil)
return;
end
arg1 = type(arg1) == "number" and arg1 or 0;
+2
View File
@@ -945,6 +945,7 @@ Private.inverse_point_types = {
Private.anchor_frame_types = {
SCREEN = L["Screen/Parent Group"],
UIPARENT = L["Screen"],
MOUSE = L["Mouse Cursor"],
SELECTFRAME = L["Select Frame"],
UNITFRAME = L["Unit Frames"],
@@ -956,6 +957,7 @@ end
Private.anchor_frame_types_group = {
SCREEN = L["Screen/Parent Group"],
UIPARENT = L["Screen"],
MOUSE = L["Mouse Cursor"],
SELECTFRAME = L["Select Frame"],
CUSTOM = L["Custom"]
+8 -5
View File
@@ -3977,7 +3977,6 @@ end
local function evaluateTriggerStateTriggers(id)
local result = false;
Private.ActivateAuraEnvironment(id);
if WeakAuras.IsOptionsOpen() then
-- While the options are open ignore the combination function
@@ -3990,7 +3989,9 @@ local function evaluateTriggerStateTriggers(id)
result = true;
else
if (triggerState[id].disjunctive == "custom" and triggerState[id].triggerLogicFunc) then
Private.ActivateAuraEnvironment(id)
local ok, returnValue = pcall(triggerState[id].triggerLogicFunc, triggerState[id].triggers);
Private.ActivateAuraEnvironment()
if not ok then
Private.GetErrorHandlerId(id, L["Custom Trigger Combination"])
result = false
@@ -4000,8 +4001,6 @@ local function evaluateTriggerStateTriggers(id)
end
end
Private.ActivateAuraEnvironment();
return result;
end
@@ -4989,6 +4988,10 @@ local function GetAnchorFrame(data, region, parent)
return parent;
end
if (anchorFrameType == "UIPARENT") then
return UIParent;
end
if (anchorFrameType == "MOUSE") then
ensureMouseFrame();
mouseFrame:anchorFrame(id, anchorFrameType);
@@ -5080,7 +5083,7 @@ function Private.AnchorFrame(data, region, parent, force)
local anchorParent = GetAnchorFrame(data, region, parent);
if not anchorParent then return end
if (data.anchorFrameParent or data.anchorFrameParent == nil
or data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE") then
or data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE") then
local ok, ret = pcall(region.SetParent, region, anchorParent);
if not ok then
Private.GetErrorHandlerId(data.id, L["Anchoring"])
@@ -5091,7 +5094,7 @@ function Private.AnchorFrame(data, region, parent, force)
local anchorPoint = data.anchorPoint
if data.parent then
if data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE" then
if data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE" then
anchorPoint = "CENTER"
end
else
+3 -3
View File
@@ -560,9 +560,9 @@ local function GetBuffTriggerOptions(data, triggernum)
end,
desc = function()
local value = trigger.ownOnly
if value == nil then return L["Only match auras cast by the player or his pet"]
elseif value == false then return L["Only match auras cast by people other than the player or his pet"]
else return L["Only match auras cast by the player or his pet"] end
if value == nil then return L["Only match auras cast by the player or their pet"]
elseif value == false then return L["Only match auras cast by people other than the player or their pet"]
else return L["Only match auras cast by the player or their pet"] end
end,
get = function()
local value = trigger.ownOnly
+6 -6
View File
@@ -1079,7 +1079,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
return data.anchorFrameParent or data.anchorFrameParent == nil;
end,
hidden = function()
return not IsGroupByFrame() and (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE" or IsParentDynamicGroup());
return not IsGroupByFrame() and (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE" or IsParentDynamicGroup());
end,
},
anchorFrameSpaceOne = {
@@ -1089,7 +1089,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
order = 72,
image = function() return "", 0, 0 end,
hidden = function()
return IsParentDynamicGroup() or not (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE")
return IsParentDynamicGroup() or not (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE")
end,
},
-- Input field to select frame to anchor on
@@ -1135,7 +1135,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
type = "select",
width = WeakAuras.normalWidth,
name = function()
if (data.anchorFrameType == "SCREEN") then
if (data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT") then
return L["To Screen's"]
elseif (data.anchorFrameType == "PRD") then
return L["To Personal Ressource Display's"];
@@ -1152,7 +1152,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
if IsParentDynamicGroup() then
return true
end
return data.anchorFrameType == "SCREEN" or data.anchorFrameType == "MOUSE";
return data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" or data.anchorFrameType == "MOUSE";
else
return data.anchorFrameType == "MOUSE";
end
@@ -1169,7 +1169,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
if IsGroupByFrame() then
return true
end
if (data.anchorFrameType ~= "SCREEN") then
if (data.anchorFrameType ~= "SCREEN" and data.anchorFrameType ~= "UIPARENT") then
return true;
end
if (data.parent) then
@@ -1245,7 +1245,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
order = 82,
image = function() return "", 0, 0 end,
hidden = function()
return not (data.anchorFrameType ~= "SCREEN" or IsParentDynamicGroup());
return not (data.anchorFrameType ~= "SCREEN" or data.anchorFrameType ~= "UIPARENT" or IsParentDynamicGroup());
end
},
};
+9 -6
View File
@@ -185,7 +185,7 @@ end
local function RecurseDiff(ours, theirs, ignoredForDiffChecking)
local diff, seen, same = {}, {}, true
for key, ourVal in pairs(ours) do
if type(ignoredForDiffChecking) ~= table or ignoredForDiffChecking[key] ~= true then
if not (type(ignoredForDiffChecking) == "table" and ignoredForDiffChecking[key] == true) then
seen[key] = true
local theirVal = theirs[key]
if type(ourVal) == "table" and type(theirVal) == "table" then
@@ -207,7 +207,7 @@ local function RecurseDiff(ours, theirs, ignoredForDiffChecking)
end
end
for key, theirVal in pairs(theirs) do
if not seen[key] and (type(ignoredForDiffChecking) ~= table or ignoredForDiffChecking[key] ~= true) then
if not seen[key] and not (type(ignoredForDiffChecking) == "table" and ignoredForDiffChecking[key] == true) then
diff[key] = theirVal
same = false
end
@@ -230,10 +230,10 @@ local function RecurseSerial(lines, depth, chunk)
end
end
local function DebugPrintDiff(diff)
local function DebugPrintDiff(diff, id, uid)
local lines = {
"==========================",
"Diff detected: ",
string.format("Diff detected for %q (%s):", id, uid),
"{",
}
RecurseSerial(lines, 1, diff)
@@ -252,7 +252,7 @@ local function Diff(ours, theirs)
local diff = RecurseDiff(ours, theirs, ignoredForDiffChecking)
if diff then
if debug then
DebugPrintDiff(diff, ours.id, theirs.id)
DebugPrintDiff(diff, theirs.id, theirs.uid)
end
return diff
end
@@ -516,7 +516,9 @@ local function BuildUidMap(data, children, type)
end
if self.map[uid].anchorFrameFrame then
local target = self:GetIdFor(self.map[uid].anchorFrameFrame)
data.anchorFrameFrame = nil
local anchorUid = self.map[uid].anchorFrameFrame
local target = self:Contains(anchorUid) and self:GetIdFor(anchorUid)
if target then
data.anchorFrameFrame = "WeakAuras:" .. target
end
@@ -1626,6 +1628,7 @@ local methods = {
oldData.sortHybridTable = newData.sortHybridTable
oldData.uid = uid
oldData.id = matchInfo.newUidMap:GetIdFor(uid)
oldData.anchorFrameFrame = newData.anchorFrameFrame
return oldData
else
return matchInfo.newUidMap:GetPhase2Data(uid)
+2 -2
View File
@@ -199,8 +199,8 @@ local function DeleteConditionsForTriggerHandleSubChecks(checks, triggernum)
check.trigger = check.trigger - 1;
end
if (checks.checks) then
DeleteConditionsForTriggerHandleSubChecks(checks.checks, triggernum);
if (check.checks) then
DeleteConditionsForTriggerHandleSubChecks(check.checks, triggernum);
end
end
end