Originally Posted by Seerah
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.