Page 1 of 1

build list behavior when changing systems

Posted: Tue Mar 14, 2017 6:53 pm
by Dilvish
If there is already a discussion on this, my searching couldn't find it.

Something that really bothers me as I'm working in the Production window, is how often I'll switch to some planet and the build list box will come up partially empty, only showing a portion of the items that are actually buildable at that location, and I'll have to scroll up in order to see the other items, which relies on me being focused enough to remember that there really should be some other items showing up there. (Yes, theoretically I could notice the scrollbar is in a middling position, but that never happens until after I realize the issue is occurring.) It is noticeably aggravating.

Of course, now that I'm trying to write a post on it, I can't seem to make it happen in a repeatable way, but it happens pretty often during a game. I am pretty sure it did not happen a year ago, but it has been happening for at least several months.

I could guess a few reasons that this might have come about either intentionally or inadvertently while addressing some related listbox issue, but I don't think it really needs to be, or should be, exactly like it is now. It's not just that it is making sure that a previously selected entry is visible, but it may be forcing a particular item to be on top.

Has this been bothering anyone else? Does anyone recall the motive that led to this particular behavior, and is there some particular aspect/result of this behavior that I should make sure to preserve if I tinker with changing it?

Re: build list behavior when changing systems

Posted: Tue Mar 14, 2017 8:07 pm
by Vezzra
Dilvish wrote:Has this been bothering anyone else?
Didn't have the time to play test games for a while now, but IIRC I ran into the problem last time I did and yes, it's annoying. Not terribly so, but still.

But I can't tell at all when and why this started to happen.

Re: build list behavior when changing systems

Posted: Tue Mar 14, 2017 10:54 pm
by Gargamel
I noticed this too.

It seems after the last building has been selected, and then you switch systems, the list starts at the next item on the list. It might be that the index of the first item to display in the box is not getting refreshed when you switch systems.

Re: build list behavior when changing systems

Posted: Wed Mar 15, 2017 8:45 pm
by LGM-Doyle
I was the last person to make a change to the positioning code in BuildDesignatorWnd, in commit d1b43f45d0f0.

The previous behavior when showing an updated queue was to jump to the first row of an item of the same type as the previous first item in the queue. There were only two item types, ships and buildings, so it was jumpy.

I was fixing #1147 where the production window queue and build designator windows were resetting their positions when an item was added/or removed from the queue or the designator.

I fixed that bug so that the queues keep the same relative position from the top/bottom of the queue.

You could alter the code so that it resets to the top of the list when it switches to a new planet. That might fix your aggravation. Right now it looks like the PopulateList code doesn't know when it is populating a new planet.

Re: build list behavior when changing systems

Posted: Wed Mar 15, 2017 8:55 pm
by Dilvish
LGM-Doyle wrote:I was fixing #1147...
Ah, thanks much for the explanation and suggestion, I'll see what I can do.