Thread Tools Display Modes
03-18-24, 12:42 PM   #1
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
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)
  Reply With Quote
03-18-24, 05:13 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
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)
I'm assuming this is to be put into a macro hence the removal of optional whitespace.
__________________
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 : 03-18-24 at 05:23 PM.
  Reply With Quote
03-18-24, 05:24 PM   #3
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
That worked perfect. Much appreciated! Thanks for cleaning up the other code as well.
  Reply With Quote
03-18-24, 05:26 PM   #4
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
Originally Posted by SDPhantom View Post
I'm assuming this is to be put into a macro hence the removal of optional whitespace.
I missed this. I have this in an addon. Any problems with the removal of whitespace? Still learning.

Last edited by atshn : 03-18-24 at 05:30 PM.
  Reply With Quote
03-18-24, 07:45 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
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.
__________________
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 : 03-18-24 at 07:55 PM.
  Reply With Quote
03-19-24, 06:33 PM   #6
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
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.
  Reply With Quote
03-20-24, 10:27 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
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.
__________________
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 : 03-20-24 at 10:30 PM.
  Reply With Quote
03-21-24, 11:13 AM   #8
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
Good to know. Thanks again
  Reply With Quote

WoWInterface » Classic - AddOns, Compliations, Macros » Classic - AddOn Help/Support » Player corpse tooltip


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