Fix up sound notifications in stinky detector

This commit is contained in:
2024-10-20 17:06:02 +02:00
parent 03b0c8f74b
commit 5c6b37731d
2 changed files with 16 additions and 3 deletions

View File

@@ -93,8 +93,9 @@ function(allstates, e, prefix, msg, ...)
return false
end
if not allstates[name] then
if not aura_env.soundNotifyTimer[name] or aura_env.soundNotifyTimer[name] < GetTime() then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
aura_env.soundNotifyTimer[name] = GetTime() + aura_env.config.alertThrottle
end
allstates[name] = {

View File

@@ -1,4 +1,17 @@
---@type Message[]
---@class aura_env
---@field messageQueue Message[]
---@field separator string
---@field addonprefix string
---@field config table<string, any>
---@field stinkies Stinky[]
---@field raceFactions table<string, string>
---@field localStinkies table<string, Stinky>
---@field soundNotifyTimer table<string, number>
---@field GetZone fun(): string
---@field RegisterKill fun(source: string, destination: string, spellName: string, overkill: number)
---@field StinkyDetected fun(name: string)
aura_env.soundNotifyTimer = {}
aura_env.messageQueue = {}
aura_env.separator = "ž"
aura_env.addonprefix = "STINKY_DETECTOR"
@@ -22,7 +35,6 @@ local toNotify = StrSplit(aura_env.config.notify, ",")
for i, part in ipairs(toNotify) do
toNotify[i] = strtrim(part)
end
---@type Stinky[]
aura_env.stinkies = {}