Fix naming in combatalerter
This commit is contained in:
@@ -69,44 +69,27 @@ function shared.CombatAlerter.Init()
|
|||||||
|
|
||||||
SetMapToCurrentZone()
|
SetMapToCurrentZone()
|
||||||
SetMapByID(GetCurrentMapAreaID())
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
|
local areaId = GetCurrentMapAreaID()
|
||||||
|
|
||||||
|
for _, channel in pairs(Heimdall_Data.config.combatAlerter.channels) do
|
||||||
|
local locale = shared.GetLocaleForChannel(channel)
|
||||||
|
local text = string.format(shared._L("combatAlerterInCombat", locale),
|
||||||
|
source,
|
||||||
|
shared._L("zone", locale), shared._L("subZone", locale),
|
||||||
|
tostring(areaId),
|
||||||
|
x * 100, y * 100
|
||||||
|
)
|
||||||
---@type Message
|
---@type Message
|
||||||
local msg = {
|
local msg = {
|
||||||
channel = "C",
|
channel = "C",
|
||||||
data = Heimdall_Data.config.combatAlerter.masterChannel,
|
data = channel,
|
||||||
message = string.format(shared.L.en.combatAlerterInCombat,
|
message = text,
|
||||||
source,
|
|
||||||
zone, subZone,
|
|
||||||
tostring(GetCurrentMapAreaID()),
|
|
||||||
x * 100, y * 100
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if Heimdall_Data.config.combatAlerter.debug then
|
if Heimdall_Data.config.combatAlerter.debug then
|
||||||
print(string.format("[%s] Queuing alert message: '%s'", ModuleName, msg.message))
|
print(string.format("[%s] Queuing alert message", ModuleName))
|
||||||
|
shared.dumpTable(msg)
|
||||||
end
|
end
|
||||||
table.insert(shared.messenger.queue, msg)
|
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",
|
|
||||||
data = Heimdall_Data.config.combatAlerter.masterChannel .. "ru",
|
|
||||||
message = string.format(shared.L.ru.combatAlerterInCombat,
|
|
||||||
source,
|
|
||||||
zone, subZone,
|
|
||||||
tostring(GetCurrentMapAreaID()),
|
|
||||||
x * 100, y * 100
|
|
||||||
),
|
|
||||||
}
|
|
||||||
table.insert(shared.messenger.queue, ruMsg)
|
|
||||||
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))
|
||||||
|
|||||||
Reference in New Issue
Block a user