WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Hide Tooltip Player/Class-Bar (https://www.wowinterface.com/forums/showthread.php?t=58852)

rulezyx 07-23-21 08:03 AM

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:)

SDPhantom 07-27-21 05:12 PM

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);

Seerah 07-28-21 02:57 PM

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.)

SDPhantom 07-28-21 04:54 PM

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. :D

rulezyx 07-28-21 10:40 PM

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. :rolleyes:


All times are GMT -6. The time now is 06:18 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI