diff --git a/FreshShit/StinkyDetector/event2.lua b/FreshShit/StinkyDetector/event2.lua index 7aec1ac..a522fa7 100644 --- a/FreshShit/StinkyDetector/event2.lua +++ b/FreshShit/StinkyDetector/event2.lua @@ -22,7 +22,7 @@ function(allstates, e, prefix, msg, ...) allstates[stinky].changed = true aura_env.detectedStinkies[stinky] = nil else - allstates[stinky].progress = string.format("%20s", elapsed) + allstates[stinky].progress = string.format("%20ss", string.format("%.1f", elapsed)) allstates[stinky].changed = true end else @@ -35,7 +35,7 @@ function(allstates, e, prefix, msg, ...) expirationTime = GetTime() + ttl, autohide = true, index = GetTime(), - progress = string.format("%20s", elapsed) + progress = string.format("%20ss", string.format("%.1f", elapsed)) } end end diff --git a/FreshShit/StinkyDetector/init.lua b/FreshShit/StinkyDetector/init.lua index 75a2129..0c8e012 100644 --- a/FreshShit/StinkyDetector/init.lua +++ b/FreshShit/StinkyDetector/init.lua @@ -1,7 +1,7 @@ ---@class aura_env ---@field config table ---@field stinkies table ----@field detectedStinkies table +---@field detectedStinkies table ---@field StinkyDetected fun(name: string) aura_env.stinkies = {} aura_env.detectedStinkies = {} @@ -25,12 +25,16 @@ for _, name in ipairs(stinkies) do end aura_env.StinkyDetected = function(name) - print("StinkyDetected", name) - DevTools_Dump(aura_env.detectedStinkies) - aura_env.detectedStinkies[name] = { seen = GetTime() } - if not aura_env.detectedStinkies[name].soundPlayed or - aura_env.detectedStinkies[name].soundPlayed < GetTime() - aura_env.config.soundThrottle then - PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master") - aura_env.detectedStinkies[name].soundPlayed = GetTime() + local now = GetTime() + local existing = aura_env.detectedStinkies[name] + if not existing then + aura_env.detectedStinkies[name] = { seen = now, muteUntil = 0 } + else + existing.seen = now end + if existing.muteUntil < now then + print(existing.muteUntil, now) + PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master") + end + aura_env.detectedStinkies[name].muteUntil = now + aura_env.config.alertThrottle end