Fix naming in bonkdetector
This commit is contained in:
@@ -12,13 +12,13 @@ function shared.BonkDetector.Init()
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
frame:SetScript("OnEvent", function(self, event, ...)
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Combat log event received", ModuleName))
|
||||
-- end
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Combat log event received", ModuleName))
|
||||
-- end
|
||||
if not Heimdall_Data.config.bonkDetector.enabled then
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Module disabled, ignoring combat event", ModuleName))
|
||||
-- end
|
||||
-- if Heimdall_Data.config.bonkDetector.debug then
|
||||
-- print(string.format("[%s] Module disabled, ignoring combat event", ModuleName))
|
||||
-- end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -86,30 +86,20 @@ function shared.BonkDetector.Init()
|
||||
ModuleName, source, destination, subevent))
|
||||
end
|
||||
|
||||
local notifyChannel = Heimdall_Data.config.bonkDetector.notifyChannel
|
||||
local msg = string.format("%s hit %s (%s)", source, destination, subevent)
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Queueing message to Agent channel: %s", ModuleName, msg))
|
||||
end
|
||||
for _, channel in pairs(Heimdall_Data.config.bonkDetector.channels) do
|
||||
local locale = shared.GetLocaleForChannel(channel)
|
||||
local msg = string.format(shared._L("bonkDetected", locale), source, destination, subevent)
|
||||
---@type Message
|
||||
local message = {
|
||||
channel = "C",
|
||||
data = notifyChannel,
|
||||
message = string.format(shared.L.en.bonkDetected, source, destination, subevent),
|
||||
data = channel,
|
||||
message = msg,
|
||||
}
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Queueing English message: %s", ModuleName, message.message))
|
||||
print(string.format("[%s] Queuing bonk detector message", ModuleName))
|
||||
shared.dumpTable(message)
|
||||
end
|
||||
table.insert(shared.messenger.queue, message)
|
||||
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMessage = {
|
||||
channel = "C",
|
||||
data = notifyChannel .. "ru",
|
||||
message = string.format(shared.L.ru.bonkDetected, source, destination, subevent),
|
||||
}
|
||||
table.insert(shared.messenger.queue, ruMessage)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user