Compare commits

14 Commits

Author SHA1 Message Date
a625f974c2 Fix slash command variables for color configuration in Channeler 2025-06-29 13:51:49 +02:00
e94e9ed536 Click "OK " after configuring colors 2025-06-29 13:50:43 +02:00
1d26dec51c 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.
2025-06-29 13:48:37 +02:00
76533da851 Ignore zip 2025-06-11 14:43:08 +02:00
aa513a5c51 Code format 2025-06-11 14:40:41 +02:00
802ef6de6b Update horde password
And clean up metadata a bit
2025-06-11 14:36:28 +02:00
653187437e Update meta 2025-06-11 14:36:17 +02:00
ad96900f74 Add meta files 2025-06-11 14:11:16 +02:00
e66dcadf8d Update meta 2025-06-11 14:10:42 +02:00
62d9ea2861 Add luarc.json 2025-05-04 14:44:10 +02:00
4618f3630b Code format 2025-05-04 14:40:20 +02:00
588b70a7fb Update meta with stylua 2025-05-04 14:40:16 +02:00
eb6bb8629b Update 2025-04-16 20:11:21 +02:00
bb522a6298 Add version to toc 2025-01-11 13:51:10 +01:00
8 changed files with 124 additions and 28 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.zip

5
.luacheckrc Normal file
View File

@@ -0,0 +1,5 @@
globals = { "CykaPersistentData", "CreateFrame", "GetItemInfo", "aura_env" }
unused_args = false
max_line_length = 500
exclude_files = { "Meta/" }
global = false

14
.luarc.json Symbolic link
View File

@@ -0,0 +1,14 @@
{
"workspace": {
"library": [
"./Meta"
]
},
"diagnostics.disable": [
"unused-local",
"unused-vararg"
],
"diagnostics.globals": [
"aura_env"
]
}

View File

@@ -5,11 +5,12 @@
local debug = false
---@type Channel[]
local channels = {
{ name = "Horde", password = "garrosh" },
local ourchannels = {
{ name = "Horde", password = "durotaner" },
{ name = "world_ru", password = nil },
{ name = "Agent", password = "agents42" },
{ name = "AgentRU", password = "42agents" },
{ name = "EssenceAgent", password = nil },
}
---@type string
---@type string[]
@@ -26,16 +27,16 @@ local subscribedMessageGroups = {
"BATTLEGROUND_LEADER",
"INSTANCE_CHAT",
"INSTANCE_CHAT_LEADER",
"WHISPER"
"WHISPER",
}
---@type string[]
local subscribedChannels = {
"Agent",
"Horde",
"Foobar"
"Foobar",
}
local function JoinChannels()
local function JoinChannels(channels)
for _, channel in ipairs(channels) do
if channel.password then
JoinPermanentChannel(channel.name, channel.password)
@@ -45,11 +46,11 @@ local function JoinChannels()
end
end
---@param chatFrameName string
---@param groups string[]
---@param channels string[]
local function FindOrCreateChatFrame(chatFrameName, groups, channels)
---@type Frame
local chatFrame = nil
if debug then print(string.format("Searching for chat window %s", chatFrameName)) end
@@ -121,36 +122,101 @@ local function Privjet(channelname)
end
local function Configure()
JoinChannels()
--FindOrCreateChatFrame("Auto", subscribedMessageGroups, subscribedChannels)
--FindOrCreateChatFrame("world_ru", {}, { "world_ru" })
FindOrCreateChatFrame("Horde", {}, { "Horde" })
JoinChannels(ourchannels)
FindOrCreateChatFrame("Auto", subscribedMessageGroups, subscribedChannels)
FindOrCreateChatFrame("world_ru", {}, { "world_ru" })
FindOrCreateChatFrame("AgentRU", {}, { "AgentRU" })
FindOrCreateChatFrame("Agent", {}, { "Agent" })
-- FindOrCreateChatFrame("Agent", {}, { "Agent" })
Privjet("Horde")
C_Timer.After(1, function()
Privjet("Agent")
end)
C_Timer.After(1, function() Privjet("Agent") end)
for i = 1, NUM_CHAT_WINDOWS do
SetChatWindowSize(i, 14)
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
local okButton = _G["ChatConfigFrameOkayButton"]
if okButton == nil then
print("[Channeler] Ok button not found")
return
end
print(string.format("[Channeler] Clicking on %s", okButton:GetText()))
okButton:Click()
print("[Channeler] Colors configured")
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_LOGIN")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent", function(self, event, ...)
Configure()
C_Timer.After(1, function()
Configure()
end)
C_Timer.After(1, function() Configure() end)
end)
--Configure()
SlashCmdList["CHANNELER"] = function(msg)
Configure()
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_CHANNELER_COLORS1 = "/fixcolors"
SLASH_CHANNELER_COLORS2 = "/fc"

View File

@@ -1,5 +1,6 @@
## Interface: 70300
## Title: Channeler
## Version: 1.6.0
## Notes: Automatically sets up chat channels
## Author: Cyka

BIN
Channeler.zip (Stored with Git LFS)

Binary file not shown.

2
Meta

Submodule Meta updated: ef958d6385...bfc09c1720

12
stylua.toml Symbolic link
View File

@@ -0,0 +1,12 @@
syntax = "All" # Specify a disambiguation for the style of Lua syntax being formatted. Possible options: All (default), Lua51, Lua52, Lua53, Lua54, LuaJIT, Luau, CfxLua
column_width = 120 # Approximate line length for printing. Used as a guide for line wrapping - this is not a hard requirement: lines may fall under or over the limit.
line_endings = "Windows" # Line endings type. Possible options: Unix (LF) or Windows (CRLF)
indent_type = "Tabs" # Indent type. Possible options: Tabs or Spaces
indent_width = 4 # Character size of single indentation. If indent_type is set to Tabs, this option is used as a heuristic to determine column width only.
quote_style = "AutoPreferDouble" # Quote style for string literals. Possible options: AutoPreferDouble, AutoPreferSingle, ForceDouble, ForceSingle. AutoPrefer styles will prefer the specified quote style, but fall back to the alternative if it has fewer string escapes. Force styles always use the specified style regardless of escapes.
call_parentheses = "Always" # Whether parentheses should be applied on function calls with a single string/table argument. Possible options: Always, NoSingleString, NoSingleTable, None, Input. Always applies parentheses in all cases. NoSingleString omits parentheses on calls with a single string argument. Similarly, NoSingleTable omits parentheses on calls with a single table argument. None omits parentheses in both cases. Note: parentheses are still kept in situations where removal can lead to obscurity (e.g. foo "bar".setup -> foo("bar").setup, since the index is on the call result, not the string). Input removes all automation and preserves parentheses only if they were present in input code: consistency is not enforced.
space_after_function_names = "Never" # Specify whether to add a space between the function name and parentheses. Possible options: Never, Definitions, Calls, or Always
collapse_simple_statement = "Always" # Specify whether to collapse simple statements. Possible options: Never, FunctionOnly, ConditionalOnly, or Always
[sort_requires]
enabled = false