Slashcommandhandler
Hi,
my code doesn't seem to work: function MaggyAssigner_SlashHandler(msg) local Cmd = MaggyAssigner_GetCmd(msg); if (Cmd == "help") then MaggyAssigner_DisplayHelp(); elseif (Cmd == "show") then MaggyAssigner_DisplayMe(); else MaggyAssigner_DisplayHelp(); end end function MaggyAssigner_DisplayMe() MaggyAssigner:Show(); end function Maggy_DisplayHelp() DEFAULT_CHAT_FRAME:AddMessage("HELP!"); end function MaggyAssigner_OnLoad() SlashCmdList["MaggyAssigner"] = MaggyAssigner_SlashHandler(msg); SLASH_MaggyAssigner1 = "/show"; SLASH_MaggyAssigner2 = "/help"; end The form's onload event: MaggyAssigner_OnLoad(); What am I doing wrong? rg, Eric |
/help is used by the Blizzard UI. That may be part of it.
What kind of errors are you getting? Are your slash commands not being recognized? |
Quote:
Secondly, where is this function (MaggyAssigner_GetCmd(msg)) and why are you calling it and not directly checking the msg argument ? |
Ok, changed the code to:
function MaggyAssigner_SlashHandler(msg) if (msg == "help") then MaggyAssigner_DisplayHelp(); elseif (msg == "show") then MaggyAssigner_DisplayMe(); else MaggyAssigner_DisplayHelp(); end end function MaggyAssigner_DisplayMe() MaggyAssigner:Show(); end function Maggy_DisplayHelp() DEFAULT_CHAT_FRAME:AddMessage("HELP!"); end function MaggyAssigner_OnLoad() SlashCmdList["MaggyAssigner"] = MaggyAssigner_SlashHandler(); SLASH_MaggyAssigner1 = "/show"; SLASH_MaggyAssigner2 = "/help"; end As I understand it, I should get my frame visible with: /show don't I? As you can see I am very new to this. :D |
SlashCmdList["MaggyAssigner"] = MaggyAssigner_SlashHandler;
No '()'. Post if it works now, at least the slash commands should. The frame may (or may not) have other issues |
I'm noticing that no function called by the form is working.
I have two buttons on my form. One has in the OnClick event: Form_name:Hide(); If I change it to call a function in the lua file, nothing happens. Do I have to 'connect' the lua file and form file somehow? |
found it... apparently in WoW UI Designer Function is not the same as function.
:D :banana: Thanks for the assist! (many more questions to come! :D ) |
All times are GMT -6. The time now is 12:11 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI