Refactor channeldinger a little

This commit is contained in:
2024-08-24 22:51:16 +02:00
parent 41feaace69
commit 90f3494c73
2 changed files with 9 additions and 7 deletions

View File

@@ -6,7 +6,6 @@ aura_env.statee = ReactiveValue.new(0)
-- Say...
-- 0 - none
-- 1 - channeling
-- 2 - lasttick
aura_env.statee:onChange(function(newstate)
-- print("newstate ".. newstate)
@@ -14,13 +13,16 @@ aura_env.statee:onChange(function(newstate)
-- print("resetting ticks")
aura_env.tick:set(0)
end
if newstate == 2 then
WeakAuras.ScanEvents("PLAY_SOUND", "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\RobotBlip.ogg")
end
end)
aura_env.tick:onChange(function(ticks)
-- print("ticks " .. ticks)
if ticks == aura_env.totalTicks - 1 then
aura_env.statee:set(2)
if ticks > 0 then
if ticks == aura_env.totalTicks - 1 then
-- WeakAuras.ScanEvents("PLAY_SOUND", "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\RobotBlip.ogg")
PlaySoundFile("Interface\\AddOns\\WeakAuras\\Media\\Sounds\\RobotBlip.ogg", "Master")
-- elseif ticks == aura_env.totalTicks - 2 then
-- -- WeakAuras.ScanEvents("PLAY_SOUND", "Interface\\AddOns\\WeakAuras\\Media\\Sounds\\WaterDrop.ogg")
-- PlaySoundFile("Interface\\AddOns\\WeakAuras\\Media\\Sounds\\WaterDrop.ogg", "Master")
end
end
end)