Quantcast
Hide Tooltip Player/Class-Bar - WoWInterface
Thread Tools Display Modes
07-23-21, 08:03 AM   #1
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Hide Tooltip Player/Class-Bar

I tested some new textures and noticed that everytime I mouseover (own/player) class-specific bars like chi-, holypower-, eclipse-bar, a tooltip/frame will appear (GameTooltip.Center).

Screenshot example

Basically I am looking for a way to hide this specific Tooltip without effecting other GameTooltips.

It could get annoying in combat when hovering over it especially with higher scaled bars.

I found this two parts in the Blizzard-Code:

Lua
XML

I couldn't find any related CVars or code snippets.

Any help is much appreciated

Last edited by rulezyx : 07-23-21 at 08:07 AM. Reason: links, example
  Reply With Quote
07-27-21, 05:12 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,055
Here's what I've come up with so far. The brewmaster stagger bar inherits from AlternatePowerBar and that doesn't generate a tooltip from what I see.
Lunar/Insanity/Maelstrom take over the PlayerFrame's built-in power bar and cause AlternatePowerBar to show mana instead.

Lua Code:
  1. --  Disable ClassPowerBar Tooltips
  2. local ClassPowerBarFrames={
  3.     ComboPointPlayerFrame;
  4.     InsanityBarFrame;
  5.     MageArcaneChargesFrame;
  6.     MonkHarmonyBarFrame;
  7.     PaladinPowerBarFrame;
  8.     WarlockPowerFrame;
  9. };
  10. for _,bar in ipairs(ClassPowerBarFrames) do bar:SetTooltip(nil,nil); end
  11.  
  12. --  Manually Disable Tooltips
  13. local LegacyFrames={
  14.     PriestBarFrame;
  15.     RuneFrame.Rune1;
  16.     RuneFrame.Rune2;
  17.     RuneFrame.Rune3;
  18.     RuneFrame.Rune4;
  19.     RuneFrame.Rune5;
  20.     RuneFrame.Rune6;
  21.     TotemFrameTotem1;
  22.     TotemFrameTotem2;
  23.     TotemFrameTotem3;
  24.     TotemFrameTotem4;
  25. };
  26. for _,frame in ipairs(LegacyFrames) do
  27.     frame:SetScript("OnEnter",nil);
  28.     frame:SetScript("OnLeave",nil);
  29. end
  30.  
  31. --  Disable MonkLightEnergyTemplate Tooltips
  32. local LastNumOrbs=0;
  33. hooksecurefunc(MonkHarmonyBarFrame,"UpdateMaxPower",function(self)
  34.     local numorbs=#self.LightEnergy;
  35.     if numorbs>LastNumOrbs then--   Only apply to newly-created frames
  36.         for i=LastNumOrbs+1,numorbs do
  37.             local orb=self.LightEnergy[i];
  38.             orb:SetScript("OnEnter",nil);
  39.             orb:SetScript("OnLeave",nil);
  40.         end
  41.         LastNumOrbs=numorbs;
  42.     end
  43. end);
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 07-27-21 at 05:18 PM.
  Reply With Quote
07-28-21, 02:57 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,848
Could you just disable the mouse over those frames, or is that tied to something else I'm not thinking of?

(Would likely play nicer than setting the scripts to nil.)
__________________
"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
07-28-21, 04:54 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,055
Some frames like the totem buttons still need to respond to clicks. The 9.0 API does allow toggling click and motion separately. The only argument I see against clearing the scripts is breaking any addon hooking them, but you do that turning off motion anyway. Either way, the hooks stop running. The benefit of clearing scripts is they allow many XML-defined functions to be garbage collected. These being Lua code enclosed in script tags instead of linked using the function or method attributes.

It may just be me, but I rather free unused memory than leave it tied up. I like having a tidy environment.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
07-28-21, 10:40 PM   #5
rulezyx
A Flamescale Wyrmkin
 
rulezyx's Avatar
Join Date: Jan 2020
Posts: 106
Thank you for your code, clean as always and seems to do exactly what I want.

I have alot of code using much more memory than it could so I definitely get your point.

For my UI its over 1k lines and I am way too lazy to deal with that, hell no.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hide Tooltip Player/Class-Bar

Thread Tools
Display Modes

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