Add zone to note

This commit is contained in:
2024-10-14 19:44:49 +02:00
parent c1972f461f
commit caa6e0e379
3 changed files with 18 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ function(allstates, e, prefix, msg, ...)
local faction = UnitFactionGroup("nameplate" .. i) local faction = UnitFactionGroup("nameplate" .. i)
local _, race = UnitRace("nameplate" .. i) local _, race = UnitRace("nameplate" .. i)
local raceFaction = aura_env.raceFactions[race] local raceFaction = aura_env.raceFactions[race]
if not raceFaction then if not raceFaction and aura_env.config.debug then
print("Unknown race faction", race) print("Unknown race faction", race)
else else
faction = raceFaction faction = raceFaction
@@ -72,6 +72,11 @@ function(allstates, e, prefix, msg, ...)
end end
return return
end end
if not note then
if aura_env.config.debug then
print(string.format("Could not get note for %s (%s) with deliminer '%s'", msg, note or "nil", aura_env.separator))
end
end
if threat < aura_env.config.threatThreshold then if threat < aura_env.config.threatThreshold then
if aura_env.config.debug then if aura_env.config.debug then
@@ -80,6 +85,9 @@ function(allstates, e, prefix, msg, ...)
return return
end end
local stinky = aura_env.stinkies[name]
if not stinky then return false end
if not allstates[name] then if not allstates[name] then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master") PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
end end
@@ -87,7 +95,7 @@ function(allstates, e, prefix, msg, ...)
allstates[name] = { allstates[name] = {
show = true, show = true,
changed = true, changed = true,
name = string.format("%-30s", name), name = string.format("%-20s%2d%35s", name, stinky.threat, note),
progressType = "timed", progressType = "timed",
duration = 60, duration = 60,
expirationTime = GetTime() + aura_env.config.alertThrottle, expirationTime = GetTime() + aura_env.config.alertThrottle,

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,5 @@
-- TODO: Add zone detection and all that shit so we're not always in orgrimmar -- TODO: Add zone detection and all that shit so we're not always in orgrimmar
-- see GetSubZoneText() and GetZoneText()
---@type Message[] ---@type Message[]
aura_env.messageQueue = {} aura_env.messageQueue = {}
@@ -158,12 +159,12 @@ Stinky = {
---@param self Stinky ---@param self Stinky
---@return string ---@return string
FormMessage = function(self) FormMessage = function(self)
return string.format("%s в Оргриммаре!", self.name) return string.format("%s in %s!", self.name, aura_env.GetZone())
end, end,
---@param self Stinky ---@param self Stinky
---@return string ---@return string
FormAddonMessage = function(self) FormAddonMessage = function(self)
return table.concat({ self.name, self.threat, self.note }, aura_env.separator) return table.concat({ self.name, self.threat, aura_env.GetZone() }, aura_env.separator)
end, end,
} }
@@ -225,6 +226,10 @@ aura_env.raceFactions = {
["Worgen"] = "Alliance", ["Worgen"] = "Alliance",
} }
aura_env.GetZone = function()
return string.format("%s (%s)", GetZoneText(), GetSubZoneText())
end
local killSpamTime = 30 local killSpamTime = 30
local recentlyKilled = {} local recentlyKilled = {}
aura_env.RegisterKill = function(source, destination, spellName, overkill) aura_env.RegisterKill = function(source, destination, spellName, overkill)