WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Tooltip is constantly reseting the backdrop (https://www.wowinterface.com/forums/showthread.php?t=56437)

zork 07-25-18 11:03 AM

Tooltip is constantly reseting the backdrop
 
I am trying to style the GameTooltip and am providing my own backdrop. On top I set my own backdrop color and backdrop border color. For items I am recoloring the border by item rarity.

When I am hovering over any item (like in the character window) that backdrop will be visible for a split second but then the backdrop changes to the default one including all color settings.

Has anyone worked with tooltips lately and has a tip on how to handle that?

Btw sometimes I am getting blueish tinted tooltip backgrounds. It mostly happens when hovering over objects like a portal. When you hover over a unit thereafter the blueish tint stays since I am only reseting the backdrop OnShow.

Any hints would be appreciated.

Torhal 07-25-18 11:08 AM

This is one of the main features of TipTac. You could look to see how Aezay is handling this (which had to be changed for BfA).

Ammako 07-25-18 11:37 AM

Quote:

Originally Posted by zork (Post 328965)
Btw sometimes I am getting blueish tinted tooltip backgrounds. It mostly happens when hovering over objects like a portal. When you hover over a unit thereafter the blueish tint stays since I am only reseting the backdrop OnShow.

That's a Blizzard bug, that happens if you don't let the tooltip fadeout completely before hovering over something else.

You can probably do something like this to prevent it from happening:

lua Code:
  1. GameTooltip:HookScript("OnTooltipSetUnit", function() GameTooltip:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, 1) end)

(Or with your own background colors, of course.)

Lolzen 07-25-18 12:09 PM

Had the same problem, i've just overwritten GAME_TOOLTIP_BACKDROP_STYLE_DEFAULT

zork 07-25-18 12:13 PM

Do you think overriding a default constant is a good idea? That can lead to a myriad of taints since the tooltip is used god knows where.

Lolzen 07-25-18 12:38 PM

Quote:

Originally Posted by zork (Post 328972)
Do you think overriding a default constant is a good idea? That can lead to a myriad of taints since the tooltip is used god knows where.

No, but hey, at least it doesn't "reset".

You could probably hook into GameTooltip_SetBackdropStyle() see here

VincentSDSH 07-25-18 04:01 PM

Quote:

Originally Posted by zork (Post 328972)
Do you think overriding a default constant is a good idea? That can lead to a myriad of taints since the tooltip is used god knows where.

Altering the GAME_TOOLTIP_BACKDROP_STYLE_DEFAULT doesn't cause any issues. You can update the functions or alter the data and it doesn't mind. Keep in mind that there's another default (GAME_TOOLTIP_BACKDROP_STYLE_AZERITE_ITEM) that gets conditionally applied if it's azerite gear.

This is what Tiptac wound up doing (see this ticket) and we've been testing it pretty heavily w/o any tainting issues.

zork 07-25-18 04:03 PM

Thanks all.

I was able to fix my issues. Here is the commit:

https://github.com/zorker/rothui/com...a1e35a75e8fc38

I opted for not using the OnUpdate. Not using it shows sometimes a blue tinted tooltip on portals/mailbox etc which I am totally fine with. Everything else is fixed now.

zork 07-26-18 11:59 PM

Where did the post from nevereg go? I thought about it a bit more and I think going for the GameTooltip_SetBackdropStyle hook might be a the best approach.

We can get rid of so many other hooks and we have access to the backdrop attributes from blizzard.

You could just match style against GAME_TOOLTIP_BACKDROP_STYLE_AZERITE_ITEM and know that the style you are handling is for azerite.

alternative A
Lua Code:
  1. local azerite = style == GAME_TOOLTIP_BACKDROP_STYLE_AZERITE_ITEM or false

alternative B
Lua Code:
  1. local _, itemLink = self:GetItem()
  2. local azerite = false
  3. if itemLink and (C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItemByID(itemLink) or C_AzeriteItem.IsAzeriteItemByID(itemLink)) then
  4.   azerite = true
  5. end

I am going to change my tooltip to that method. It seems convenient for what I am trying to do.

*edit* Commit hooking into SetBackdropStyle https://github.com/zorker/rothui/com...ceda45d583d2fa

myrroddin 07-27-18 02:31 AM

Quote:

Originally Posted by zork (Post 329069)

*edit* Commit hooking into SetBackdropStyle https://github.com/zorker/rothui/com...ceda45d583d2fa

Isn't line 172 missing a ) at the end?

zork 07-27-18 03:02 AM

Totally possible. It is a dry code atm.


All times are GMT -6. The time now is 02:21 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI