Refactor separator and addon prefix out of options

This commit is contained in:
2024-10-14 15:46:44 +02:00
parent 2ca86e0944
commit 34c76b7087
4 changed files with 15 additions and 7 deletions

View File

@@ -1,5 +1,8 @@
---@type Message[]
aura_env.messageQueue = {}
aura_env.separator = "\\"
aura_env.addonprefix = "STINKY_DETECTOR"
RegisterAddonMessagePrefix(aura_env.addonprefix)
---@type string[]
local toNotify = { "Succpotato", "Extazyk", "Smokefire", "Smokemantra", "Хихихантер", "Муркот", "Растафаркрай" }
@@ -79,7 +82,7 @@ Message = {
QueueNotifyKilledAddonGuild = function(faction, source, destination, spellName)
if not aura_env.config.killNotifyAddonGuild then return end
if aura_env.config.debug then print("Queueing notify addon guild:") end
local text = string.format("%s|%s|%s|%s", faction, source, destination, spellName)
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination, aura_env.separator, spellName)
local message = Message.new(text, nil, "GUILD", true)
if aura_env.config.debug then DevTools_Dump(message) end
table.insert(aura_env.messageQueue, message)
@@ -91,7 +94,7 @@ Message = {
QueueNotifyKilledAddonWhisper = function(faction, source, destination, spellName)
if not aura_env.config.killNotifyAddonWhisper then return end
if aura_env.config.debug then print("Queueing notify addon whisper:") end
local text = string.format("%s|%s|%s|%s", faction, source, destination, spellName)
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination, aura_env.separator, spellName)
for _, to in ipairs(toNotify) do
local message = Message.new(text, to, "WHISPER", true)
if aura_env.config.debug then DevTools_Dump(message) end
@@ -158,7 +161,7 @@ Stinky = {
---@param self Stinky
---@return string
FormAddonMessage = function(self)
return string.format("%s|%s|%s", self.name, self.threat, self.note)
return string.format("%s%s%s%s%s", self.name, aura_env.separator, self.threat, aura_env.separator, self.note)
end,
}