Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoreplace window isn't updated after group hierarchy changes #5978

Closed
DorpsGek opened this issue Apr 11, 2014 · 7 comments
Closed

Autoreplace window isn't updated after group hierarchy changes #5978

DorpsGek opened this issue Apr 11, 2014 · 7 comments

Comments

@DorpsGek
Copy link

@DorpsGek DorpsGek commented Apr 11, 2014

juanjo opened the ticket and wrote:

The autoreplace window lists are not updated after making a group hierarchy change.

Group 1: Has no maglevs.
Group 2: Has maglevs.

Open autoreplace window for G1. It doesn't list maglevs.
Add G2 as a subgroup of G1. Autoreplace window for G1 should list maglevs, but it doesn't.

Showing diesel engines and then going back to maglev ones makes window up-to-date.

Maybe group hierarchy code should call InvalidateAutoreplaceWindow somewhere.

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5978
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Apr 11, 2014

juanjo wrote:

Title should be "Autoreplace window isn't updated after group hierarchy changes."


This comment was imported from FlySpray: https://bugs.openttd.org/task/5978#comment13228
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Oct 23, 2014

alex6 wrote:

I was not able to reproduce the problem following the steps.
Do you have a savegame ?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5978#comment13577
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Oct 23, 2014

juanjo wrote:

Here is a savegame (r27037) and some images.
It happens if you open a replacement window for vehicles of GROUP 1.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5978#comment13578
@DorpsGek

This comment has been minimized.

Copy link
Author

@DorpsGek DorpsGek commented Aug 25, 2017

3298 wrote:

It was indeed a simple fix, a call to GroupStatistics::UpdateAutoreplace was missing. While I was testing I also found two other equally small issues between autoreplace and groups: the group window doesn't refresh when starting or stopping a replacement (i.e. the autoreplace icon didn't (dis-)appear when it should, but after another redraw trigger like selecting a group it did), and in addition the color of the autoreplace icon in the group window doesn't accurately reflect the status of autoreplace when the only remaining vehicles to replace are in subgroups (it is drawn like when the autoreplace has finished, even though that is not yet true).
The attached patch fixes all three issues. The first two hunks refresh the group window when starting/stopping autoreplace; the third hunk fixes the issue with incorrect display of autoreplace's "finished" status; and the fourth hunk is the fix for the original issue, refreshing the autoreplace window on group hierarchy changes.
I aggregated them into a single patch because they are closely related, tiny, and easy to separate if needed.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5978#comment14645
@andythenorth

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 5, 2019

@J0anJosep is this one yours? :)

@J0anJosep

This comment has been minimized.

Copy link
Contributor

@J0anJosep J0anJosep commented Jan 12, 2019

I didn't wrote the patch, just created the ticket on FS. I'll check it. In case 3298 doesn't create a PR soon, I'll do it and credit him if I find the patch to be correct.

@LordAro LordAro removed the stale label Jan 12, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Jan 12, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this issue Jan 12, 2019
@andythenorth

This comment has been minimized.

Copy link
Contributor

@andythenorth andythenorth commented Jan 12, 2019

Thanks for doing that @J0anJosep

3298 can't use GitHub for ethical reasons, so won't be creating any PRs. See https://www.tt-forums.net/viewtopic.php?f=33&t=83025

@LordAro LordAro closed this in 823c5bf Jan 13, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.