Player corpse tooltip
Might be an odd request but is it possible to hide the tooltip that shows when mousing over a player's corpse (on Hardcore if that matters). This is what I'm using to hide the tooltip when mousing over a player, but it doesn't work on player corpses.
Code:
GameTooltip:SetScript("OnTooltipSetUnit",function(self)GameTooltip:Hide()end) |
I haven't tested this past running it through a Lua compiler.
Code:
GameTooltip:HookScript("OnShow",function(s)if _G[s:GetName().."TextLeft1"]:GetText():find"^Corpse of "then s:Hide()end end) I revised the provided code as well. :SetScript() will break things if there's already an existing script. It's advised to use :HookScript() instead. The caveat being you don't want to run this line multiple times or you end up stacking identical callbacks on top of each other. There's also an existing function (GameTooltip_Hide()) for hiding the tooltip made for calls from XML templates. Code:
GameTooltip:HookScript("OnTooltipSetUnit",GameTooltip_Hide) |
That worked perfect. Much appreciated! Thanks for cleaning up the other code as well.
|
Quote:
|
It's purely cosmetic and hinders readability. Extreme cases like shortening variable names to a single letter may run afoul of Blizzard's addon policy due to their obfuscation rule. You can only really get away with it when writing for macros where the size constraint is an issue. There are other size optimizations I used in the code I posted like parenthesis are optional when the only argument to calling a function is a literal string or table constructor. For the most part, it's best to stick to a more normalized style when writing addons.
|
Noted. :) I constantly see your name when googling for answers. You've answered my questions more than you know. Maybe you can answer one that has been bugging me for a while now if you don't mind. Is it possible in some way to hide the floating name of players when I target them? I'm using the default UI. I have "friendly players" option unchecked (Classic) and that does what it's supposed to until you actually target a player, and then their floating name appears.
|
If there isn't a setting for it, then no. The plain text names (as opposed to NamePlates) are rendered by C-code and are inaccessible by the UI.
NamePlates do replace the plain text names when enabled, but hiding those are impossible on certain unit types due to spawning forbidden frames, which can't be touched by addons. |
Good to know. Thanks again
|
All times are GMT -6. The time now is 08:50 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI