Fix naming in commander
This commit is contained in:
@@ -268,22 +268,32 @@ function shared.Commander.Init()
|
|||||||
local commanderChannelFrame = CreateFrame("Frame")
|
local commanderChannelFrame = CreateFrame("Frame")
|
||||||
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
|
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
-- if Heimdall_Data.config.commander.debug then
|
--if Heimdall_Data.config.commander.debug then
|
||||||
-- print(string.format("[%s] Event received", ModuleName))
|
-- print(string.format("[%s] Event received", ModuleName))
|
||||||
-- shared.dumpTable(Heimdall_Data.config.commander)
|
-- shared.dumpTable(Heimdall_Data.config.commander)
|
||||||
-- end
|
--end
|
||||||
if not Heimdall_Data.config.commander.enabled then
|
if not Heimdall_Data.config.commander.enabled then
|
||||||
-- if Heimdall_Data.config.commander.debug then
|
--if Heimdall_Data.config.commander.debug then
|
||||||
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
|
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
|
||||||
-- end
|
--end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
-- if Heimdall_Data.config.commander.debug then
|
local ok = false
|
||||||
-- print(string.format("[%s] Channel received: %s", ModuleName, channelname))
|
for _, channel in pairs(Heimdall_Data.config.commander.channels) do
|
||||||
-- end
|
if channel == channelname then
|
||||||
if channelname ~= Heimdall_Data.config.commander.masterChannel then return end
|
ok = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not ok then
|
||||||
|
if Heimdall_Data.config.commander.debug then
|
||||||
|
print(string.format("[%s] Channel name does not match any of the channels", ModuleName))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
sender = string.match(sender, "^[^-]+")
|
sender = string.match(sender, "^[^-]+")
|
||||||
if Heimdall_Data.config.commander.debug then
|
if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
||||||
|
|||||||
Reference in New Issue
Block a user