-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.lua
46 lines (39 loc) · 1.1 KB
/
commands.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
function setupCommands()
windower.register_event('addon command', processCommands)
end
function processCommands(...)
local commands = {...}
local firstCommand = commands[1]
if firstCommand == 'reset' then
handleResetCommand()
elseif firstCommand == 'reload' then
handleReloadCommand()
elseif firstCommand == 'unload' then
handleUnloadCommand()
elseif firstCommand == 'toggle' then
handleToggleCommand()
else
handleHelpCommand()
end
end
function handleResetCommand()
clearUISession()
end
function handleReloadCommand()
windower.send_command('lua r '.._addon.name)
end
function handleUnloadCommand()
windower.send_command('lua u '.._addon.name)
end
function handleToggleCommand()
toggleUIVisibility()
end
function handleHelpCommand()
print('----------------------------')
print('-- Bit\'s XP Monitor --')
print('----------------------------')
print('//bxp reset - resets the current session')
print('//bxp toggle - toggles the visibility of bxp')
print('//bxp reload - reloads the entire bxp addon')
print('//bxp unload - unloads the entire bxp addon')
end