From 6c5d62289c3467d5cbc1a78bb097c5f0e969475c Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+NoM0Re@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:26:23 +0200 Subject: [PATCH] add ismoving condition trigger --- WeakAuras/GenericTrigger.lua | 2 +- WeakAuras/Prototypes.lua | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index c38e3a3..b900410 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -3279,7 +3279,7 @@ do end function WeakAuras.WatchPlayerMoveSpeed() - if not(playerMovingFrame) then + if not (playerMovingFrame) then playerMovingFrame = CreateFrame("frame"); WeakAuras.frames["Player Moving Frame"] = playerMovingFrame; end diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 5eea288..7dd92da 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -6037,8 +6037,12 @@ Private.event_prototypes = { internal_events = function(trigger, untrigger) local events = { "CONDITIONS_CHECK"}; + if trigger.use_ismoving ~= nil then + tinsert(events, "PLAYER_MOVE_SPEED_UPDATE"); + end + if (trigger.use_HasPet ~= nil) then - AddUnitChangeInternalEvents("pet", events) + AddUnitChangeInternalEvents("pet", events); end return events; @@ -6046,6 +6050,10 @@ Private.event_prototypes = { force_events = "CONDITIONS_CHECK", name = L["Conditions"], loadFunc = function(trigger) + if (trigger.use_ismoving ~= nil) then + WeakAuras.WatchPlayerMoveSpeed(); + end + if (trigger.use_mounted ~= nil) then WeakAuras.WatchForMounts(); end @@ -6102,6 +6110,12 @@ Private.event_prototypes = { type = "tristate", init = "UnitExists('pet') and not UnitIsDead('pet')" }, + { + name = "ismoving", + display = L["Is Moving"], + type = "tristate", + init = "GetUnitSpeed('player') > 0" + }, { name = "afk", display = L["Is Away from Keyboard"],