Add color configuration functionality to Channeler

Introduced a new function, ConfigureColor, to handle the configuration of chat colors. This includes clicking through the settings menu and enabling color classes for chat channels. Added slash commands /fixcolors and /fc to trigger the new functionality.
This commit is contained in:
2025-06-29 13:48:37 +02:00
parent 76533da851
commit 1d26dec51c

View File

@@ -134,6 +134,66 @@ local function Configure()
end
end
local function ConfigureColor()
print("[Channeler] Configuring colors")
local firstChatTab = _G["ChatFrame1Tab"]
if firstChatTab == nil then
print("[Channeler] ChatFrame1Tab is nil")
return
end
firstChatTab:Click("RightButton")
local ok = false
for i = 1, 10 do
local dropdownButton = _G["DropDownList1Button" .. i]
if dropdownButton ~= nil and dropdownButton:GetText() == "Settings" then
print(string.format("[Channeler] Clicking on %s", dropdownButton:GetText()))
dropdownButton:Click()
ok = true
break
end
end
if not ok then
print("[Channeler] Settings button not found")
return
end
local firstConfig = _G["ChatConfigCategoryFrameButton1"]
if firstConfig == nil then
print("[Channeler] First config button not found")
return
end
print(string.format("[Channeler] Clicking on %s", firstConfig:GetText()))
firstConfig:Click()
for i = 1, 16 do
local buttonName = string.format("ChatConfigChatSettingsLeftCheckBox%dColorClasses", i)
local classColorButton = _G[buttonName]
if classColorButton ~= nil and classColorButton:GetChecked() == false then
print(string.format("[Channeler] Clicking on %s", buttonName))
classColorButton:Click()
end
end
local secondConfig = _G["ChatConfigCategoryFrameButton3"]
if secondConfig == nil then
print("[Channeler] Second config button not found")
return
end
print(string.format("[Channeler] Clicking on %s", secondConfig:GetText()))
secondConfig:Click()
for i = 1, 16 do
local buttonName = string.format("ChatConfigChannelSettingsLeftCheckBox%dColorClasses", i)
local classColorButton = _G[buttonName]
if classColorButton ~= nil and classColorButton:GetChecked() == false then
print(string.format("[Channeler] Clicking on %s", buttonName))
classColorButton:Click()
end
end
print("[Channeler] Colors configured")
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_LOGIN")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -146,3 +206,8 @@ end)
SlashCmdList["CHANNELER"] = function(msg) Configure() end
SLASH_CHANNELER1 = "/fix"
SLASH_CHANNELER2 = "/f"
-- /run SlashCmdList["CHANNELER_COLORS"]()
SlashCmdList["CHANNELER_COLORS"] = function(msg) ConfigureColor() end
SLASH_CHANNELER1 = "/fixcolors"
SLASH_CHANNELER2 = "/fc"