Thread Tools Display Modes
Unread 10-06-11, 07:34 AM   #1
vandamned
A Kobold Labourer
Join Date: Oct 2011
Posts: 1
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
vandamned is offline  
Unread 10-06-11, 02:50 PM   #2
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,032
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.
__________________
Xrystal is offline  
Unread 10-07-11, 04:51 PM   #3
Calipher
A Kobold Labourer
Join Date: Oct 2011
Posts: 1
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 );
Calipher is offline  
Unread 10-08-11, 03:35 AM   #4
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,032
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.
__________________
Xrystal is offline  
 

Go BackWoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Customizing Layouts » Health Units Change

Thread Tools
Display Modes

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