arkayenro / arkinventory

A World of Warcraft Inventory mod for Retail, Burning Crusade, and Classic
109 stars 14 forks source link

Possible to "condense" bars? #1085

Open tomaj84 opened 6 years ago

tomaj84 commented 6 years ago

So here's my deal. I'm using several different categories to really sort out my bags. I'm currently setting the minimum slots to 3 on most categories as I typically don't have that many materials under that category in my inventory at any given time. However, as I'm still setting up my bars and everything, I have a lot of "noise" in my unsorted category. I also acquire a ton of vendor trash since I loot ALL THE THINGS. And also tend to have a good chunk of free space much of the time, especially with larger bags. Rows beyond the lower ones (where I have a minimum setting of 5+) do not currently "wrap" and inhabit that empty space. This also occurs while in edit mode and configuring my bars there. Is there any way to change this so I don't have so much empty space and won't always have to scroll to find some items?

wowscrnshot_080618_195825 wowscrnshot_080618_195827

arkayenro commented 6 years ago

if youve got a whole row of fixed width bars being displayed it can exceed the bag width, in which case other rows wont know and will wrap at the set width, not the actual width. maybe increase the window width to match so it can wrap the other bars properly?

failing that try

config > settings > designs > your design > bars > compact

see if that does what you want

tomaj84 commented 6 years ago

I did already have the compact option set, as I didn't ever use quite this many bars before, so it was never really an issue. After setting the width to maximum for the window size (60 items), I'm still not getting the desired results of wrapping bars.

wowscrnshot_080618_215018

In this case, I have a total of 27 items width, despite my window size setting. However, I think this also has to do with the number of bars per row setting. Since this is a fixed number, I believe it prevents wrapping, since I do not have an option to set it to automatic. Also, regardless of it showing a max number of 40 bars per row, it will only allow me to select up to 16. Still, I do not want this to be more than around 7 bars because otherwise my bag window gets excessively large (even going off the screen on the x axis).

More, I tried to change the settings for the two lower right hand bars (the one that has my empty slots and the one labeled Unsorted) to have no minimum width, while also changing maximum number of bars around - at some points it just changes it to a massive column of one item. Also it completely ignores the 60 item width regardless of this, with the number of bars per row taking precedence.

I should also note that sometimes if I simply set a MINIMUM width and with or without a maximum width for a bar, it will still treat that minimum width like the maximum. I don't know if this has anything to do with the issue I'm getting now, but perhaps it is related in some magic code way I can't fathom.

An example of the min width thing going on is here:

wowscrnshot_080618_221010

Bar 2 has a minimum of 5, and a maximum of 10, but will not go more than 5 slots wide, even though my second row of bars on top of it will.

arkayenro commented 6 years ago

yes, bars per row is always going to limit it as i need something fixed or the calculations would be too extreme. youll only ever get that many bars per row regardless of width and the compact bars option

it looks like if a min width bar is all on its own it stays at min width and doesnt push out to its max. put something else on that row and it works ok

tomaj84 commented 6 years ago

Mmk. That's really unfortunate but understandable.

The thing with the min width bars though, is that almost all of my bars have a min width. I seem to have gotten around this by actually only giving it a max width - it's really only an issue for my trash bar and my empty slots bar so not a huge deal, just found it a little odd for when I do happen to pick up a bunch of greens or BoP gear (running old raids for example).

arkayenro commented 6 years ago

theres definitely an issue with min width bars, it does stupid things when either the only bar displayed in the row has a min width, or all bars in a row have a min width

arkayenro commented 6 years ago

try the r764-alpha, i've fixed the min width issue so see if that helps or not

arkayenro commented 6 years ago

i could allow you to set a bars per row override value for each row (like the min/max bar widths) which might work

another is i could add an option that locks every bar to a default width (unless youve set the max), then i can use the window width and fit as many bars in the rows as will fit because i'll know their widths in advance (would actually be less CPU intensive that whats there), but might have too much whitespace

tomaj84 commented 6 years ago

Apologies, took me a bit to get back to this, I work stupid long hours. But everything looks awesome in the r765 alpha!

I do have a question re: the whole wrapping thing, though:

I realize that you're using the max bars to determine some things, but I'm curious - is it not possible to set the max number of items to take precedence over the max bars (so, even if, say, I set 10 bars as my max width, it will still only allow that number of bars as long as the number of items does not exceed the number of max items, if I have those bars also with a min and/or max width)? So, if, for example, I have my max item width to be 25, and my max bars per row to be 10, and my first 5 bars as a min width of 5 each, but my next row has several bars of varying min/max widths. Then my first row would have only those 5 bars, (depending on number of items in each bar), and then the second row would have upwards of 5 as necessary to fill in the space. Or is this the calculations that you were saying would be too outrageous? (Sorry I don't actually have any real understanding of lua, just like to know how things work.)

arkayenro commented 6 years ago

the way the code works at the moment is to grab a specific number of bars (the bars per row) and creates a row where each bar is either one or the min width wide. so youve got a hole bunch of really tall bars

it then goes into a loop looking for the tallest bar and increases the width of that bar by one, lowering its height

it then checks the row width against the window width

if its at or over that width, or there have been no more height changes (max width reached, height of one) then it exits, if not then it keeps looping, lowering the height of the bars until it can exit

theres some other code in their for edge cases like one you ran into but basically thats what its doing

the thing is that its row specific and its layout code, ie the container/bar layout has already been calculated and its now doing the row layout to get the bars to fit into that width

if i wanted to be able to dynamically add more bars into a row to say fill it up because theres still 15 more slots available id have to rewrite the code to do the container layout calculations one row at a time, then do the row layout so that if theres spare space it could increase the bars per row and then recalculate the whole thing

its these loops that make the calculations go for longer and suck up CPU

i could probably rewrite it like that and use the existing compact option to loop back on, might work

tomaj84 commented 6 years ago

Oooh okay thanks for the insight!

tomaj84 commented 6 years ago

Not sure if it's an issue with the specific bar (JUST empty slots) but did run into the mid width thing again - min width 5, max width 10, item width (for window) of 20. It does resolve if I remove the min width thing, though, so not a huge deal.

wowscrnshot_081018_151625