1. #1

    Help: How to light up Text on a kgPanel while mouseover

    Hi, I've been playing around with scripts and have learnt alot but I'm still a beginner. I'm working on my UI and I have a panel (using KGpanels) with text on it acting as a button and I've scripted it to do a function when its pressed. My problem is I would love it if the text would change colour from dark grey to white when you have your mouse over it. Would also be good if I could do something similar with the background of the button as well or even change to a third colour when pressed but I'd be happy with just the text for now.

    If anyone can help that would be greatly appreciated!

  2. #2
    Deleted
    You'll need to SetTextColor your FontString OnEnter and OnLeave, respectively.

  3. #3
    Thanks alot, figured out how to change the text, if anyone knows how to change the colour of the background of the panel OnEnter, OnLeave and also OnClick, that would be great!

    I also have another question with KgPanels but its no to do with this title of the post. If anyone can answer this as well that would be very helpful. I've got a script so that I can Hide and show a bartender action bar when the panel is pressed, however it doesn't stay the way you left it when you log out or reload the UI. It just stays shown even though you may have had it hidden when you logged out which is a pain. Is there a way to fix this?
    Last edited by MayronWoW; 2011-07-20 at 07:34 PM.

  4. #4
    There's two ways, one is easier than the other.

    The first, is to create a savedvar for your addon which simply is either set to true or nil. Then, when you go to hide the action bar, simply set your saved var to true, and when you show it again, set it to nil.

    Then, when the player logs in and your addon is loaded, (after bartender, look into dependencies) you can do something like:

    Code:
    if myaddonsavedvar then
        --hide bartender here
    end
    That way, when the player logs out, the saved var retains it's value on the next login, and you can just check its value to see whether it was hidden or shown when the player last logged off.



    As for your first question, I'm not sure if kgpanels has a built-in function to change the color of the panel (if it does you should use it before you do what I'm gonna say next). If it doesn't, it'd require some looking into to see how KGPanels creates the frames, and where the texture frames are located. (Treeston probably has an idea of how KGPanels already does it)

  5. #5
    Thanks, thats kinda confusing for me. I didn't understand what you ment by "my addon", I'm not trying to create my own so I don't know where to create the savedvar and where to put it. This seems far too complicated as I've only just started scripting with kgpanels. I thought maybe I could add some code into one of the scipts available with each kgpanel which could fix it. You make it sound simple, maybe I'm just getting confused with how to do it.

  6. #6
    Deleted
    You can probably modify BT4's SavedVar toggle for hiding bars. I'll take a look into it.

    ---------- Post added 2011-07-21 at 12:33 AM ----------

    Code:
    Bartender4.Bar.barregistry["4"]:SetVisibilityOption("always",not Bartender4.Bar.barregistry["4"]:GetVisibilityOption("always"))
    Replace 4 with the ID of the bar you want to toggle.
    Last edited by mmocba105e19de; 2011-07-20 at 10:33 PM.

  7. #7
    thanks, do i put that code somewhere in the bartender fold, in the bartender config menu or somewhere in kgpanels? sorry but I'm new to this

  8. #8
    Deleted
    Just replace your old script that you used to hide/show the BT4 bar.

  9. #9
    Thanks alot, it worked great except I got another problem:

    I hope this post isn't too old that no one will look anymore but I have a problem. When i use the panels to open up the other panel with the bartender bar on it, it works fine except in combat. When I'm in combat the bartender bar doesn't show as well as the background panel behind it. Any idea on this? :S
    Last edited by MayronWoW; 2011-07-21 at 09:26 PM.

Posting Permissions

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