WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR API and Graphics Changes (https://www.wowinterface.com/forums/forumdisplay.php?f=175)
-   -   Dragonflight : BuffButton : GameTooltips (https://www.wowinterface.com/forums/showthread.php?t=59302)

Platine 10-31-22 04:32 AM

Dragonflight : BuffButton : GameTooltips
 
In the patch 10.0.0 the handling of the BuffButtonX buttons has changed. When you hover the mouse over an aura button - it is not possible to get the name of this button. Always returns nil.

Code:

GameTooltip:HookScript('OnShow', function(self, ...)
  print("The mouse is over " .. GetMouseFocus():GetName());  -- return nil
  local GTownerName = self:GetOwner():GetName();              -- return nil
  print(GTownerName); 
end );


Is there any other method of detecting that the description displayed in GameTooltips is from the Aura button?

We can use the BuffFrame.AuraContainer:IsMouseOver() function

SDPhantom 10-31-22 03:46 PM

I get the feeling this is part of some bigger picture which has an easier solution than what you're focused on currently.

It's certainly possible if you absolutely need to filter out tooltip handling to specific buttons, but there's a point where the performance cost would be drastically higher than hooking the OnEnter handler of your target buttons for example.

Right now, there's just not enough information of the overall process to suggest a better alternative.



Another example is how BuffOwner was written. The goal of the addon was to show who was the caster of a buff or debuff. I could've followed the same route of hooking whenever the tooltip was shown and figure out if the calling button was from an aura button. Instead, I came to the conclusion that it didn't need to know that. All it needed was the buff's info, and hooking the appropriate :Set() functions that generate the description in the first place would be adequate for retrieving it.


All times are GMT -6. The time now is 05:00 AM.

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