Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-02-22, 10:54 PM   #1
realitysucks
A Defias Bandit
Join Date: Nov 2022
Posts: 2
target health percentage

i used to have an addon back in retail wrath and on private servers which showed status text in a neat way, i have the code here but it doesnt work with the classic client, does anyone know how to make it behave like intended?

i know theres an option to show percentage and status text in game but i dont like how its displayed

Code:
hooksecurefunc("TextStatusBar_UpdateTextString", function(textStatusBar)
	if textStatusBar == TargetFrameHealthBar and not GetCVarBool("statusTextPercentage") and not textStatusBar.showPercentage then
		local s = TargetFrameTextureFrameHealthBarText:GetText()
		if s then
			s = string.match(s, "[^%/%(]+")
			if s then
				TargetFrameTextureFrameHealthBarText:SetText(s.."("..tostring(math.ceil((UnitHealth("target") / UnitHealthMax("target")) * 100)).."%)")
			end
		end
	end
end)
this is how it looks like:
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » target health percentage


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