From b5b9a6f42db66478b0a730621072c74c671be628 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Wed, 10 Jul 2024 22:33:22 +0200 Subject: [PATCH] more changes to unrestrict nameplates --- WeakAuras/GenericTrigger.lua | 6 +++--- WeakAuras/Prototypes.lua | 2 +- WeakAurasOptions/GenericTrigger.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index d261191..bccc469 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -587,16 +587,16 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2 end elseif (data.statesParameter == "unit") then if optionsEvent then - if Private.multiUnitUnits[data.trigger.unit] then + if Private.multiUnitUnits[data.trigger.unit] or data.trigger.unit:sub(1, 9) == "nameplate" then arg1 = next(Private.multiUnitUnits[data.trigger.unit]) else arg1 = data.trigger.unit end - elseif event == "FRAME_UPDATE" and not Private.multiUnitUnits[data.trigger.unit] then + elseif event == "FRAME_UPDATE" and not (Private.multiUnitUnits[data.trigger.unit] or data.trigger.unit:sub(1, 9) == "nameplate") then arg1 = data.trigger.unit end if arg1 then - if Private.multiUnitUnits[data.trigger.unit] then + if Private.multiUnitUnits[data.trigger.unit] or data.trigger.unit:sub(1, 9) == "nameplate" then unitForUnitTrigger = arg1 cloneIdForUnitTrigger = arg1 else diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 24397f9..34b5fff 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -956,7 +956,7 @@ Private.load_prototype = { events = {"ZONE_CHANGED", "ZONE_CHANGED_INDOORS", "ZONE_CHANGED_NEW_AREA", "VEHICLE_UPDATE"}, desc = function() return ("\n|cffffd200%s|r%s: %d\n\n%s"):format(L["Current Zone\n"], GetRealZoneText(), GetCurrentMapAreaID(), L["Supports multiple entries, separated by commas"]) - end + end }, { name = "subzone", diff --git a/WeakAurasOptions/GenericTrigger.lua b/WeakAurasOptions/GenericTrigger.lua index 2725034..552727e 100644 --- a/WeakAurasOptions/GenericTrigger.lua +++ b/WeakAurasOptions/GenericTrigger.lua @@ -117,7 +117,7 @@ local function GetCustomTriggerOptions(data, triggernum) end elseif trueEvent:match("^UNIT_") then local unit = string.lower(i) - if not (OptionsPrivate.Private.baseUnitId[unit] or string.find(unit, "^nameplate%d+$")) and not OptionsPrivate.Private.multiUnitId[unit] then + if not (OptionsPrivate.Private.baseUnitId[unit] and OptionsPrivate.Private.multiUnitId[unit]) and not string.find(unit, "^nameplate%d+$") then return "|cFFFF0000"..L["Unit %s is not a valid unit for RegisterUnitEvent"]:format(unit) end end @@ -148,7 +148,7 @@ local function GetCustomTriggerOptions(data, triggernum) end elseif trueEvent:match("^UNIT_") then local unit = string.lower(i) - if not OptionsPrivate.Private.baseUnitId[unit] then + if not (OptionsPrivate.Private.baseUnitId[unit] or string.find(unit, "^nameplate%d+$")) then return false end end