WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Customizing Layouts (https://www.wowinterface.com/forums/forumdisplay.php?f=95)
-   -   Add values to health bars instead of % (https://www.wowinterface.com/forums/showthread.php?t=24389)

clarkeyboy 06-03-09 03:48 AM

Add values to health bars instead of %
 
Im trying to work out how to remove the %'s from health/mana bars and have the traditional values back there. also would like to lose the global cooldown line when you cast anything and the weird bars that pop up when you melee with the sliders on as I have no idea what they are.

Xrystal 06-03-09 04:26 AM

Could you post a screen shot of what you are talking about as the only slider that I am aware of is the healthrace bar and you can turn that off with a /nui hud healthrace toggle or something similar.

Changing the percent to the actual values on the health and mana bars may not be possible without a code change and even then not necessarily easily.

clarkeyboy 06-03-09 05:34 AM

Quote:

Originally Posted by Xrystal (Post 140643)
Could you post a screen shot of what you are talking about as the only slider that I am aware of is the healthrace bar and you can turn that off with a /nui hud healthrace toggle or something similar.

Changing the percent to the actual values on the health and mana bars may not be possible without a code change and even then not necessarily easily.

I think its the healthchase bars, basically when I engage a monster a bar comes up with what looks like sliders on it, but they cannot be clicked, just above the HuD at the bottom middle of the screen. I dont want them.

The %'s only bother me when im solo as I can never tell how much mana I have left.


Also I would like the Minimap in the top right, or the buffs I have up there please as there seems to be a lot of wasted space.
Thanks for the adivce :)

Edit: I got rid of the healthchase bars, thats great, now for the other things:



The point marked A is where I want values (xxx/xxx) instead of the percentages and blank bars, dont care in Raid UI as I just need to see health for healing there, but when in 5-10mans there is room so would like to know if I can please.

The points marked B I would just like to remove please, any help with this would be awesome :)

Also is there a way to get the traditional buff/debuff display back and lose those boxes on the left and right, as they are just too much information and the icons are too small.

Thank you.

Xrystal 06-03-09 06:14 AM

Ah the reason why everything is at the bottom is to free up the space above for game play or whatever else you want there.

You can turn off nUIs control of the minimap with something like /nui minimap to toggle control and it will either automatically load your UI or you will have to do it manually but once reloaded the map will appear in the top right.

The auras however cannot be moved to that position as the bars are now the standard in nUI.

Xrystal 06-03-09 06:29 AM

Okay, took a gander in the files and found this that you could change if you were inclined and confident to do so.

File: nUI_UnitPower.lua in nUI/Units folder
Line: 890 or thereabouts

Code:

if frame.bar.enabled then
  frame.bar.updateBar( unit_info.pct_power, unit_info.power_color );
end

If you change pct_power to cur_power it looks like it will display the current power ( in your case mana ) value. Not in game at present to test it at the moment but the value should exist and thus display unless it gets overridden at a later date.

clarkeyboy 06-03-09 06:35 AM

Quote:

Originally Posted by Xrystal (Post 140666)
Okay, took a gander in the files and found this that you could change if you were inclined and confident to do so.

File: nUI_UnitPower.lua in nUI/Units folder
Line: 890 or thereabouts

Code:

if frame.bar.enabled then
  frame.bar.updateBar( unit_info.pct_power, unit_info.power_color );
end

If you change pct_power to cur_power it looks like it will display the current power ( in your case mana ) value. Not in game at present to test it at the moment but the value should exist and thus display unless it gets overridden at a later date.

Ok well im off to work now but I will try this tonight, no programming knowledge so this might be a bit over my head but I can try! :) Thank you so much matey.

spiel2001 06-03-09 06:38 AM

NO! NO! NO!

This is the *WRONG* way to make changes to nUI's layout... you never modify the executable code, only the layout files.

Do not *EVER* modify the files in [ Interface > AddOns > nUI > Units ]

If you want to display current power instead of percent power, you edit the files in [ Interface > AddOns > nUI > Layouts > Default > HUDLayouts (or UnitPanels) > etc... ] -- In those files you'll find sections for ["Health"] and ["Power"] which control what the display of health and power bars look like. To change the power bars to display current power instead of percent power, you replace the pct_power = section with cur_power = and voila, you display current power instead of percent.

Quote:

Originally Posted by Xrystal (Post 140666)
Okay, took a gander in the files and found this that you could change if you were inclined and confident to do so.

File: nUI_UnitPower.lua in nUI/Units folder
Line: 890 or thereabouts

Code:

if frame.bar.enabled then
  frame.bar.updateBar( unit_info.pct_power, unit_info.power_color );
end

