Thread Tools Display Modes
Old 04-15-09, 06:32 PM   #1
jarasai
A Defias Bandit
Join Date: Apr 2009
Posts: 2
UnitPanel Movement

Hello!

I've been playing around with nUI for a few days and am enjoying it. I've been trying to move around some layout pieces, and have been quite successful, but the UnitPanels are a bit of tricky business.

Unlike a lot of the other layout items, the panel itself seems to be hardcoded as anchored in nUI_UnitPanel to the Dashboard, so it can't seemingly be reanchored to the nUI_TopBar. I know it seems very vogue to put frames there, but I tend to stick them in the normal Blizz spot and grid goes in the middle.

I tried to reanchor the Solo panel, at least, by sticking an anchor in , but it didn't move. Maybe I did it wrong?

anchor = {
anchor_pt = "BOTTOMLEFT",
relative_to = "nuI_TopBars",
relative_pt = "TOPLEFT",
xOfs = 0,
yOfs = 0,
},

In the upmost panel level of nUI_UnitPanelSolo.lua.

Is there some elaborate stuff to override? It looks like the apply_anchor function in UnitPanel checks to see if an anchor is present, but there are things like local background = CreateFrame( "Frame", "nUI_UnitPanelBackground", nUI_Dashboard.Anchor ) that explicitly refer to the Dashboard through this thing, rather than the anchor of some set parent panel.

I'm kinda toying around with nUI_UnitPanel, but my old CS training on inelegantly altering things because I'm not seeing abstraction gives me a little twitch, so I thought I'd ask about it.

I might try sticking in like a middle class nUI_DefaultUnitPanel with the anchor options and some other stuff defined, so tons of anchor and panel options don't have to be redefined every whim I have.. It also seems like a good solution to having some layouts have Dashboard anchoring and some being free to go elsewhere.

This is really my first foray into LUA and should read up before I try such things... but they were some ideas I had. I'm interested to hear if there are any thoughts on relocating said UnitPanel.

Thanks,
Jason
jarasai is offline  
Old 04-16-09, 04:10 AM   #2
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Just looking quickly at what you posted, I think the issue is your anchor points... anchor_pt is the part of the frame that you're anchoring and relative_pt is the part of the frame you're anchoring to. You're setting anchor_pt to BOTTOMLEFT and relative_pt to TOPLEFT which means the bottom of the unit frame it being anchored to the top of the console and that would place the entire unit panel off screen... you probably want to use anchor_pt = "TOPLEFT" and relative_pt = "BOTTOMLEFT"

Also, I'm assuming it is a type, but Lua variable names are case sensitive, so "nuI_TopBars" =/= "nUI_TopBars" -- if that's not a typo, that would also be a problem.

And just so the wordpolice out there in forumland don't smack you with their verbal blackjacks... Lua is not an acronym (LUA) -- it's Hawaian for "moon" I believe. I have no idea why a programming language is named "moon", but whatever. ~lol~
__________________

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/
spiel2001 is offline  
Old 04-16-09, 01:44 PM   #3
jarasai
A Defias Bandit
Join Date: Apr 2009
Posts: 2
Yeah, that was a typo. When I attached a few other things to the TopBars, they did work. I just did a little experiment, totally reverted, and added an anchor to the Solo panel with proper capitalization and it's still pinned to the Dashboard.

And on the anchors.. That's not so much the problem. I was looking for any telltale of half of it being offscreen or something. And the aforementioned anchor is in there, like the one in my first post, and my little face is still on the Dashboard, which indicates to me that, if it's not offscreen or halfway so, then the anchor is somehow not getting picked up.
jarasai is offline  
 

Go BackWoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Customizing Layouts » UnitPanel Movement

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