-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslashcmd.lua
49 lines (42 loc) · 1.2 KB
/
slashcmd.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local _addonName, _addon = ...;
local L = _addon:GetLocalization();
SLASH_HITLIST1 = "/hl";
SLASH_HITLIST2 = "/hitlist";
SlashCmdList["HITLIST"] = function(arg)
if arg == "show" then
_addon:MainUI_OpenList();
return;
end
if arg == "add" then
_addon:MainUI_ShowAddForm();
return;
end
if arg == "settings" then
-- Open settings panel
InterfaceOptionsFrame_OpenToCategory(_addonName);
-- REEEEEEEEEEEEEEEE
InterfaceOptionsFrame_OpenToCategory(_addonName);
return
end
if arg == "debug" then
Hitlist_settings.debug = not Hitlist_settings.debug;
local actstr = "off";
if Hitlist_settings.debug then actstr = "on"; end
print("Debug output is now " .. actstr);
return;
end
if arg == "update" then
_addon:SyncRequestFullList();
return;
end
if arg == "nearby" then
_addon:NearbyList_Show();
return;
end
print(L["SLASH_CHAT_COMMANDS"]);
print(L["SLASH_CHAT_SETTINGS"]:format(SLASH_HITLIST1, "settings"));
print(L["SLASH_CHAT_OPEN"]:format(SLASH_HITLIST1, "show"));
print(L["SLASH_CHAT_ADD"]:format(SLASH_HITLIST1, "add"));
print(L["SLASH_CHAT_NEARBY"]:format(SLASH_HITLIST1, "nearby"));
print(L["SLASH_CHAT_UPDATE"]:format(SLASH_HITLIST1, "update"));
end;