From 9465daedd86a686a8b74d74531171e96ad99ee54 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 23 Jan 2022 16:53:19 +0300 Subject: [PATCH] add event FRAME_UPDATE in Power prototype for non milti unit units, player, target and etc (aka UNIT_POWER_FREQUENT in retail) --- WeakAuras/GenericTrigger.lua | 2 ++ WeakAuras/Prototypes.lua | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 4c4f97a..0b0f77a 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -563,6 +563,8 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2 else arg1 = data.trigger.unit end + elseif event == "FRAME_UPDATE" and not Private.multiUnitUnits[data.trigger.unit] then + arg1 = data.trigger.unit end if arg1 then if Private.multiUnitUnits[data.trigger.unit] then diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 95db4f7..877e076 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1560,11 +1560,15 @@ Private.event_prototypes = { AddUnitEventForEvents(result, unit, "UNIT_DISPLAYPOWER") AddUnitEventForEvents(result, unit, "UNIT_HAPPINESS") AddUnitEventForEvents(result, unit, "UNIT_NAME_UPDATE") - if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then AddUnitEventForEvents(result, unit, "UNIT_FLAGS") end - + if unit and not Private.multiUnitUnits[unit] then + if not result.events then + result.events = {} + end + tinsert(result.events, "FRAME_UPDATE") + end return result; end, internal_events = function(trigger)