1. #1
    Deleted

    Kgpanels - Show/Hide panel with a macro

    Hi all. Anyone knows how to show/hide (toggle) a kgpanel with a macro? Thanks.

  2. #2
    Deleted
    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.

    Code:
    /run if kgPanels:Fetch("your_panel"):IsVisible() then kgPanels:Fetch("your_panel"):Hide() else kgPanels:Fetch("your_panel"):Show() end
    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.
    Last edited by mmoc2c0e080e79; 2014-03-31 at 12:23 AM.

  3. #3
    Deleted
    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

  4. #4
    Deleted
    Quote Originally Posted by kspadan View Post
    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.

  5. #5
    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:

    Code:
     /run if kgPanel#:IsVisible() then kgPanel#:Hide() else kgPanel#:Show() end
    Note: The frame name will not be the name that you used for the frame in kgpanels.
    Last edited by WhiteWolf87; 2014-04-21 at 02:07 PM. Reason: added note

  6. #6
    Deleted
    Quote Originally Posted by WhiteWolf87 View Post
    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:

    Code:
     /run if kgPanel#:IsVisible() then kgPanel#:Hide() else kgPanel#:Show() end
    Note: The frame name will not be the name that you used for the frame in kgpanels.
    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"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •