Move notification and validation to event3

This commit is contained in:
2024-10-14 16:15:59 +02:00
parent 2be18890a9
commit a71b13e1bb
2 changed files with 18 additions and 40 deletions

View File

@@ -52,15 +52,25 @@ function(allstates, e, prefix, msg, ...)
end
if not prefix or prefix ~= aura_env.addonprefix then return end
local data = string.split(msg, aura_env.separator)
local name = data[1]
local threat = data[2]
local note = data[3]
local name, threat, note = string.split(aura_env.separator, msg)
if not name then
if aura_env.config.debug then
print("Could not get name for " .. msg)
end
return
end
allstates[stinky] = {
if threat < aura_env.config.threatThreshold then
if aura_env.config.debug then
print(string.format("Skipping notify due to low threat (%d < %d)", threat, aura_env.config.threatThreshold))
end
return
end
allstates[name] = {
show = true,
changed = true,
name = string.format("%-30s", stinky),
name = string.format("%-30s", name),
progressType = "timed",
duration = 60,
expirationTime = GetTime() + 60,
@@ -68,6 +78,7 @@ function(allstates, e, prefix, msg, ...)
index = GetTime(),
progress = string.format("%20s", "0s"),
}
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
return true
end