If you change pct_power to cur_power it looks like it will display the current power ( in your case mana ) value. Not in game at present to test it at the moment but the value should exist and thus display unless it gets overridden at a later date.


Xrystal 06-03-09 06:42 AM

Ah thanks Scott and my apologies. Didn't spot the HUD layout option for some reason.

Shuffles away ...

spiel2001 06-03-09 06:51 AM

Quote:

Originally Posted by clarkeyboy (Post 140654)
I think its the healthchase bars, basically when I engage a monster a bar comes up with what looks like sliders on it, but they cannot be clicked, just above the HuD at the bottom middle of the screen. I dont want them.

You can turn the healthrace bar off using '/nui hud healthrace' however, you might want to consider reading the description of what it is and how it works before you do that. You'll find the description of the health race bar in the "User Guide" section at http://www.nuiaddon.com/documentation.html

Quote:

The %'s only bother me when im solo as I can never tell how much mana I have left.
As noted in my prior post, you can fix that editing [ Interface > AddOns > nUI > Layouts > Default > UnitPanels > Solo > nUI_UnitSkins_SoloPlayer.lua ] and look for the ["Power"] section in the file. In that you'll see where it says "pct_power =" -- change that to read "cur_power =" and then save the file. When you log back into WoW or do a '/nui rl' you'll see your percent power has been replaced with the current power.

Quote:

Also I would like the Minimap in the top right, or the buffs I have up there please as there seems to be a lot of wasted space.
Thanks for the adivce :)
You can move the minimap back up to the top right using '/nui minimap' -- however, the entire point of this UI is that you can keep all relevant information in one place where you can see it without having to move your eye all over the display space. At the same time, it keeps the field of play open. But to each their own and, thus, the option.

Quote:

Edit: I got rid of the healthchase bars, thats great, now for the other things:
I still say you should really think about reading up on what the healthrace is and reconsider losing it... but, again, to each their own.


Quote:

The point marked A is where I want values (xxx/xxx) instead of the percentages and blank bars, dont care in Raid UI as I just need to see health for healing there, but when in 5-10mans there is room so would like to know if I can please.
To do this you would need to edit the HUD layout player and target files for the simple HUD and add sections for ["Health"] and ["Power"] to it. I'm at work right now, so I can't work on it, but I'll post code later tonight if I don't forget.

Quote:

The points marked B I would just like to remove please, any help with this would be awesome :)
Edit [ Interface > AddOns > nUI > Layouts > Default > HUDLayouts > NoBars > nUI_HUDSkins_NoBars_Target.lua ] and locate the section ["Range"] -- comment out that entire section by adding the part I have highlighted in blue like this...

Code:

--[[
["Range"] =
{
 ... all kind of option and achor information is in here ...
},
]]--

Quote:

Also is there a way to get the traditional buff/debuff display back and lose those boxes on the left and right, as they are just too much information and the icons are too small.
Yes... download and install the nUI_AuraButtons plugin from the "nUI: Unit Frame Panels" section at http://www.wowinterface.com/downloads/cat125.html

spiel2001 06-03-09 06:52 AM

Quote:

Originally Posted by Xrystal (Post 140672)
Ah thanks Scott and my apologies. Didn't spot the HUD layout option for some reason.

Shuffles away ...

~lol~

Not a problem... I just wanted to make sure that didn't happen... modifying the layouts files has no side effects, modifying the event engine does ~smile~

clarkeyboy 06-03-09 07:38 AM

Thank you!
 
Thank you so much for the responses, seems im gonna have some fun when I get home. The UI is a great one, and comes pre-configured which I love, its very usable and easily readable, just feels a little cluttered at times, which is why im trying to personalise. I think your style is fantastic and hope you keep supporting this addon, as its the best I have seen.

Cant wait to get home and tweak it all, could you also show me what I need to do to add current hp/mana to the 10 man UI too, basically I want it on 1-10 man, above that I dont need to know, but if possible can I make it so I can always see my own? As a healing Paladin when my mana gets low on bosses like the General in Ulduar, its vital I know how many Holy Shocks/Lights I have left.

Thank you so much again, its a truly amazing UI.

spiel2001 06-03-09 10:05 AM

The instructions are identical... all you're changing is which file you are editing... once you get home and look at the file layout I'm sure you'll know exactly which files you need to change to do what you're after.

clarkeyboy 06-03-09 04:25 PM

Ok followed all the instructions to the letter, the Ranged thing is gone, and my mana has a value now, but its to the right of the bar, and only in my frame. Is it possible to put the value on the bar? Or is that too complex? Basically I hate seeing things as a % as it gives you no idea how much you should be healing for. Can I enable values for all bars up to 10 man please?

Also I still have that thin white line when global cooldown is charging, how do I remove that one please?

spiel2001 06-03-09 04:52 PM

Why not just turn the HUD off? You're disabling everything in it anyway.

In any event, the GCD is part of the casting bar. There's an option in the castbar skin to enable or disable the GCD... edit [ Interface > AddOns > nUI > Layouts > Default > HUDLayouts > NoBars > nUI_HUDSkin_NoBars_Castbar.lua ] and comment out the ["GCD"] section.

And, having said that, I cannot imagine playing without a global cooldown indicator for even the briefest of moments.

As for relocating the health/power amounts to the center of the bar, just edit the anchor = section and change the cur_health and cur_power sections to look something like this...

Code:

                cur_health =
                {
                    enabled    = true,
                    fontsize    = 11,
                    justifyH    = "CENTER",
                    justifyV    = "MIDDLE",
                    anchor_pt  = "CENTER",
                    relative_to = "$parent",
                    xOfs        = 0,
                    yOfs        = 1,
                    color      = { r = 1, g = 1, b = 1, a = 1 },
                },

And you can enable values for whatever unit frames you want to... just edit the corresponding files.

spiel2001 06-03-09 05:57 PM

1 Attachment(s)
Okay -- as promised earlier, here's the code you need to add health and power values to the simple HUD.

Edit [ Interace > AddOns > nUI > Layouts > Default > HUDLayouts > NoBars > nUI_UnitSkin_NoBars_Player.lua ] and add the following two sections to the layout's "elements" section...

Code:

        ["Health"] =
        {
            anchor =
            {
                anchor_pt  = "CENTER",
                xOfs = 0,
                yOfs = 0,
            },       
            options =
            {
                enabled  = true,
                height  = 2,
                width    = 2,
                inset    = 0,
                strata  = nil,
                level    = 2,
               
                mix_health =
                {
                    enabled    = true,
                    barcolor    = true,
                    fontsize    = 16,
                    justifyH    = "LEFT",
                    justifyV    = "MIDDLE",
                    anchor_pt  = "BOTTOMLEFT",
                    relative_to = nUI_HUDLAYOUT_NOBARS.."Bottom",
                    xOfs        = -250,
                    yOfs        = 270,
                },
            },
        },
        ["Power"] =
        {
            anchor =
            {
                anchor_pt  = "CENTER",
                xOfs = 0,
                yOfs = 0,
            },       
            options =
            {
                enabled  = true,
                height  = 2,
                width    = 2,
                inset    = 0,
                strata  = nil,
                level    = 2,
               
                mix_power =
                {
                    enabled    = true,
                    barcolor    = true,
                    fontsize    = 12,
                    justifyH    = "LEFT",
                    justifyV    = "MIDDLE",
                    anchor_pt  = "BOTTOMLEFT",
                    relative_to = nUI_HUDLAYOUT_NOBARS.."Bottom",
                    xOfs        = -250,
                    yOfs        = 247.5,
                },
            },
        },

Then edit [ Interface > AddOns > nUI > Layouts > Default > HUDLayouts > NoBars > nUI_UnitSkin_NoBars_Target.lua ] and add the following two sections to its "elements" section...

Code:

        ["Health"] =
        {
            anchor =
            {
                anchor_pt  = "CENTER",
                xOfs = 0,
                yOfs = 0,
            },       
            options =
            {
                enabled  = true,
                height  = 2,
                width    = 2,
                inset    = 0,
                strata  = nil,
                level    = 2,
               
                mix_health =
                {
                    enabled    = true,
                    barcolor    = true,
                    fontsize    = 16,
                    justifyH    = "RIGHT",
                    justifyV    = "MIDDLE",
                    anchor_pt  = "BOTTOMRIGHT",
                    relative_to = nUI_HUDLAYOUT_NOBARS.."Bottom",
                    xOfs        = 250,
                    yOfs        = 270,
                },
            },
        },
        ["Power"] =
        {
            anchor =
            {
                anchor_pt  = "CENTER",
                xOfs = 0,
                yOfs = 0,
            },       
            options =
            {
                enabled  = true,
                height  = 2,
                width    = 2,
                inset    = 0,
                strata  = nil,
                level    = 2,
               
                mix_power =
                {
                    enabled    = true,
                    barcolor    = true,
                    fontsize    = 12,
                    justifyH    = "RIGHT",
                    justifyV    = "MIDDLE",
                    anchor_pt  = "BOTTOMRIGHT",
                    relative_to = nUI_HUDLAYOUT_NOBARS.."Bottom",
                    xOfs        = 250,
                    yOfs        = 247.5,
                },
            },
        },

Save both files and reload WoW or do a '/nui rl' and you should get a screen that looks something like this...

.

Terraan 08-29-09 04:51 PM

After reading through this thread (exactly what I was looking for with adding numbers instead of percent)....I took it one step further...

In the UnitPanels\Solo\nUI_UnitSkin_SoloPlayer.lua I changed it to the following:
Code:

                ["Health"] =
                {
                        anchor =
                        {
                                anchor_pt  = "TOPLEFT",
                                relative_to = "$parent_Portrait",
                                relative_pt = "TOPRIGHT",
                                xOfs = 0,
                                yOfs = -13,
                        },               

... more code.... more code....
                               
                                cur_health =
                                {
                                        enabled    = true,
                                        fontsize    = 11,
                                        justifyH    = "CENTER",
                                        justifyV    = "MIDDLE",
                                        anchor_pt  = "CENTER",
                                        relative_to = "$parent_PctHealth",
                                        xOfs        = -150,
                                        yOfs        = -15,
                                        color      = { r = 0.5, g = 1, b = 0.5, a = 1 },
                                },
                                pct_health =
                                {
                                        enabled    = true,
                                        fontsize    = 11,
                                        justifyH    = "CENTER",
                                        justifyV    = "MIDDLE",
                                        anchor_pt  = "CENTER",
                                        relative_to = "$parent_PctHealth",
                                        xOfs        = -50,
                                        yOfs        = -15,
                                        color      = { r = 0.5, g = 1, b = 0.5, a = 1 },
                                },

... found power ....
                ["Power"] =
                {
                        anchor =
                        {
                                anchor_pt  = "TOP",
                                relative_to = "$parent_Health",
                                relative_pt = "BOTTOM",
                                xOfs = -0,
                                yOfs = -20,
                        },               

... more code...more code....
                                cur_power =
                                {
                                        enabled    = true,
                                        fontsize    = 11,
                                        justifyH    = "CENTER",
                                        justifyV    = "MIDDLE",
                                        anchor_pt  = "CENTER",
                                        relative_to = "$parent_PctPower",
                                        xOfs        = -150,
                                        yOfs        = -15,
                                        color      = { r = 1, g = 1, b = 1, a = 1 },
                                },
                                pct_power =
                                {
                                        enabled    = true,
                                        fontsize    = 11,
                                        justifyH    = "CENTER",
                                        justifyV    = "MIDDLE",
                                        anchor_pt  = "CENTER",
                                        relative_to = "$parent_PctPower",
                                        xOfs        = -50,
                                        yOfs        = -15,
                                        color      = { r = 1, g = 1, b = 1, a = 1 },
                                },

I basically then copied this into the \nUI_UnitSkin_SoloPet.lua with the same configuration and I got the following:




Also, I was wondering if there is a way to add Pet XP into the unit frame for my pet...was thinking since a Hunter made it might have some sneaky pet xp frame....but not finding it :(

Thanks and hope this helps out someone.

spiel2001 08-30-09 08:00 AM

There is not, at present, any mechanism in place for pet XP, it will be in 6.0

A couple of things to point out about the changes you made... first, the unit frame current and maximum health are already displayed (as you can see in the top right corner of the unit frame next to the class icon) -- so you might want to remove the redundant information. Second, having moved the bars down and placed the current and percent health/power data under them, you have very likely also moved the aura icons for the unit and I suspect you'll find that they are now overlapping both the current power data as well as the unit frame below them.

Petrah 08-30-09 10:55 AM

Quote:

Originally Posted by spiel2001 (Post 140799)
Okay -- as promised earlier, here's the code you need to add health and power values to the simple HUD.

Thank you for this... I tried this out because I use the Simple Hud, and I actually like having the numbers there (now that I'm getting the hang of the HealthRace bar and how it works lol).

skonecny 01-27-10 12:02 AM

Text Abv
 
Perfect, just what I was looking for. In the theme of not having to look all over the place for stuff, this was just what I wanted, max/cur health layout.

Have another question along the same lines. Can you abbreviate the numbers? For example, I now have it showing cur/max on the target as a whole number, ie. 22458/33555. Is it possible to show abbreviations for numbers greater than 10k? ie. 22.4k/33.5k

P.S. This addon saves soooooo much memory, not to mention the improved framerates. Oh ya, and I don't have to mess with bartender, pitbull, tiptac, omnicc, ct_viewport, chinchilla, and a few others. What a huge time saver. I love it!

spiel2001 01-27-10 05:14 AM

At this time it is not possible to contract the numbers as you're asking for, but I'll keep that in mind for nUI6.


All times are GMT -6. The time now is 04:32 PM.

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