add ismoving condition trigger

This commit is contained in:
NoM0Re
2024-07-13 16:26:23 +02:00
parent 0d29781570
commit 6c5d62289c
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -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
+15 -1
View File
@@ -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"],