-
Posted by nibs on Thu, 19 Jul 2012 00:00:31
I created a button in kgPanels that uses either the Hearthstone or The Innkeeper's Daughter, whichever the player currently uses. I would like to have a mouseover tooltip that will display whether or not it is for the Hearthstone or The Innkeeper's Daughter and i would like it to display the remaining cool down. If there was a way to make this happen it would be great. Thanks in advance!
-
Posted by jnwhiteh on Thu, 19 Jul 2012 07:18:38
You can use the OnMouseOver script to trigger a tooltip, which you can do using GameTooltip. I dont know if kgpanels does anything special, but you should just be able to do this the normal way.
-
Posted by nibs on Thu, 19 Jul 2012 15:13:00
Thanks for the reply. Unfortunately for me i'm horribly novice at programming and i really don't have much of an idea of how to use those commands. Would you be able to help me come up with the code for this? All i want is a mouseover tool tip that will find out if you have either a Hearthstone or The Innkeeper's Daughter in your bags and display the cool down remaining. I would like it if i didn't have to specify which bag and slot the Hearthstone/Innkeeper's Daughter was placed in, as this is meant to be a distributed UI and everyone keeps theirs in a different spot. Thanks.
-
Posted by jnwhiteh on Thu, 19 Jul 2012 15:53:46
Yeah, unfortunately that's more code than I have the time to commit to writing right now. Perhaps someone else might be able to point you in the right direction.
-
Posted by stolenlegacy on Fri, 20 Jul 2012 14:52:03
Would look something like this:
local fBag,fSlot for bag=0,NUM_BAG_SLOTS do for slot=1,GetContainerNumSlots(bag) do local id = GetContainerItemID(bag,slot) if (id == 6948) or (id == 64488) then fBag, fSlot = bag, slot break end end if fBag then break end end if not fBag then return end GameTooltip:SetOwner(self,"ANCHOR_NONE") GameTooltip:SetPoint("TOP",self,"BOTTOM",0,-5) GameTooltip:SetBagItem(fBag,fSlot) GameTooltip:Show()
PS: You'd simply do
GameTooltip:Hide()
in your OnLeave. -
Posted by jnwhiteh on Fri, 20 Jul 2012 16:14:47
You're a gem SL :P