Thread Tools Display Modes
06-08-10, 08:19 AM   #1
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Dynamic positionning

First I didn't know how to name that topic and I thought that one what the one that described the best .

In cargBags_Gnomed, I have a problem I want to solve: moving bags when the previous one is hidden, i.e. I have my Quest bag and my Stuff bag, I hide Stuff, Quest takes its place.
So far that's not that hard, but under Stuff is Equipment, and if I hide Equipment, I don't know how to make it move.

I had several ideas but no one seems to work, still here's what I made: Pastey


I also have another very strange issue, if I go to the bank and then want to mount: my bank stuff appears: I have an idea to fix it but do anyone notice something in the code I'm doing wrong ?
__________________
  Reply With Quote
06-08-10, 09:24 AM   #2
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Maintain a table with shown/hidden states of all bags, and iterate over the table when you open or close one?
  Reply With Quote
06-09-10, 09:35 AM   #3
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Yeah that could be good, but I have almost no idea of how I could implement it well
__________________
  Reply With Quote
06-09-10, 12:12 PM   #4
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Should ask Cargor... hes good with tables.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
06-09-10, 02:48 PM   #5
xConStruct
A Chromatic Dragonspawn
 
xConStruct's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 199
I came up with this snippet of code. It should be fairly self-explanatory, but if you have questions, feel free to ask.

The anchor-function basically iterates backwards over a table of all previous bags and checks if they are shown. When true, then it is checked if the new frame would fit above it, otherwise it creates a new column on the side.

Didn't test it very thoroughly though, so there could be some typos or bugs.
__________________
« Website | GitHub »

Oh hai!
  Reply With Quote
06-10-10, 10:34 AM   #6
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
That looks like what I need, I'll test it tomorrow and tell you if it works
__________________
  Reply With Quote
06-15-10, 09:17 AM   #7
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
I just adapted it for my needs and it works perfectly.

Thanks a lot
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Dynamic positionning


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