Tumble files around a bit
This commit is contained in:
44
WeakAuras/Projects/StinkyDetector/event2.lua
Normal file
44
WeakAuras/Projects/StinkyDetector/event2.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
-- TICKER_1000
|
||||
---@param allstates allstates
|
||||
---@param e string
|
||||
---@param prefix string
|
||||
---@param msg string
|
||||
function(allstates, e, prefix, msg, ...)
|
||||
for i = 1, 40 do
|
||||
if UnitIsPlayer("nameplate" .. i) then
|
||||
local name = UnitName("nameplate" .. i)
|
||||
if aura_env.stinkies[name] then
|
||||
aura_env.StinkyDetected(name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local ttl = aura_env.config.ttl or 10
|
||||
for stinky, data in pairs(aura_env.detectedStinkies) do
|
||||
local elapsed = GetTime() - data.seen
|
||||
if allstates[stinky] then
|
||||
if elapsed > ttl then
|
||||
allstates[stinky].show = false
|
||||
allstates[stinky].changed = true
|
||||
aura_env.detectedStinkies[stinky] = nil
|
||||
else
|
||||
allstates[stinky].progress = string.format("%20ss", string.format("%.1f", elapsed))
|
||||
allstates[stinky].changed = true
|
||||
end
|
||||
else
|
||||
allstates[stinky] = {
|
||||
show = true,
|
||||
changed = true,
|
||||
name = string.format("%-20s", stinky),
|
||||
progressType = "timed",
|
||||
duration = ttl,
|
||||
expirationTime = GetTime() + ttl,
|
||||
autohide = true,
|
||||
index = GetTime(),
|
||||
progress = string.format("%20ss", string.format("%.1f", elapsed))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
Reference in New Issue
Block a user