• 0

    posted a message on kgPanels Offical Thread
    Quote from eilenda
    After reading the numerous pages, and getting some example I adapted a script to simply hide Recount_MainWindow when I am not fighting, and showing when I start the fight.

    Thats a beginning to learn scripting with KGpanels.

    Script :

    On Load
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    self:RegisterEvent("PLAYER_REGEN_ENABLED")
    self:Hide()
    On Event
    if (event == "PLAYER_REGEN_ENABLED") then 
     Recount_MainWindow:Hide()
    elseif event == "PLAYER_REGEN_DISABLED" then 
     Recount_MainWindow:Show()
    end
    So far the window shows when I start fighting and hide when I stop.
    But if I take a portal, or simply log in game, then Recount shows.

    So if I could get a little help to finalise my script I would appreciate.


    -----
    Also I was curious to understand and sorry if my question is silly but I thought that with the patch our Regen stopped at rest and start at fight.

    If so that would mean that PLAYER_REGEN_ENABLED is now the beginning of the fight no ?

    Thank you


    I can help witht his one. Hehe. I was having the same problem until I had read a DK post who was having this issue and copied the code he was told to replace and simply replaced "DEATHKNIGHT" with "HUNTER". I've asked as well, if this is the proper way to do it (post above this one). It works 100% so I'll paste it for you.

    OnLoad
    if select(2, UnitClass("player")) == "HUNTER" then
    self:RegisterEvent("PLAYER_REGEN_ENABLED")
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    end
    self:Hide()

    Just replace "HUNTER" with your player's class. I'm sure there is a better way seeing as doing this we would have to duplicate the panels for every otehr class we want using the pannel(s) we are trying to hide ooc. At least for now, this works.

    As for the REGEN question. I assume it's the same as always otherwise these panels would show ooc and hide ic. *shrug*
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Q: How would I have a panel show only when in combat with a pet?

    Currently I have the panel showing when in combat and hidden ooc. However it also displays even without my pet active which I've realized I do not want. I have tried a few different ideas, each to no avail.

    So I thought I would ask here for help.

    Also note, my OnLoad is the same as one from a previous DK post because even tho I am a Hunter, I had the same problem he did with the frame being shown on login, but then working properly after the first combat.

    ---Start
    OnLoad
    if select(2, UnitClass("player")) == "HUNTER" then
    self:RegisterEvent("PLAYER_REGEN_ENABLED")
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    end
    self:Hide()

    OnEvent
    if event == "PLAYER_REGEN_ENABLED" then
    self:Hide()
    elseif event == "PLAYER_REGEN_DISABLED" then
    self:Show()
    end

    Thanks for the help. Since I've been getting better at Kgpanels, I'm only loving it more and more. Thanks for the help.

    - Arrowsong
    Posted in: General AddOns
  • To post a comment, please or register a new account.