from retail

This commit is contained in:
NoM0Re
2025-02-12 21:32:40 +01:00
parent b7a505f118
commit a9b95ca09d
4 changed files with 127 additions and 115 deletions
+3 -1
View File
@@ -3,7 +3,6 @@ local AddonName, Private = ...
local WeakAuras = WeakAuras local WeakAuras = WeakAuras
local L = WeakAuras.L local L = WeakAuras.L
local prettyPrint = WeakAuras.prettyPrint
local LibSerialize = LibStub("LibSerialize") local LibSerialize = LibStub("LibSerialize")
local LibDeflate = LibStub:GetLibrary("LibDeflate") local LibDeflate = LibStub:GetLibrary("LibDeflate")
@@ -142,6 +141,7 @@ local blockedFunctions = {
EditMacro = true, EditMacro = true,
DevTools_DumpCommand = true, DevTools_DumpCommand = true,
hash_SlashCmdList = true, hash_SlashCmdList = true,
RegisterNewSlashCommand = true,
CreateMacro = true, CreateMacro = true,
SetBindingMacro = true, SetBindingMacro = true,
GuildDisband = true, GuildDisband = true,
@@ -194,6 +194,7 @@ local current_aura_env = nil
-- Stack of of aura environments/uids, allows use of recursive aura activations through calls to WeakAuras.ScanEvents(). -- Stack of of aura environments/uids, allows use of recursive aura activations through calls to WeakAuras.ScanEvents().
local aura_env_stack = {} local aura_env_stack = {}
local function UpdateSavedDataWarning(uid, size) local function UpdateSavedDataWarning(uid, size)
local savedDataWarning = 16 * 1024 * 1024 -- 16 KB, but it's only a warning local savedDataWarning = 16 * 1024 * 1024 -- 16 KB, but it's only a warning
if size > savedDataWarning then if size > savedDataWarning then
@@ -547,6 +548,7 @@ end
local PrivateForBuiltIn = { local PrivateForBuiltIn = {
ExecEnv = Private.ExecEnv ExecEnv = Private.ExecEnv
} }
local env_getglobal_builtin local env_getglobal_builtin
local exec_env_builtin = setmetatable({}, local exec_env_builtin = setmetatable({},
{ {
+59 -65
View File
@@ -3037,7 +3037,7 @@ Private.event_prototypes = {
end, end,
store = true, store = true,
preambleGroup = "spell", preambleGroup = "spell",
preamble = "local spellChecker = WeakAuras.CreateSpellChecker()", preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
multiEntry = { multiEntry = {
operator = "preamble", operator = "preamble",
preambleAdd = "spellChecker:AddExact(%q)" preambleAdd = "spellChecker:AddExact(%q)"
@@ -3059,7 +3059,7 @@ Private.event_prototypes = {
end, end,
store = true, store = true,
preambleGroup = "spell", preambleGroup = "spell",
preamble = "local spellChecker = WeakAuras.CreateSpellChecker()", preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
multiEntry = { multiEntry = {
operator = "preamble", operator = "preamble",
preambleAdd = "spellChecker:AddName(%q)" preambleAdd = "spellChecker:AddName(%q)"
@@ -5542,9 +5542,8 @@ Private.event_prototypes = {
timedrequired = true, timedrequired = true,
progressType = "timed" progressType = "timed"
}, },
-- fixing later
--[[ --[[
["Spell Cast Succeeded"] = { ["Spell Cast Succeeded"] = {
type = "event", type = "event",
events = function(trigger) events = function(trigger)
local result = {} local result = {}
@@ -5552,6 +5551,13 @@ Private.event_prototypes = {
AddUnitEventForEvents(result, unit, "UNIT_SPELLCAST_SUCCEEDED") AddUnitEventForEvents(result, unit, "UNIT_SPELLCAST_SUCCEEDED")
return result return result
end, end,
init = function(trigger)
local ret =
local spellRank = %d
local rank = tonumber(spellRank:match("Rank (%d+)")) or nil
;
return ret:format(trigger.spellRank or nil);
end,
name = L["Spell Cast Succeeded"], name = L["Spell Cast Succeeded"],
statesParameter = "unit", statesParameter = "unit",
args = { args = {
@@ -5568,12 +5574,9 @@ Private.event_prototypes = {
return state and state.show and (UnitIsUnit(needle, state.unit or '') == (op == "==")) return state and state.show and (UnitIsUnit(needle, state.unit or '') == (op == "=="))
end end
}, },
{
},
{ -- castGUID
},
{ {
name = "spellNames", name = "spellNames",
init = "arg",
display = L["Name(s)"], display = L["Name(s)"],
type = "spell", type = "spell",
multiEntry = { multiEntry = {
@@ -5582,36 +5585,40 @@ Private.event_prototypes = {
}, },
preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()", preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
preambleGroup = "spell", preambleGroup = "spell",
test = "spellChecker:Check(spellId)", test = "spellChecker:Check(spellNames)",
noValidation = true, noValidation = true,
}, },
{ {
name = "spellId", name = "spellRank",
display = L["Exact Spell ID(s)"], hidden = true,
type = "spell",
init = "arg", init = "arg",
type = "string",
store = true,
test = "true"
},
{
name = "rank",
hidden = true,
init = "rank",
display = L["Rank"],
store = true, store = true,
multiEntry = {
operator = "preamble",
preambleAdd = "spellChecker:AddExact(%q)"
},
preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
preambleGroup = "spell",
test = "spellChecker:Check(spellId)",
conditionType = "number", conditionType = "number",
noProgressSource = true multiEntry = {
operator = "or",
limit = 2
},
}, },
{ {
name = "icon", name = "icon",
hidden = true, hidden = true,
init = "GetSpellIcon(spellId or 0)", init = "GetSpellIcon(spellNames or 0)",
store = true, store = true,
test = "true" test = "true"
}, },
{ {
name = "name", name = "name",
hidden = true, hidden = true,
init = "GetSpellInfo(spellId or 0)", init = "GetSpellInfo(spellNames or 0)",
store = true, store = true,
test = "true" test = "true"
}, },
@@ -6382,7 +6389,7 @@ Private.event_prototypes = {
type = "spell", type = "spell",
enable = function(trigger) return not trigger.use_inverse end, enable = function(trigger) return not trigger.use_inverse end,
preambleGroup = "spell", preambleGroup = "spell",
preamble = "local spellChecker = WeakAuras.CreateSpellChecker()", preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
multiEntry = { multiEntry = {
operator = "preamble", operator = "preamble",
preambleAdd = "spellChecker:AddName(%q)" preambleAdd = "spellChecker:AddName(%q)"
@@ -6396,7 +6403,7 @@ Private.event_prototypes = {
type = "spell", type = "spell",
enable = function(trigger) return not trigger.use_inverse end, enable = function(trigger) return not trigger.use_inverse end,
preambleGroup = "spell", preambleGroup = "spell",
preamble = "local spellChecker = WeakAuras.CreateSpellChecker()", preamble = "local spellChecker = Private.ExecEnv.CreateSpellChecker()",
multiEntry = { multiEntry = {
operator = "preamble", operator = "preamble",
preambleAdd = "spellChecker:AddName(GetSpellInfo(%q))" preambleAdd = "spellChecker:AddName(GetSpellInfo(%q))"
@@ -7798,11 +7805,10 @@ Private.event_prototypes = {
test = "true", test = "true",
}, },
}, },
GetNameAndIcon = function(trigger) GetNameAndIcon = function()
return MONEY, "interface/moneyframe/ui-goldicon" return MONEY, "interface/moneyframe/ui-goldicon"
end, end,
}, },
--[[ Some day i will finish this, soonTM
["Currency"] = { ["Currency"] = {
type = "unit", type = "unit",
progressType = "static", progressType = "static",
@@ -7815,24 +7821,26 @@ Private.event_prototypes = {
name = WeakAuras.newFeatureString..L["Currency"], name = WeakAuras.newFeatureString..L["Currency"],
init = function(trigger) init = function(trigger)
local ret = [=[ local ret = [=[
local currencyID = %d
local discoveredTbl = Private.ExecEnv.GetDiscoveredCurrencies() or {}
local currencyInfo = { local currencyInfo = {
name = GetItemInfo(%d), name = GetItemInfo(currencyID),
quantity = GetItemCount(%d), quantity = GetItemCount(currencyID),
iconFileID = select(6, GetItemInfo(%d)), icon = GetItemIcon(currencyID),
totalEarned = Private.GetTotalCountCurrencies(%d), totalEarned = Private.ExecEnv.GetTotalCountCurrencies(currencyID),
discovered = Private.GetDiscoveredCurencies(%d), discovered = discoveredTbl[currencyID] and true or false,
} }
if not currencyInfo.name then if not currencyInfo.name then
currencyInfo = { currencyInfo = {
name = "Unknown Currency", name = "Unknown Currency",
quantity = 0, quantity = 0,
iconFileID = "Interface\\Icons\\INV_Misc_QuestionMark", icon = "Interface\\Icons\\INV_Misc_QuestionMark",
totalEarned = 0, totalEarned = 0,
discovered = false discovered = false
} }
end end
]=] ]=]
return ret:format(trigger.currencyId or 1, trigger.currencyId or 1, trigger.currencyId or 1, trigger.currencyId or 1, trigger.currencyId or 1) return ret:format(tonumber(trigger.currencyId) or 1)
end, end,
statesParameter = "one", statesParameter = "one",
args = { args = {
@@ -7840,13 +7848,13 @@ Private.event_prototypes = {
name = "currencyId", name = "currencyId",
type = "currency", type = "currency",
itemControl = "Dropdown-Currency", itemControl = "Dropdown-Currency",
values = Private.GetDiscoveredCurencies, values = Private.ExecEnv.GetDiscoveredCurrencies,
headers = Private.GetDiscoveredCurenciesHeaders, headers = Private.GetDiscoveredCurrenciesHeaders,
sorted = true, sorted = true,
sortOrder = function() sortOrder = function()
local discovered_currencies_sorted = Private.GetDiscoveredCurenciesSorted() local discovered_currencies_sorted = Private.GetDiscoveredCurrenciesSorted()
local sortOrder = {} local sortOrder = {}
for key, value in pairs(Private.GetDiscoveredCurencies()) do for key, value in pairs(Private.ExecEnv.GetDiscoveredCurrencies()) do
tinsert(sortOrder, key) tinsert(sortOrder, key)
end end
table.sort(sortOrder, function(aKey, bKey) table.sort(sortOrder, function(aKey, bKey)
@@ -7877,12 +7885,12 @@ Private.event_prototypes = {
conditionType = "number", conditionType = "number",
}, },
{ {
name = "total", name = "totalEarned",
init = "currencyInfo.maxQuantity", init = "currencyInfo.totalEarned",
type = "number", type = "number",
hidden = true, display = L["Total"],
store = true, store = true,
test = "true", conditionType = "number",
}, },
{ {
name = "progressType", name = "progressType",
@@ -7893,22 +7901,11 @@ Private.event_prototypes = {
}, },
{ {
name = "icon", name = "icon",
init = "currencyInfo.iconFileID", init = "currencyInfo.icon",
store = true, store = true,
hidden = true, hidden = true,
test = "true", test = "true",
}, },
{
name = "totalEarned",
init = "currencyInfo.totalEarned",
type = "number",
display = L["Total Earned in this Season"],
store = true,
conditionType = "number",
enable = function(trigger)
-- soonTM
end
},
{ {
name = "description", name = "description",
init = "currencyInfo.description", init = "currencyInfo.description",
@@ -7928,12 +7925,12 @@ Private.event_prototypes = {
}, },
}, },
GetNameAndIcon = function(trigger) GetNameAndIcon = function(trigger)
local currencyInfo = Private.GetCurrencyInfoForTrigger(trigger) local name = GetItemInfo(trigger.currencyId or 0)
return currencyInfo and currencyInfo.name, currencyInfo and currencyInfo.iconFileID local icon = GetItemIcon(trigger.currencyId or 0)
return name, icon
end, end,
automaticrequired = true automaticrequired = true
}, },
]]
["Location"] = { ["Location"] = {
type = "unit", type = "unit",
events = { events = {
@@ -8051,15 +8048,12 @@ Private.event_prototypes = {
}, },
}; };
if not (DBM and DBM.ReleaseRevision >= 7003) then --[[
Private.event_prototypes["DBM Announce"] = nil Disable any event here
Private.event_prototypes["DBM Timer"] = nil if () then
end Private.event_prototypes[] = nil
if not (DBM and DBM.ReleaseRevision >= 7005) then end
Private.event_prototypes["DBM Stage"] = nil ]]
end
Private.event_prototypes["BigWigs Message"] = nil
Private.event_prototypes["BigWigs Timer"] = nil
Private.category_event_prototype = {} Private.category_event_prototype = {}
for name, prototype in pairs(Private.event_prototypes) do for name, prototype in pairs(Private.event_prototypes) do
+5 -5
View File
@@ -1408,13 +1408,13 @@ Private.totalcount_currencies = {
[49426] = 4730, -- Emblems of Frost [49426] = 4730, -- Emblems of Frost
} }
function Private.GetTotalCountCurrencies(currencyID) function Private.ExecEnv.GetTotalCountCurrencies(currencyID)
local achievementID = Private.totalcount_currencies[currencyID] local achievementID = Private.totalcount_currencies[currencyID]
if achievementID then if achievementID then
local totalEarned = GetStatistic(achievementID) local totalEarned = GetStatistic(achievementID)
return tonumber(totalEarned) or 0 return tonumber(totalEarned) or 0
end end
return nil return 0
end end
local function InitializeCurrencies() local function InitializeCurrencies()
@@ -1460,17 +1460,17 @@ local function InitializeCurrencies()
Private.discovered_currencies_sorted["member"] = -1; Private.discovered_currencies_sorted["member"] = -1;
end end
Private.GetDiscoveredCurencies = function() Private.ExecEnv.GetDiscoveredCurrencies = function()
InitializeCurrencies() InitializeCurrencies()
return Private.discovered_currencies return Private.discovered_currencies
end end
Private.GetDiscoveredCurenciesSorted = function() Private.GetDiscoveredCurrenciesSorted = function()
InitializeCurrencies() InitializeCurrencies()
return Private.discovered_currencies_sorted return Private.discovered_currencies_sorted
end end
Private.GetDiscoveredCurenciesHeaders = function() Private.GetDiscoveredCurrenciesHeaders = function()
InitializeCurrencies() InitializeCurrencies()
return Private.discovered_currencies_headers return Private.discovered_currencies_headers
end end
+60 -44
View File
@@ -1157,7 +1157,7 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon)
if(addon == ADDON_NAME) then if(addon == ADDON_NAME) then
WeakAurasSaved = WeakAurasSaved or {}; WeakAurasSaved = WeakAurasSaved or {};
db = WeakAurasSaved; db = WeakAurasSaved;
Private.db = db
-- Defines the action squelch period after login -- Defines the action squelch period after login
-- Stored in SavedVariables so it can be changed by the user if they find it necessary -- Stored in SavedVariables so it can be changed by the user if they find it necessary
db.login_squelch_time = db.login_squelch_time or 10; db.login_squelch_time = db.login_squelch_time or 10;
@@ -1668,7 +1668,7 @@ function Private.UnloadDisplays(toUnload, ...)
-- Even though auras are collapsed, their finish animation can be running -- Even though auras are collapsed, their finish animation can be running
Private.CancelAnimation(Private.regions[id].region, true, true, true, true, true, true) Private.CancelAnimation(Private.regions[id].region, true, true, true, true, true, true)
if clones[id] then if clones[id] then
for cloneId, region in pairs(clones[id]) do for _, region in pairs(clones[id]) do
Private.CancelAnimation(region, true, true, true, true, true, true) Private.CancelAnimation(region, true, true, true, true, true, true)
end end
end end
@@ -1744,8 +1744,8 @@ function WeakAuras.Delete(data)
if clones[id] then if clones[id] then
for _, region in pairs(clones[id]) do for _, region in pairs(clones[id]) do
region:Collapse(); region:Collapse();
Private.CancelAnimation(region, true, true, true, true, true, true) Private.CancelAnimation(region, true, true, true, true, true, true)
end end
clones[id] = nil clones[id] = nil
end end
@@ -1756,6 +1756,7 @@ function WeakAuras.Delete(data)
triggerSystem.Delete(id); triggerSystem.Delete(id);
end end
loaded[id] = nil; loaded[id] = nil;
loadFuncs[id] = nil; loadFuncs[id] = nil;
loadFuncsForOptions[id] = nil; loadFuncsForOptions[id] = nil;
@@ -1815,6 +1816,7 @@ function WeakAuras.Rename(data, newid)
if Private.regions[newid] and Private.regions[newid].region then if Private.regions[newid] and Private.regions[newid].region then
Private.regions[newid].region.id = newid Private.regions[newid].region.id = newid
end end
if(clones[oldid]) then if(clones[oldid]) then
clones[newid] = clones[oldid] clones[newid] = clones[oldid]
clones[oldid] = nil clones[oldid] = nil
@@ -1850,7 +1852,6 @@ function WeakAuras.Rename(data, newid)
db.displays[newid] = db.displays[oldid]; db.displays[newid] = db.displays[oldid];
db.displays[oldid] = nil; db.displays[oldid] = nil;
db.displays[newid].id = newid; db.displays[newid].id = newid;
if(data.controlledChildren) then if(data.controlledChildren) then
@@ -1892,7 +1893,6 @@ end
function Private.Convert(data, newType) function Private.Convert(data, newType)
local id = data.id; local id = data.id;
Private.FakeStatesFor(id, false) Private.FakeStatesFor(id, false)
if Private.regions[id] then if Private.regions[id] then
@@ -2633,9 +2633,7 @@ function WeakAuras.PreAdd(data, snapshot)
Private.GetErrorHandlerId(data.id, L["Modernize"]) Private.GetErrorHandlerId(data.id, L["Modernize"])
end end
local default = data.regionType and local default = data.regionType and Private.regionTypes[data.regionType] and Private.regionTypes[data.regionType].default
Private.regionTypes[data.regionType] and
Private.regionTypes[data.regionType].default
if default then if default then
Private.validate(data, default) Private.validate(data, default)
end end
@@ -2837,7 +2835,7 @@ function WeakAuras.Add(data, simpleChange)
if (data.internalVersion or 0) < internalVersion then if (data.internalVersion or 0) < internalVersion then
Private.SetMigrationSnapshot(data.uid, data) Private.SetMigrationSnapshot(data.uid, data)
end end
local ok, ret = pcall(WeakAuras.PreAdd, data, oldSnapshot) local ok = pcall(WeakAuras.PreAdd, data, oldSnapshot)
if ok then if ok then
pAdd(data, simpleChange) pAdd(data, simpleChange)
else else
@@ -2978,9 +2976,11 @@ local function EnsureRegion(id)
end end
return Private.regions[id] and Private.regions[id].region return Private.regions[id] and Private.regions[id].region
end end
--- Ensures that a region/clone exists and returns it --- Ensures that a region/clone exists and returns it
-- Even if we are asked to only create a clone, we create the default region too.
function Private.EnsureRegion(id, cloneId) function Private.EnsureRegion(id, cloneId)
-- Even if we are asked to only create a clone, we create the default region
-- too.
EnsureRegion(id) EnsureRegion(id)
if(cloneId and cloneId ~= "") then if(cloneId and cloneId ~= "") then
return EnsureClone(id, cloneId); return EnsureClone(id, cloneId);
@@ -3143,35 +3143,40 @@ local glow_frame_monitor
local anchor_unitframe_monitor local anchor_unitframe_monitor
Private.dyngroup_unitframe_monitor = {} Private.dyngroup_unitframe_monitor = {}
do do
local function frame_monitor_callback(event, frame, unit) local function frame_monitor_callback(event, frame, unit, previousUnit)
local new_frame local new_frame
local update_frame = event == "FRAME_UNIT_UPDATE" local FRAME_UNIT_UPDATE = event == "FRAME_UNIT_UPDATE"
local FRAME_UNIT_ADDED = event == "FRAME_UNIT_ADDED"
local FRAME_UNIT_REMOVED = event == "FRAME_UNIT_REMOVED"
local dynamicGroupsToUpdate = {} local dynamicGroupsToUpdate = {}
if type(glow_frame_monitor) == "table" then if type(glow_frame_monitor) == "table" then
for region, data in pairs(glow_frame_monitor) do for region, data in pairs(glow_frame_monitor) do
if region.state and UnitIsUnit(region.state.unit, unit) if region.state and type(region.state.unit) == "string" and UnitIsUnit(region.state.unit, unit)
and (data.frame ~= frame) == update_frame and ((data.frame ~= frame) and (FRAME_UNIT_ADDED or FRAME_UNIT_UPDATE))
or ((data.frame == frame) and FRAME_UNIT_REMOVED)
then then
if not new_frame then if not new_frame then
new_frame = WeakAuras.GetUnitFrame(unit) or WeakAuras.HiddenFrames new_frame = WeakAuras.GetUnitFrame(unit)
end end
if new_frame and new_frame ~= data.frame then if new_frame ~= data.frame then
local id = region.id .. (region.cloneId or "") local id = region.id .. (region.cloneId or "")
-- remove previous glow -- remove previous glow
if data.frame then if data.frame then
actionGlowStop(data.actions, data.frame, id) actionGlowStop(data.actions, data.frame, id)
end end
-- apply the glow to new_frame
data.frame = new_frame data.frame = new_frame
actionGlowStart(data.actions, data.frame, id) if new_frame then
-- update hidefunc -- apply the glow to new_frame
local region = region actionGlowStart(data.actions, data.frame, id)
region.active_glows_hidefunc = region.active_glows_hidefunc or {} -- update hidefunc
region.active_glows_hidefunc[data.frame] = function() local region = region
actionGlowStop(data.actions, data.frame, id) region.active_glows_hidefunc = region.active_glows_hidefunc or {}
glow_frame_monitor[region] = nil region.active_glows_hidefunc[data.frame] = function()
actionGlowStop(data.actions, data.frame, id)
glow_frame_monitor[region] = nil
end
end end
end end
end end
@@ -3179,21 +3184,23 @@ do
end end
if type(anchor_unitframe_monitor) == "table" then if type(anchor_unitframe_monitor) == "table" then
for region, data in pairs(anchor_unitframe_monitor) do for region, data in pairs(anchor_unitframe_monitor) do
if region.state and region.state.unit == unit if region.state and type(region.state.unit) == "string" and UnitIsUnit(region.state.unit, unit)
and (data.frame ~= frame) == update_frame and ((data.frame ~= frame) and (FRAME_UNIT_ADDED or FRAME_UNIT_UPDATE))
or ((data.frame == frame) and FRAME_UNIT_REMOVED)
then then
if not new_frame then if not new_frame then
new_frame = WeakAuras.GetUnitFrame(unit) or WeakAuras.HiddenFrames new_frame = WeakAuras.GetUnitFrame(unit) or WeakAuras.HiddenFrames
end end
if new_frame and new_frame ~= data.frame then if new_frame ~= data.frame then
Private.AnchorFrame(data.data, region, data.parent) Private.AnchorFrame(data.data, region, data.parent)
end end
end end
end end
end end
for regionData, data_frame in pairs(Private.dyngroup_unitframe_monitor) do for regionData, data_frame in pairs(Private.dyngroup_unitframe_monitor) do
if regionData.region and regionData.region.state and regionData.region.state.unit == unit if regionData.region.state and type(regionData.region.state.unit) == "string" and UnitIsUnit(regionData.region.state.unit, unit)
and (data_frame ~= frame) == update_frame and ((data_frame ~= frame) and (FRAME_UNIT_ADDED or FRAME_UNIT_UPDATE))
or ((data_frame == frame) and FRAME_UNIT_REMOVED)
then then
if not new_frame then if not new_frame then
new_frame = WeakAuras.GetUnitFrame(unit) or WeakAuras.HiddenFrames new_frame = WeakAuras.GetUnitFrame(unit) or WeakAuras.HiddenFrames
@@ -3207,10 +3214,10 @@ do
for frame in pairs(dynamicGroupsToUpdate) do for frame in pairs(dynamicGroupsToUpdate) do
frame:DoPositionChildren() frame:DoPositionChildren()
end end
end end
LGF.RegisterCallback("WeakAuras", "FRAME_UNIT_UPDATE", frame_monitor_callback) LGF.RegisterCallback("WeakAuras", "FRAME_UNIT_UPDATE", frame_monitor_callback)
LGF.RegisterCallback("WeakAuras", "FRAME_UNIT_ADDED", frame_monitor_callback)
LGF.RegisterCallback("WeakAuras", "FRAME_UNIT_REMOVED", frame_monitor_callback) LGF.RegisterCallback("WeakAuras", "FRAME_UNIT_REMOVED", frame_monitor_callback)
end end
@@ -3218,8 +3225,7 @@ function Private.HandleGlowAction(actions, region)
if actions.glow_action if actions.glow_action
and ( and (
( (
(actions.glow_frame_type == "UNITFRAME" or (actions.glow_frame_type == "UNITFRAME" or actions.glow_frame_type == "NAMEPLATE")
actions.glow_frame_type == "NAMEPLATE")
and region.state.unit and region.state.unit
) )
or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame) or (actions.glow_frame_type == "FRAMESELECTOR" and actions.glow_frame)
@@ -3560,6 +3566,7 @@ function Private.GetProgressSourcesForUi(data, subelement)
return result return result
end end
function Private.GetOverlayInfo(data, triggernum) function Private.GetOverlayInfo(data, triggernum)
local overlayInfo; local overlayInfo;
if (data.controlledChildren) then if (data.controlledChildren) then
@@ -4175,8 +4182,8 @@ local function startStopTimers(id, cloneId, triggernum, state)
state.changed = true; state.changed = true;
-- if the trigger has updated then check to see if it is flagged for WatchedTrigger and send to queue if it is -- if the trigger has updated then check to see if it is flagged for WatchedTrigger and send to queue if it is
if Private.watched_trigger_events[id] and Private.watched_trigger_events[id][triggernum] then if Private.watched_trigger_events[id] and Private.watched_trigger_events[id][triggernum] then
Private.AddToWatchedTriggerDelay(id, triggernum) Private.AddToWatchedTriggerDelay(id, triggernum)
end end
Private.UpdatedTriggerState(id); Private.UpdatedTriggerState(id);
end end
@@ -4239,11 +4246,11 @@ local function evaluateTriggerStateTriggers(id)
Private.ActivateAuraEnvironment(id) Private.ActivateAuraEnvironment(id)
local ok, returnValue = pcall(triggerState[id].triggerLogicFunc, triggerState[id].triggers); local ok, returnValue = pcall(triggerState[id].triggerLogicFunc, triggerState[id].triggers);
Private.ActivateAuraEnvironment() Private.ActivateAuraEnvironment()
if not ok then if ok then
result = returnValue
else
Private.GetErrorHandlerId(id, L["Custom Trigger Combination"]) Private.GetErrorHandlerId(id, L["Custom Trigger Combination"])
result = false result = false
else
result = returnValue
end end
end end
end end
@@ -4428,7 +4435,6 @@ function Private.UpdatedTriggerState(id)
state.changed = false; state.changed = false;
end end
end end
-- once updatedTriggerStates is complete, and empty states removed, etc., then check for queued watched triggers update -- once updatedTriggerStates is complete, and empty states removed, etc., then check for queued watched triggers update
Private.SendDelayedWatchedTriggers() Private.SendDelayedWatchedTriggers()
end end
@@ -4484,13 +4490,20 @@ local function ReplaceValuePlaceHolders(textStr, region, customFunc, state, form
end end
local index = tonumber(textStr:match("^c(%d+)$") or 1) local index = tonumber(textStr:match("^c(%d+)$") or 1)
if custom then if custom then
value = WeakAuras.EnsureString(custom[index]) value = custom[index]
end end
if value == nil then value = "" end
if formatter then if formatter then
value = formatter(value, state) value = formatter(value, state)
end end
if custom then
value = WeakAuras.EnsureString(value)
end
else else
local variable = Private.dynamic_texts[textStr]; local variable = Private.dynamic_texts[textStr];
if (not variable) then if (not variable) then
@@ -5243,7 +5256,6 @@ local function GetAnchorFrame(data, region, parent)
local anchorFrameType = data.anchorFrameType local anchorFrameType = data.anchorFrameType
local anchorFrameFrame = data.anchorFrameFrame local anchorFrameFrame = data.anchorFrameFrame
if not id then return end if not id then return end
if (personalRessourceDisplayFrame) then if (personalRessourceDisplayFrame) then
personalRessourceDisplayFrame:anchorFrame(id, anchorFrameType); personalRessourceDisplayFrame:anchorFrame(id, anchorFrameType);
end end
@@ -5352,7 +5364,7 @@ function Private.AnchorFrame(data, region, parent, force)
if not anchorParent then return end if not anchorParent then return end
if (data.anchorFrameParent or data.anchorFrameParent == nil if (data.anchorFrameParent or data.anchorFrameParent == nil
or data.anchorFrameType == "SCREEN" or data.anchorFrameType == "UIPARENT" 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); local ok = pcall(region.SetParent, region, anchorParent);
if not ok then if not ok then
Private.GetErrorHandlerId(data.id, L["Anchoring"]) Private.GetErrorHandlerId(data.id, L["Anchoring"])
end end
@@ -5524,6 +5536,10 @@ do
trackableUnits["raidpet" .. i] = true trackableUnits["raidpet" .. i] = true
end end
for i = 1, 100 do
trackableUnits["nameplate" .. i] = true
end
function WeakAuras.UntrackableUnit(unit) function WeakAuras.UntrackableUnit(unit)
return not trackableUnits[unit] return not trackableUnits[unit]
end end
@@ -5639,7 +5655,6 @@ function Private.ExecEnv.ParseZoneCheck(input)
for id in string.gmatch(input, "%d+") do for id in string.gmatch(input, "%d+") do
matcher:AddId(tonumber(id)) matcher:AddId(tonumber(id))
end end
return matcher return matcher
end end
@@ -5647,7 +5662,7 @@ function WeakAuras.IsAuraLoaded(id)
return Private.loaded[id] return Private.loaded[id]
end end
function WeakAuras.CreateSpellChecker() function Private.ExecEnv.CreateSpellChecker()
local matcher = { local matcher = {
names = {}, names = {},
spellIds = {}, spellIds = {},
@@ -5820,3 +5835,4 @@ do
return data.regionType == "group" or data.regionType == "dynamicgroup" return data.regionType == "group" or data.regionType == "dynamicgroup"
end end
end end