Hi all. Anyone knows how to show/hide (toggle) a kgpanel with a macro? Thanks.
Hi all. Anyone knows how to show/hide (toggle) a kgpanel with a macro? Thanks.
You use "/run kgPanels:Fetch("your_panel"):Show()" or Hide(), and replace "your_panel" with the name of that panel you created in kgPanels but leave in the quotes.
This slash command (once you have renamed the "your_panel" part to the panel's name) will make the macro hide the panel when it is visible and show it when it is not.Code:/run if kgPanels:Fetch("your_panel"):IsVisible() then kgPanels:Fetch("your_panel"):Hide() else kgPanels:Fetch("your_panel"):Show() end
Last edited by mmoc2c0e080e79; 2014-03-31 at 12:23 AM.
I don´t know if I miss something, but this code won´t work. If only work as a lua code, how I can bind this code to a macro?
Thanks
It is the "/run" line in the 2nd code block. You create a new macro and just add that line to it. I have tested it and it will work.
For example my "/run if Minimap:IsVisible() then Minimap:Hide() else Minimap:Show() end" macro works for showing and hiding the Minimap :/
The "/run" macro slash command will execute the Lua code so it can be run like a macro.
I got it to work using the following method:
1) Type "/framestack" which will show you a list of panels that you mouseover.
2) Your panel will be "kgPanel#" (replace"#" with the number showni.e. mine is kgPanel7)
3) Use the macro Mayron posted above as so:
Note: The frame name will not be the name that you used for the frame in kgpanels.Code:/run if kgPanel#:IsVisible() then kgPanel#:Hide() else kgPanel#:Show() end
Last edited by WhiteWolf87; 2014-04-21 at 02:07 PM. Reason: added note
I advise against using kgPanel# because this number assigned to kgPanel panels does not always stay the same. If you add more panels then it can change but usually it changes each time you log into the game as frames are loaded in a different order depending on the order of what panel/s you last edited. The "kgPanels:Fetch("your_panel")" method is much more reliable. Also you can use "/fs" as a short cut instead of "/framestack"