Fix naming in combatalerter

This commit is contained in:
2025-01-26 18:08:10 +01:00
parent 407d8f2da2
commit 6c234e7fa4

View File

@@ -69,44 +69,27 @@ function shared.CombatAlerter.Init()
SetMapToCurrentZone() SetMapToCurrentZone()
SetMapByID(GetCurrentMapAreaID()) SetMapByID(GetCurrentMapAreaID())
---@type Message local areaId = GetCurrentMapAreaID()
local msg = {
channel = "C", for _, channel in pairs(Heimdall_Data.config.combatAlerter.channels) do
data = Heimdall_Data.config.combatAlerter.masterChannel, local locale = shared.GetLocaleForChannel(channel)
message = string.format(shared.L.en.combatAlerterInCombat, local text = string.format(shared._L("combatAlerterInCombat", locale),
source, source,
zone, subZone, shared._L("zone", locale), shared._L("subZone", locale),
tostring(GetCurrentMapAreaID()), tostring(areaId),
x * 100, y * 100 x * 100, y * 100
), )
} ---@type Message
local msg = {
if Heimdall_Data.config.combatAlerter.debug then
print(string.format("[%s] Queuing alert message: '%s'", ModuleName, msg.message))
end
table.insert(shared.messenger.queue, msg)
if not shared.L.ru.zones[zone] then
print(string.format("[%s] Zone %s not found in ru.zones", ModuleName, zone))
end
zone = shared.L.ru.zones[zone] or zone
if not shared.L.ru.zones[subZone] then
print(string.format("[%s] Subzone %s not found in ru.zones", ModuleName, subZone))
end
subZone = shared.L.ru.zones[subZone] or subZone
if Heimdall_Data.config.echoToRussian then
-- Russian message
local ruMsg = {
channel = "C", channel = "C",
data = Heimdall_Data.config.combatAlerter.masterChannel .. "ru", data = channel,
message = string.format(shared.L.ru.combatAlerterInCombat, message = text,
source,
zone, subZone,
tostring(GetCurrentMapAreaID()),
x * 100, y * 100
),
} }
table.insert(shared.messenger.queue, ruMsg) if Heimdall_Data.config.combatAlerter.debug then
print(string.format("[%s] Queuing alert message", ModuleName))
shared.dumpTable(msg)
end
table.insert(shared.messenger.queue, msg)
end end
elseif Heimdall_Data.config.combatAlerter.debug then elseif Heimdall_Data.config.combatAlerter.debug then
print(string.format("[%s] Source not in stinky list, ignoring: %s", ModuleName, source)) print(string.format("[%s] Source not in stinky list, ignoring: %s", ModuleName, source))