Thread Tools Display Modes
09-16-09, 07:15 AM   #1
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
GameTooltip Backdrop

I'm trying to change the background on all my tooltips to black but there's one "tooltip" that is eluding me but it shouldn't... or should it...?

I'm going to post an image to go with this.



The first part of the image shows my hook to the SetBackdropColor function that prints out the name & color that it's trying to use. The 2nd part shows a working example of the GameTooltip when hover over a mob. The 3rd part shows an tooltip (Should be GameTooltip) which I cannot change background color on when hovering over a "World Object".

Now does anyone know how to change the background on the last (3rd) tooltip when hovering over world objects.

I've tried the following an none fully work.

lua Code:
  1. TOOLTIP_DEFAULT_BACKGROUND_COLOR = { r = 0, g = 0, b = 0 };
  2.  
  3. GameTooltip:HookScript("OnShow", function(self)
  4.     self:SetBackdropColor(0,0,0)
  5. end)
  6. GameTooltip:HookScript("OnHide", function(self)
  7.     self:SetBackdropColor(0,0,0)
  8. end)

The HookScript worked somewhat but only worked when I let the tooltip have time to fully hide (waiting full duration of fade out) otherwise it would reset back to normal (blue background)


Best regards,
Yourstruly
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
09-16-09, 11:40 AM   #2
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Im not sure off hand but on my UI those tooltips do have adjusted backgrounds. In other words the background file i have made and set threw the addon TipTac change accordingly. I would take a look at TipTac and maybe you can figure out from that how its changed?

I also have an issue with the background holding on to tooltips its not supposed to when i cursor from one tooltiped object to another. maybe the same issue you are having with having to wait for it to fade all the way. To be more exact when i mouse over something that has an aggro type which then causes the target tooltip to highlight according to the aggro of the target IE friendly, hostile so on and so forth, that highlighting will transfer over to none aggro related tooltips unless i let the first tooltip fade completely. sounds similar to your issue.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-17-09, 03:19 AM   #3
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Looked into it and it seems there's no addon currently available that doesn't have this "bug", the only way around it removing the fade (which some do) and thus triggering Hide/Show instanteously.

Now this gets me wondering... Is there a hidden tooltip function somewhere with predefined blue background as I thought TOOLTIP_DEFAULT_BACKGROUND_COLOR would be enough.

Edit:

Tried hooking SetText and world objects do not even trigger it...?
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 09-17-09 at 03:41 AM.
  Reply With Quote
09-17-09, 09:07 AM   #4
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
I wonder if that is why mine appears to work is because i have the instant show/hide setup on world tips.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-17-09, 09:20 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Code:
for k, v in next, {GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2, ShoppingTooltip3} do
	v:HookScript('OnShow', function(self)
		self:SetBackdropColor(0, 0, 0)
	end)
end

Last edited by p3lim : 09-17-09 at 11:45 AM.
  Reply With Quote
09-17-09, 10:23 AM   #6
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Whoa, no need to quote a wall of text but thanks for trying to help p3lim.

As I said no tooltip addon I found has solved this any other way than hiding object tooltips directly.

The code you generously provided is no different from mine as we're still talking about GameTooltip
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
09-17-09, 10:41 AM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The code works perfectly fine. Works for TipTop (the pre-2.0 version, 2.x has a background frame for GameTooltip). I even just backdated my TipTop version (to when it hooked GameTooltip's OnShow to change the color) and it works. All tooltips were gray. Then I even typed this into chat:
Code:
/run GameTooltip:HookScript("OnShow", function() GameTooltip:SetBackdropColor(0,0,0) end)
And all tooltips were black instead of the gray that TipTop made them.

Are you trying this with all other addons disabled? What happens if you pass the fourth arg to SetBackdropColor? (alpha)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-17-09, 10:46 AM   #8
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Point over a unit, now before tooltip disappears point over a banner, sign or anything of the sort. Voilą. Nothing so far can change that color.

Just using TOOLTIP_DEFAULT_BACKGROUND_COLOR will change all backgrounds except for the background on banners, signs and stuff like that.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
09-17-09, 11:30 AM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
look at tiptac, the color you are setting is the shading color i think. That is what seems to hold on when you dont let a tip Hide first.

Either way though it is possible to change that background color. TipTac does it... or at lest i made tiptac do it by making my own background and boarder textures, embedding ShardMidia hooks into my UI for my textures and then loading them up with TipTac.

Ah.... textures..... maybe the issue is you can not change the back ground color.... only the texture used as the background. Set gametooltip background texture to a artfile that is nothing more then a black box.

Anyway my texture/background file is used for all tips in the game except for the compare tips. All world frame tips have my background.

How ever.... in the way that i did things for some reason the background shading hangs between tips. like i had said earlier in the thread. When i target a mob or npc who has background aggro shading in the tooltip when i then mouse over a world tip or fubar or buttonbin the shading hangs on to the tooltip unless i let the mob tip fade first.

Anyhow... it is possible one way or another.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
09-17-09, 11:46 AM   #10
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Yourstruly View Post
Point over a unit, now before tooltip disappears point over a banner, sign or anything of the sort. Voilą. Nothing so far can change that color.

Just using TOOLTIP_DEFAULT_BACKGROUND_COLOR will change all backgrounds except for the background on banners, signs and stuff like that.
I dont have this issue with my code.
  Reply With Quote
09-17-09, 11:53 AM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Well, I just tried without TipTop loaded and it was doing what you see. I don't get why it's acting different.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-17-09, 04:07 PM   #12
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Hmm.. Maybe this helps. Only happens on objects that anchor the tooltip to the mouse.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
09-17-09, 04:35 PM   #13
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Yourstruly View Post
Hmm.. Maybe this helps. Only happens on objects that anchor the tooltip to the mouse.
Still no issue.
  Reply With Quote
09-18-09, 04:24 AM   #14
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Did a full repair and no addons loaded.

Now to test in Dalaran

Test object #1 Mailbox
Test object #2 Teleport Crystal
Test object #3 Hunter's Reach sign (mouse-anchored tooltip)
Test object #4 Hunter's Reach ground sign, NEW IN STOCK (mouse-anchored tooltip)

I will be reloading UI between all tests


Code:
/script TOOLTIP_DEFAULT_BACKGROUND_COLOR = { r = 1, g = 0, b = 0 };
Result: All backgrounds except for all the test objects became red


Code:
/run GameTooltip:HookScript("OnShow", function(self) self:SetBackdropColor(1,0,0) end)
Result: All backgrounds are changed on initial mouse over.
Mouse over a unit and then to test objects resulted in #3 & #4 turning back to blue background but #1 & #2 held their red colors.

Code:
/run GameTooltip:HookScript("OnShow", function(self) print("Show") end)
/run GameTooltip:HookScript("OnHide", function(self) print("Hide") end)
Result: OnShow does not fire for #3 and #4 when going from a unit to them unless you wait for the tooltip from the unit to disappear first.


Code:
/run hooksecurefunc(GameTooltip, "SetOwner", function() print("Owner changed") end)
Result: SetOwner does not fire for for #3 and #4

------------------

So it seems like there's another tooltip which we don't know about..?

GameTooltip
SmallTextTooltip (most likely not used as it's not complete)
ItemRefTooltip
ShoppingTooltip1
ShoppingTooltip2
ShoppingTooltip3
WorldMapTooltip
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 09-18-09 at 04:27 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GameTooltip Backdrop


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