Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
a625f974c2 | |||
e94e9ed536 | |||
1d26dec51c | |||
76533da851 | |||
aa513a5c51 | |||
802ef6de6b | |||
653187437e | |||
ad96900f74 | |||
e66dcadf8d | |||
62d9ea2861 | |||
4618f3630b | |||
588b70a7fb | |||
eb6bb8629b | |||
bb522a6298 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.zip
|
5
.luacheckrc
Normal file
5
.luacheckrc
Normal 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
14
.luarc.json
Symbolic link
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"workspace": {
|
||||||
|
"library": [
|
||||||
|
"./Meta"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"diagnostics.disable": [
|
||||||
|
"unused-local",
|
||||||
|
"unused-vararg"
|
||||||
|
],
|
||||||
|
"diagnostics.globals": [
|
||||||
|
"aura_env"
|
||||||
|
]
|
||||||
|
}
|
114
Channeler.lua
114
Channeler.lua
@@ -5,11 +5,12 @@
|
|||||||
local debug = false
|
local debug = false
|
||||||
|
|
||||||
---@type Channel[]
|
---@type Channel[]
|
||||||
local channels = {
|
local ourchannels = {
|
||||||
{ name = "Horde", password = "garrosh" },
|
{ name = "Horde", password = "durotaner" },
|
||||||
{ name = "world_ru", password = nil },
|
{ name = "world_ru", password = nil },
|
||||||
{ name = "Agent", password = "agents42" },
|
{ name = "Agent", password = "agents42" },
|
||||||
{ name = "AgentRU", password = "42agents" },
|
{ name = "AgentRU", password = "42agents" },
|
||||||
|
{ name = "EssenceAgent", password = nil },
|
||||||
}
|
}
|
||||||
---@type string
|
---@type string
|
||||||
---@type string[]
|
---@type string[]
|
||||||
@@ -26,16 +27,16 @@ local subscribedMessageGroups = {
|
|||||||
"BATTLEGROUND_LEADER",
|
"BATTLEGROUND_LEADER",
|
||||||
"INSTANCE_CHAT",
|
"INSTANCE_CHAT",
|
||||||
"INSTANCE_CHAT_LEADER",
|
"INSTANCE_CHAT_LEADER",
|
||||||
"WHISPER"
|
"WHISPER",
|
||||||
}
|
}
|
||||||
---@type string[]
|
---@type string[]
|
||||||
local subscribedChannels = {
|
local subscribedChannels = {
|
||||||
"Agent",
|
"Agent",
|
||||||
"Horde",
|
"Horde",
|
||||||
"Foobar"
|
"Foobar",
|
||||||
}
|
}
|
||||||
|
|
||||||
local function JoinChannels()
|
local function JoinChannels(channels)
|
||||||
for _, channel in ipairs(channels) do
|
for _, channel in ipairs(channels) do
|
||||||
if channel.password then
|
if channel.password then
|
||||||
JoinPermanentChannel(channel.name, channel.password)
|
JoinPermanentChannel(channel.name, channel.password)
|
||||||
@@ -45,11 +46,11 @@ local function JoinChannels()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---@param chatFrameName string
|
---@param chatFrameName string
|
||||||
---@param groups string[]
|
---@param groups string[]
|
||||||
---@param channels string[]
|
---@param channels string[]
|
||||||
local function FindOrCreateChatFrame(chatFrameName, groups, channels)
|
local function FindOrCreateChatFrame(chatFrameName, groups, channels)
|
||||||
|
---@type Frame
|
||||||
local chatFrame = nil
|
local chatFrame = nil
|
||||||
|
|
||||||
if debug then print(string.format("Searching for chat window %s", chatFrameName)) end
|
if debug then print(string.format("Searching for chat window %s", chatFrameName)) end
|
||||||
@@ -121,36 +122,101 @@ local function Privjet(channelname)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function Configure()
|
local function Configure()
|
||||||
JoinChannels()
|
JoinChannels(ourchannels)
|
||||||
--FindOrCreateChatFrame("Auto", subscribedMessageGroups, subscribedChannels)
|
FindOrCreateChatFrame("Auto", subscribedMessageGroups, subscribedChannels)
|
||||||
--FindOrCreateChatFrame("world_ru", {}, { "world_ru" })
|
FindOrCreateChatFrame("world_ru", {}, { "world_ru" })
|
||||||
FindOrCreateChatFrame("Horde", {}, { "Horde" })
|
|
||||||
FindOrCreateChatFrame("AgentRU", {}, { "AgentRU" })
|
FindOrCreateChatFrame("AgentRU", {}, { "AgentRU" })
|
||||||
FindOrCreateChatFrame("Agent", {}, { "Agent" })
|
|
||||||
-- FindOrCreateChatFrame("Agent", {}, { "Agent" })
|
C_Timer.After(1, function() Privjet("Agent") end)
|
||||||
Privjet("Horde")
|
|
||||||
C_Timer.After(1, function()
|
|
||||||
Privjet("Agent")
|
|
||||||
end)
|
|
||||||
|
|
||||||
for i = 1, NUM_CHAT_WINDOWS do
|
for i = 1, NUM_CHAT_WINDOWS do
|
||||||
SetChatWindowSize(i, 14)
|
SetChatWindowSize(i, 14)
|
||||||
end
|
end
|
||||||
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")
|
local frame = CreateFrame("Frame")
|
||||||
frame:RegisterEvent("PLAYER_LOGIN")
|
frame:RegisterEvent("PLAYER_LOGIN")
|
||||||
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
frame:SetScript("OnEvent", function(self, event, ...)
|
frame:SetScript("OnEvent", function(self, event, ...)
|
||||||
Configure()
|
Configure()
|
||||||
C_Timer.After(1, function()
|
C_Timer.After(1, function() Configure() end)
|
||||||
Configure()
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
--Configure()
|
--Configure()
|
||||||
|
|
||||||
SlashCmdList["CHANNELER"] = function(msg)
|
SlashCmdList["CHANNELER"] = function(msg) Configure() end
|
||||||
Configure()
|
|
||||||
end
|
|
||||||
SLASH_CHANNELER1 = "/fix"
|
SLASH_CHANNELER1 = "/fix"
|
||||||
SLASH_CHANNELER2 = "/f"
|
SLASH_CHANNELER2 = "/f"
|
||||||
|
|
||||||
|
-- /run SlashCmdList["CHANNELER_COLORS"]()
|
||||||
|
SlashCmdList["CHANNELER_COLORS"] = function(msg) ConfigureColor() end
|
||||||
|
SLASH_CHANNELER_COLORS1 = "/fixcolors"
|
||||||
|
SLASH_CHANNELER_COLORS2 = "/fc"
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
## Interface: 70300
|
## Interface: 70300
|
||||||
## Title: Channeler
|
## Title: Channeler
|
||||||
|
## Version: 1.6.0
|
||||||
## Notes: Automatically sets up chat channels
|
## Notes: Automatically sets up chat channels
|
||||||
## Author: Cyka
|
## Author: Cyka
|
||||||
|
|
||||||
|
BIN
Channeler.zip
(Stored with Git LFS)
BIN
Channeler.zip
(Stored with Git LFS)
Binary file not shown.
2
Meta
2
Meta
Submodule Meta updated: ef958d6385...bfc09c1720
12
stylua.toml
Symbolic link
12
stylua.toml
Symbolic link
@@ -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
|
Reference in New Issue
Block a user