Flatten repo layout, drop nested HideCoAUI subfolder
The addon folder is now the repo root, so installers rename the extracted archive to HideCoAUI instead of finding a subfolder already named that.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
local commands = {}
|
||||
|
||||
local function RegisterCommand(name, description, handler)
|
||||
table.insert(commands, { name = name, description = description, handler = handler })
|
||||
end
|
||||
|
||||
HideCoAUI.RegisterSlashCommand = RegisterCommand
|
||||
|
||||
local function PrintCommandList()
|
||||
print("|cff33ff99HideCoAUI|r commands:")
|
||||
for _, command in ipairs(commands) do
|
||||
print(" |cffffffff/hidecoaui " .. command.name .. "|r - " .. command.description)
|
||||
end
|
||||
end
|
||||
|
||||
local function HandleSlashCommand(msg)
|
||||
|
||||
local commandName = msg:match("^%s*(%S*)"):lower()
|
||||
|
||||
if commandName == "" then
|
||||
HideCoAUI.OpenOptions()
|
||||
return
|
||||
end
|
||||
|
||||
for _, command in ipairs(commands) do
|
||||
if command.name == commandName then
|
||||
command.handler()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
print("|cff33ff99HideCoAUI|r unknown command: /hidecoaui " .. commandName)
|
||||
PrintCommandList()
|
||||
|
||||
end
|
||||
|
||||
SLASH_HIDECOAUI1 = "/hidecoaui"
|
||||
SlashCmdList["HIDECOAUI"] = HandleSlashCommand
|
||||
Reference in New Issue
Block a user