I need an addon/script that allows me to convert my healthbar status text from,
Example: “30,450hp” make it show “30K” hp
I know this can be done, It would help me out by still allowing me to use status text, and still quickly see player green healthbar on default ui, the visability on defualt status text is massive, I cannot see their health, and am forced to toggle it off for all, I really dont want to use a different ui addon, please help, Ill even pay you for your time for this script, thank you.
@Fizzlemizz
There is a build in option to display as a percentage. Is there an advatage of seeing
30K hp
over seeing
55%?
Variations of this has been in my startup script for years:
-- change format of target and focus unit frame health bar to (number)/(percent)%
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(f,t,v,_,x)
if f==PlayerFrameHealthBar or f==TargetFrameHealthBar or f==FocusFrameHealthBar then
local F,V,z,Z=format,v,1000 Z=z*z
v = (v>Z and F("%.2fM",v/Z)) or (v>(z*10) and F("%.0fk",v/z)) or v
if V<x then
t:SetText(F("%s / %.0f%%",v,V*100/x))
else
t:SetText(F("%s",v))
end
end
end)
If status text is numerical or percent (displayed but not the split number thing), it converts large numbers to k or M (and displays a percent alongside if less than 100%) for player, target and focus frames.
I don’t know if OP wants for raid frames, party frames, arena frames, boss frames or any others.
I tried really hard to comprehend that code you wrote, I cant get it to work it does nothing when I plug it into add on.bool.no/ , I am also terrible with coding could you please dumb it down for me im soo extremely grateful for your help .
I need this for party frames, and I don’t want to use percentage even if its smaller because knowing the actual number even rounded is a big difference in arena, focusing the target with 20k hp over 40k hp is a big deal and you cant quickly tell with percent frames at all. Also fizzle i made this new post and couldnt thank you because the last post wouldnt let me reply for some reason, thanks for your help i tried to say and also even if i reduce the size of the text it still is so massive and cant see the healthbar behind that why after long thought, this is the only viable solution if someone is able to craft this script.
hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(f,t,v,_,x)
local F,V,z,Z=format,v,1000 Z=z*z
t:SetText((v>Z and F("%.2fM",v/Z)) or (v>(z*10) and F("%.0fk",v/z)) or (v>z and F("%0.1fk",v/z)) or v)
end)
will change “all” status text to a single number where TextStatusBar_UpdateTextStringWithValues is used, unless another addon/macro replaces the functionality.
The format of the number is the first criteria of:
- 0.00M if greater than 1 million
- 00k if greater than 10k
- 0.0k if greater than 1k
- unmodified otherwise
I don’t know if “focusing the target” applies to people in the party or arena enemies. So I’m uncertain what the requirements are here and since arena is involved and this may become a quagmire of uncertain requirements, I’m bowing out of this thread. Hopefully the above works.
Take a look at CT_UnitFrames. It primarily does just what you are asking.
It’s part of CTMod which is a package of 12 different addons… but you can just disable the other 11 and keep only CT_UnitFrames. Setup the text however with /ct
Gello, you are the bomb! Thank you this is exactly what I needed, I can see the healthbars again, I really appreciate it.
Can I request 1 more addition to this, could you share a script that also mods the mana bar but just the scale and not the last decimals
I know time is valuable but this will be the last I ask, even with just the healthbar mod its so great thanks again friend!