Slash Command Opening Frame
Hi Guys,
I am trying to learn by hand and research but I am a little stuck and have to take steps in very small amounts do to an injury. I am trying to make a slash command, that toggles a frame on and off. The command like "/paw" would open up a normal frame, created by lua. I have a feeling it has something to do with EventRegister? I can't seem to fit it together in my head. Any tips? |
Wowpedia has a good example on that.
https://wow.gamepedia.com/Creating_a_slash_command Depending on which frame it is you're looking to toggle on and off, it should be as simple as adding if not frame:IsShown() then frame:Show() else frame:Hide() end in your handler function (replacing "frame" with the frame in question, of course.) Not sure if :IsVisible() or :IsShown() would be preferable, you might have to experiment. Or someone probably knows. But since you'd be calling :Show() and :Hide() on that very same frame, :IsShown() should work fine. |
The IsShown method checks whether the frame would be shown, such as its parent is shown. IsVisible is a direct check on whether the frame is actually visible. If IsVisible is true, IsShown is always true, but IsVisible can be false while IsShown is true.
Neither account for 0 alpha or frame position being off screen. |
Thanks guys Ill take a good look at this.
|
Lua Code:
Ok fixed the lua errors. Nothing happens but I think it is the tga. |
The frame didn't have any height and a few other errors
Code:
local BottomPane = CreateFrame("Frame", "BottomPane", nil, UIParent) -- creates a frame named BottomPane. Note, we also set a variable called bottompane. |
Quote:
|
Lua Code:
The nil in your CreateFrame statement was incorrect, the third parameter is the parent. |
Quote:
|
Quote:
|
Quote:
|
Mostly green with occaisional leaps into the blue... this can't end anywhere good :eek:.
|
But Epics are the new Greens :D
|
All times are GMT -6. The time now is 06:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI