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

Add: [NewGRF] Extended custom waypoint classes. #12653

Merged
merged 1 commit into from May 26, 2024

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented May 11, 2024

Motivation / Problem

Authors have asked for more custom waypoint classes, as lumping all waypoints into just one class gives a very big list.

The simplest way to achieve this, instead of adding more properties, is to allow more classes to be treated as waypoints.

Description

With this PR, station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class. Also applies to road stop waypoints, although those are not supported yet.

This allows waypoints to be split into categories just like stations, instead of all being lumped together.

image

Modified version of UK Waypoints for testing:

UK_Waypoints-1.zip

Limitations

My review of all the custom station and roadstop NewGRF files I have available showed that they all use only ASCII characters for the class label. Therefore, the 0xFF marker was chosen because it minimises the chance of conflicts with existing NewGRFs... but it's not impossible.

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, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

This allows waypoints to be split into categories just like stations, instead of all being lumped together.

Station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class.
@2TallTyler
Copy link
Member

How does this interact with #12618? Do we need both?

@PeterN
Copy link
Member Author

PeterN commented May 14, 2024

How does this interact with #12618? Do we need both?

#12618 would need to be applied only to 14.x (or applied to master and then reverted again)

@2TallTyler
Copy link
Member

Could we just apply this PR to 14.2, or does it rely on something that's not in 14.x?

@PeterN
Copy link
Member Author

PeterN commented May 14, 2024

Nope, 14.x does not have IsWaypointClass() nor the new class/type picker—the old waypoint UI in 14.x can only show 'WAYP'.

@2TallTyler
Copy link
Member

Ah, right. In that case, if you fix the conflict I will approve #12618. 🙂

@PeterN PeterN merged commit 2c70ccb into OpenTTD:master May 26, 2024
14 checks passed
@PeterN PeterN deleted the more-waypoints branch May 26, 2024 08:53
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

3 participants