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] Vehicle property to copy properties of an existing definiton. #12523

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Apr 17, 2024

Motivation / Problem

Variants require relevant engine properties to be set for each variant, resulting in larger source file and NewGRF files. Often most of the properties should be the same. This could be achieved by making the NML tooling duplicate properties, but this does not solve the 'bloat'.

Description

Add a property to copy properties of an existing engine definition. Any properties altered afterwards will not propagate to the copies. For flexibility, this does NOT also set the variant_id property, which should also be set after using the copy properties property properly.

So this simplifies creation of similar variants, but can also be used for distinct types.

Strings and Action 3-2-1 chains are not copied.

Limitations

Untested.

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')

…nition.

This simplifies creation of similar variants, but can also be used for distinct types.

Strings and Action 3-2-1 chains are not copied.
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

1 participant