Originally Posted by RyinntheDK
Now to enhance the experience of the user, how would i pass show/hide on just /rcf, like a toggle?
|
If the user adds no parameters to the slash command the Msg variable should be Nil. So, this should work:
[e] As I read Choonsters reply I'm actually unsure if the value will be Nil or an empty string.
*shrug*
Lua Code:
local function Ryinn_Command(Msg) --"Editbox" was unused
if Msg then Msg=strlower(Msg); end
if Msg == "help" then
print("v"..AddonVersion)
print("Use /rcf + on/off to Enable/Disable")
print("Example: /rcf on")
elseif Msg == "on" then
frame:Show() -- Choonster: Showing the frame makes it visible and allows its OnUpdate handler to fire.
print("Ryinn's Flash Cursor is Now Enabled. Use /ryn off to disable")
elseif Msg == "off" then
frame:Hide() -- Choonster: Hiding the frame makes it invisible and stops its OnUpdate handler from firing.
--StaticPopup_Show("ReloadPop")
print("test")
elseif not Msg
if frame:IsVisible() then
frame:Hide()
else
frame:Show()
end
else
Ryinn_Command("help")
end
end