View Single Post
04-17-15, 02:22 PM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Seerah View Post
Ugh, registering/unregistering the event is the awful way to do it.
It is Blizzard code we're looking at. What else would you expect from them? I just think it's funny they didn't finish implementing it and left these functions orphaned in the command list.

In my custom dev addon, I completed their registration by linking them in the hash table with /erron and /erroff.
Code:
hash_SlashCmdList["/ERROFF"]=SlashCmdList.UI_ERRORS_OFF;
hash_SlashCmdList["/ERRON"]=SlashCmdList.UI_ERRORS_ON;


Note: Trying to register SLASH_<Tag># globals after FrameXML loads wouldn't work as they are processed into the hash file and the entries of SlashCmdList are moved into its metatable. The code I posted just provides the missing action of pushing pointers of the functions into the hash table and associating them with their slash commands. Also note the index needs to be uppercase as Blizzard code transforms typed commands to uppercase in order to perform case-insensitive lookups.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 04-17-15 at 02:38 PM.
  Reply With Quote