Thread Tools Display Modes
06-11-08, 03:24 PM   #1
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Tooltip Updating?

Is there any way to make the tooltip re-draw itself? I'd like to re-draw my tooltip when entering combat if i was hovering it at that time. Link to my addon in case you wish to look at the code. =)

Last edited by hipjipp : 06-14-08 at 05:08 AM.
  Reply With Quote
06-14-08, 09:35 AM   #2
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
anyone? :<
  Reply With Quote
06-14-08, 10:55 AM   #3
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
The only way I can think of, is to register your frame to the combat events (PLAYER_REGEN_ENABLED and _DISABLED are used often if i remember right) and then, in the event function, call the enter-function again.
You would have to check if your button-tooltip is shown at the moment (otherwise it would be shown everytime you enter/leave combat) - maybe by adding a variable which is toggled true/false on entering/leaving combat.

Ah, don't forget to clear the tooltip from all text - GameTooltip:ClearLines() should do it.

I hope, I could help you
  Reply With Quote
06-14-08, 12:02 PM   #4
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
I really appreciate the help, although i have no idea about writing event code like this... And especially changing/calling another function in it.. Could you help me out more?
  Reply With Quote
06-14-08, 12:56 PM   #5
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
After running again and again into the basilisk next to Shattrath to get into combat and figuring out that your InCombatLockdown() doesn't work directly after PLAYER_REGEN_DISABLED, I got the solution

I've build it in your HBarHide-code: http://www.pastey.net/89544-3f44:89543-j6gw

Shouldn't be to complicated to understand it, the Event()-function will be called if combat state changes and then the GameTooltip-lines will be cleared. At last we call the Enter()-function so that it will insert the appropriate text into the tooltip.

edit: one question - why do you toggle the bars with SetPoint() ? I have such a bar toggle button in my interface as well (but it's not as nice as yours ) and I use the Show() and Hide() functions. So if the user moves his bars with another addon, the toggle button would not interfere in positioning.

Last edited by xConStruct : 06-14-08 at 01:00 PM.
  Reply With Quote
06-14-08, 02:19 PM   #6
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 79
Thanks ALOT mate! Still learning so i'm trying the best i can to get things to work. I understand 90% of all code (counting code like the one ammo types (more deep C++ code)), so i'm fine.

About the edit, i havn't really though about it.. I like to play around with positions, and since i stack my bars on top of eachother (with Hbar) i dont want to hide only the mainmenubar and leave the petbar and MBBR hanging there.. Would look weird.. But on the other hand, it IS anchored to it.. I'll check it out later. Gonna fiddle with LynStats now. =)

Edit: Tried the Show() and Hide(), but it doesn't work as i want it, and besides, if someone *only* uses HBarHide, the graphic will still be there, but the bar wont.. Witch would look retarded IMO... Your code works like a charm though and i credited you in my code.. the new one will be uploaded later tonight.. =)

Last edited by hipjipp : 06-14-08 at 02:40 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Tooltip Updating?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off