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

Feature: Ctrl-click to remove fully autoreplaced vehicles from list #9639

Merged
merged 1 commit into from Nov 7, 2021

Conversation

2TallTyler
Copy link
Member

Motivation / Problem

When autoreplacing vehicles with another type, the old vehicle type is greyed out when none remain. Removing these empty vehicles from the list is fairly annoying, especially if you have a lot of vehicles to remove — when I play, I forget to autoreplace on a regular basis and tend to upgrade a lot of vehicle types at once.

  1. Click on the vehicle
  2. Move the mouse to the "Stop Replacing Vehicles" button and click
  3. Repeat

Description

When buying vehicles, we can Ctrl-click on a vehicle to hide it from the menu in a single action.

Now we can do that with autoreplace, but only for vehicles for which none remain.

This works identically to the Stop Replacing Vehicles button, so it respects groups.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@LC-Zorg
Copy link

LC-Zorg commented Oct 23, 2021

When buying vehicles, we can Ctrl-click on a vehicle to hide it from the menu in a single action.

I didn't know this feature before. :) I tried to find arguments against, but I don't see them for this moment. Now that there's already a similar use of Ctrl + click, it seems quite sensible and useful.
Btw. The hiding feature doesn't work in the vehicle replacement window. It goes beyond this PR, but it would be useful and make a logical whole together.

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, why not

@michicc michicc merged commit b4bd7b3 into OpenTTD:master Nov 7, 2021
@2TallTyler 2TallTyler deleted the autoreplace_ctrl_click branch November 7, 2021 18:54
@buttercup5
Copy link

I had to go a LONG way back (2005), but it used to be that when there were no more vehicles left to replace, they would automatically be removed from the list.

The last version where you can see this behaviour is 0.4.0.1. The release notes for 0.4.5 mention a complete rewrite of the autoreplace code so perhaps there was a technical reason for the change. If not for a technical reason, I can't think what purpose the current behaviour serves. No further actions can be performed once all the selected vehicles have been replaced, and I can't see why a player would need to be reminded of the what the old vehicle was.

I'm probably overlooking something obvious.

@2TallTyler
Copy link
Member Author

We discussed this on Discord, and at least one user mentioned that having the replaced vehicles hang around acted as a confirmation that the replacement was complete. I disagree and would prefer them to disappear automatically, but Ctrl-clicking is a good compromise. 😄

@buttercup5
Copy link

Ah, that's fair enough. Maybe a news message would serve that purpose better though.

In any case, it's not a big issue and, like you said, ctrl+clicking is a good compromise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants