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: Show group name as part of the default vehicle name. #8307

merged 2 commits into from Dec 15, 2020


Copy link

@stormcone stormcone commented Sep 14, 2020

Only if the vehicle is member of a group and does not have a user defined name.

This patch is based on @KeldorKatarn's commit:


Copy link

@TrueBrain TrueBrain commented Dec 15, 2020

I really like this. There is one thing my OCD triggers on ... but I am not sure it needs fixing:

It is now called Train 1 but MyGroup #1. Depending on if it is in a group, the number gained a #.

I am almost tempted to always add a # :P

Only if the vehicle is member of a group and does not have a user defined name.
Copy link

@TrueBrain TrueBrain commented Dec 15, 2020

Okay, this hit my OCD enough that I added a commit to change Train 1 into Train #1. Will be a while before all translations pick that up.

I made some minor changes to your patch:

  • With AddToGroup, only invalidate the data of the vehicle that is added
  • With DeleteGroup, no need to invalidate data; the calls done by DeleteGroup always cause AddToGroup to be called
  • Renamed the new string STR_FORMAT_GROUP_VEHICLE_NAME to include _NAME

Also rebased :)

This is for consistency; most other objects add a # to indicate
it is the Nth of that object, except for Trains / RVs / Ships /
This becomes painfully apparent with unnamed vehicles in groups,
which do get a "#".
@TrueBrain TrueBrain merged commit f7b8e7e into OpenTTD:master Dec 15, 2020
6 checks passed
Copy link
Contributor Author

@stormcone stormcone commented Dec 15, 2020

@TrueBrain Okay, thank you. :)

@stormcone stormcone deleted the group-name branch Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants