WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Customizing Layouts (https://www.wowinterface.com/forums/forumdisplay.php?f=95)
-   -   Health Units Change (https://www.wowinterface.com/forums/showthread.php?t=41538)

vandamned 10-06-11 07:34 AM

Health Units Change
 
Nui Shows health as for e.g. 140000 or 13000000i want it to round the numbers to like blizzard used to have them 140k or 13M... any help would be appreciated
Thanks

Xrystal 10-06-11 02:50 PM

I can't see where exactly the code is to change it but the nearest I saw was this in nUI_UnitHealth.lua

frame.configText( frame.cur, frame.options.cur_health );
frame.configText( frame.max, frame.options.max_health );
frame.configText( frame.pct, frame.options.pct_health );
frame.configText( frame.mix, frame.options.mix_health );

But I can't see where configText is to see what that is doing with the values being passed.

Calipher 10-07-11 04:51 PM

I was thinking about working on the same idea, and while poking around I found this in nUI_UnitFrame.lua. It might be what you're looking for, Xrystal.

Code:

                if unit_info and unit_info.max_health and unit_info.max_health > 0 then
                        GameTooltip:AddLine( ("|cFFFFCF00%s:|r %d/%d (%0.1f)"):format( nUI_L["Health"], unit_info.cur_health or 0, unit_info.max_health, (unit_info.pct_health or 0) * 100 ), unit_info.health_color.r, unit_info.health_color.g, unit_info.health_color.b );
                end
               
                if unit_info and unit_info.max_power and unit_info.max_power > 0 then
                        GameTooltip:AddLine( ("|cFFFFCF00%s:|r %d/%d (%0.1f)"):format( unit_info.power_name or "", unit_info.cur_power or 0, unit_info.max_power, (unit_info.pct_power or 0) * 100 ), unit_info.power_color.r, unit_info.power_color.g, unit_info.power_color.b );


Xrystal 10-08-11 03:35 AM

Maybe, but this is just for the tooltip itself and not the permanent text overlay but it might help me track down where the formatting is.

Good to see though that Scott already incorporated checks for divide by zero wrongness which could explain why I have only seen one occurence of it so far with the PTR 4.3 changes.


All times are GMT -6. The time now is 03:02 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI