Thread Tools Display Modes
03-12-09, 10:50 AM   #1
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Target level on HUD

Could you add the target's level to the HUD? I know this information is in the Unit Frame, but it would be really handy to have it right up there next to the target name since that is where I get most of the information when looking at a new target.
 
03-16-09, 03:03 PM   #2
Smirge
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 124
Originally Posted by wreck View Post
Could you add the target's level to the HUD? I know this information is in the Unit Frame, but it would be really handy to have it right up there next to the target name since that is where I get most of the information when looking at a new target.
actually i second that would be very nice to have most info in the HUD
 
03-17-09, 04:46 PM   #3
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
Would it be possible to add this as an optional plugin for nUI instead of adding it to the core of nUI?
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
 
03-17-09, 05:26 PM   #4
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
It could be done that way by twiddling the HUD skins in the same way that the aura buttons plugin twiddles the unit frame skins.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-18-09, 11:07 AM   #5
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Could you point me to where the target name/class information is rendered for the HUD? I could look at making a plugin that would do this.
 
03-18-09, 12:10 PM   #6
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Originally Posted by wreck View Post
Could you point me to where the target name/class information is rendered for the HUD? I could look at making a plugin that would do this.
Well... to see how a level element is created in a unit frame look for the key word ["Level"] in the file [ Interface > AddOns > nUI > Layouts > Default > UnitPanels > Solo > nUI_UnitSkin_SoloPlayer.lua ]

To see how to modify existing default layouts from a mod, check out http://www.wowinterface.com/download...raButtons.html which modifies the existing unit frame skins for the player, target, pet and vehicle to change their aura displays from bars to buttons. You will, of course, have to replace the unit frame skin references with HUD skin references.

Then all you have to do is spin through the HUD element skins you want to add the ["Level"] element to in in the same way.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-20-09, 11:47 AM   #7
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Ok, I made the modification to the HUD lua, just to understand how to do it. Next I need to figure out how to do the same thing in a Mod. Overriding the original HUD display seems the way to go.

Still learning lua, and I haven't had much time this week to play with it. I need to figure out if it is possible to simply add the element to the existing skin features, or if it will be necessary to override the entire skin.
 
03-20-09, 12:04 PM   #8
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Originally Posted by wreck View Post
Ok, I made the modification to the HUD lua, just to understand how to do it. Next I need to figure out how to do the same thing in a Mod. Overriding the original HUD display seems the way to go.

Still learning lua, and I haven't had much time this week to play with it. I need to figure out if it is possible to simply add the element to the existing skin features, or if it will be necessary to override the entire skin.
The easy way is to just add it to the existing skins. That way if I change something else about the skin, your mod won't break.

Look at the aura buttons mod... it will show you how to do it.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-20-09, 12:18 PM   #9
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Originally Posted by spiel2001 View Post
The easy way is to just add it to the existing skins. That way if I change something else about the skin, your mod won't break.

Look at the aura buttons mod... it will show you how to do it.
Yea, but the aura buttons mod replace the existing aura scheme. Very different from adding an element to an existing skin. That's the trick I'm trying to figure out.
 
03-20-09, 12:55 PM   #10
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Originally Posted by wreck View Post
Yea, but the aura buttons mod replace the existing aura scheme. Very different from adding an element to an existing skin. That's the trick I'm trying to figure out.
Not really...

Code:
local myLevelBlock =
{
    anchor =
    {
    -- definitions
    },

    options =
    {
    -- definitions
    },
};

if nUI_UnitSkins[skinName] then
    nUI_UnitSkins[skinName].elements["Level"] = myLevelBlock;
end
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-21-09, 11:35 PM   #11
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Post

Ok, still not working. First I tried the following, basicallly filling in with details that I found.
Code:
local myLevelBlock =
{
        anchor =
        {
            anchor_pt   = "TOPLEFT",
            relative_to = "$parent_Power",
            xOfs        = 80,
            yOfs        = 0,
        },		
        options =
        {
            enabled = true,
            size    = 35,
            inset   = 0,
            strata  = nil,
            level   = 2,
            
            label =
            {
                enabled     = true,
                fontsize    = 16,
                justifyH    = "RIGHT",
                justifyV    = "MIDDLE",
                anchor_pt   = "RIGHT",
                xOfs        = 0,
                yOfs        = 1,					
                color       = { r = 0, g = 0.83, b = 0, a = 1 },
            },
        },
};
if nUI_UnitSkins[skinName] then
        nUI_UnitSkins[skinName].elements["Level"] = myLevelBlock;
end
I also tried the following to see if we need to hook into an event. Still no joy.

Code:
local myLevelBlock =
{
        anchor =
        {
            anchor_pt   = "TOPLEFT",
            relative_to = "$parent_Power",
            xOfs        = 80,
            yOfs        = 0,
        },		
        options =
        {
            enabled = true,
            size    = 35,
            inset   = 0,
            strata  = nil,
            level   = 2,
            
            label =
            {
                enabled     = true,
                fontsize    = 16,
                justifyH    = "RIGHT",
                justifyV    = "MIDDLE",
                anchor_pt   = "RIGHT",
                xOfs        = 0,
                yOfs        = 1,					
                color       = { r = 0, g = 0.83, b = 0, a = 1 },
            },
        },
};

local frame = CreateFrame( "Frame", "nUI_HUDLevel", UIParent );

local function onEvent()
      if nUI_UnitSkins[skinName] then
         nUI_UnitSkins[skinName].elements["Level"] = myLevelBlock;
      end
end

frame:SetScript( "OnEvent", onEvent );
frame:RegisterEvent( "VARIABLES_LOADED" );
If I take the Level Block and add it directly to the Skin code in nUI it works just the way I want it to. Just can't get the add on to do the any thing.
 
03-21-09, 11:52 PM   #12
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Okay.. first of all.. it should be hooked into an event and it should be executed on the "ADDON_LOADED" event so that we're sure it does not try to update nUI's default layout tables until after we know that have been loaded and initialized and before any user customization is applied which occurs in the "VARIABLES_LOADED" event.

Second, and this may sound silly... but did you ever give "skinName" a value?

Code:
local skins =
{
    [1] = "PlayerTarget",
    [2] = "HealthPower",
};

for i in pairs( skins ) do
    local skinName = skins[i];

    if nUI_UnitSkins[skinName] then
        nUI_UnitSkins[skinName].elements["Level"] = myLevelBlock;
    end
end
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-23-09, 10:55 AM   #13
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Still no joy. It seems to me that matching the nUI_UnitSkin[] by the name "PlayerTarget" is simply wrong. The skin names are completely different in the nUI/Main/constants.lua file. I tried making them match as per nUI_Aurabuttons code, but still got no matches. I put in some logging and this seems to be the essential problem. Nothing I tried matched a skin name, so I never see it add the Level block.

For me it is no longer worth the effort. For my own use it is much much simpler to add the Level block directly to the nUI code. So I guess I'll do that for my wife and I for now and not share
 
03-23-09, 11:21 AM   #14
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Post what you have so far at an attachment and I'll fix it for you.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-23-09, 05:23 PM   #15
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Ok, I made an attachment. Have a look and tell me what I'm missing.

The version I'm sending hasn't been tested. I tried several things and still got nothing to work, so this is kind of where I said give me my java compiler.
--
Stev
Attached Files
File Type: zip nUI_HUDLevel.zip (1.1 KB, 787 views)
 
03-23-09, 06:18 PM   #16
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Wow... you were REALLY close... this worked for me, hopefully it does for you as well.
Attached Files
File Type: lua nUI_HUDLevel.lua (1.2 KB, 738 views)
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-23-09, 08:55 PM   #17
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
Yep that worked. So I was on the right track. Just had to match against the right part of the enumerated list, eh?

For those interested, the attachment to this message will work if you want to try it out. Make sure you enable the addon after unzipping to your Addons folder.
Attached Files
File Type: zip nUI_HUDLevel.zip (1.0 KB, 754 views)
 
03-23-09, 09:25 PM   #18
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I might suggest two things...

1) Post this in the nUI Customization forum for those who look in there
2) Consider uploading it to http://www.wowinterface.com/downloads/cat133.html

Glad it's working -- Like I said, you were REALLY close.

Good job!
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
03-24-09, 11:08 AM   #19
wreck
A Flamescale Wyrmkin
 
wreck's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 114
It'll have to wait until I have time to add a screen shot preview as it appears they expect one for uploads here.
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Developer Chat » Target level on HUD

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