vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | Slash |
||
3 | This is the slash command handler for Bagnon |
||
4 | --]] |
||
5 | |||
6 | function BagnonSlash_DisplayHelp() |
||
7 | BagnonMsg(BAGNON_HELP_TITLE); |
||
8 | BagnonMsg(BAGNON_HELP_HELP); |
||
9 | BagnonMsg(BAGNON_HELP_SHOWBAGS); |
||
10 | BagnonMsg(BAGNON_HELP_SHOWBANK); |
||
11 | |||
12 | if( IsAddOnLoaded("Bagnon_Forever") ) then |
||
13 | BagnonMsg(BAGNON_FOREVER_HELP_DELETE_CHARACTER); |
||
14 | end |
||
15 | end |
||
16 | |||
17 | SlashCmdList["BagnonCOMMAND"] = function(msg) |
||
18 | if(not msg or msg == "") then |
||
19 | if( Bagnon_IsAddOnEnabled("Bagnon_Options") ) then |
||
20 | if(not IsAddOnLoaded("Bagnon_Options") ) then |
||
21 | LoadAddOn("Bagnon_Options"); |
||
22 | end |
||
23 | BagnonOptions:Show(); |
||
24 | else |
||
25 | BagnonSlash_DisplayHelp(); |
||
26 | end |
||
27 | else |
||
28 | local args = {}; |
||
29 | local word; |
||
30 | for word in string.gfind(msg, "[^%s]+") do |
||
31 | table.insert(args, word); |
||
32 | end |
||
33 | local cmd = string.lower(args[1]); |
||
34 | |||
35 | if(cmd == BAGNON_COMMAND_HELP) then |
||
36 | BagnonSlash_DisplayHelp(); |
||
37 | elseif(cmd == BAGNON_COMMAND_SHOWBANK) then |
||
38 | BagnonFrame_Toggle("Banknon"); |
||
39 | elseif(cmd == BAGNON_COMMAND_SHOWBAGS) then |
||
40 | BagnonFrame_Toggle("Bagnon"); |
||
41 | elseif(cmd == BAGNON_COMMAND_DEBUG_ON) then |
||
42 | BagnonSets.noDebug = nil; |
||
43 | BagnonMsg(BAGNON_DEBUG_ENABLED); |
||
44 | elseif(cmd == BAGNON_COMMAND_DEBUG_OFF) then |
||
45 | BagnonSets.noDebug = 1; |
||
46 | BagnonMsg(BAGNON_DEBUG_DISABLED); |
||
47 | elseif(cmd == BAGNON_FOREVER_COMMAND_DELETE_CHARACTER and IsAddOnLoaded("Bagnon_Forever") ) then |
||
48 | BagnonForever_RemovePlayer(args[2], args[3] or GetRealmName()); |
||
49 | end |
||
50 | end |
||
51 | end |
||
52 | |||
53 | SLASH_BagnonCOMMAND1 = "/bagnon"; |
||
54 | SLASH_BagnonCOMMAND2 = "/bgn"; |