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

Move UI exclusive string ids to UiStringIds.h #22016

Merged
merged 3 commits into from
May 17, 2024

Conversation

AaronVanGeffen
Copy link
Member

@AaronVanGeffen AaronVanGeffen commented May 10, 2024

This moves string ids that are only used in UI context to a new file, UiStringIds.h. The main benefit of this is not having to recompile all of libopenrct2 whenever a string is added in the UI.

As with #22010, the new file was generated using Python to prevent any errors as a result of manual copy pasting. However, some manual touch-ups were still needed due to duplicate definitions, and -Wdeprecated-anon-enum-enum-conversion.

@AaronVanGeffen AaronVanGeffen marked this pull request as draft May 10, 2024 22:33
@AaronVanGeffen AaronVanGeffen marked this pull request as ready for review May 11, 2024 09:37
Copy link
Member

@Gymnasiast Gymnasiast left a comment

Choose a reason for hiding this comment

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

Would like to see the unrelated changes taken out.

@AaronVanGeffen
Copy link
Member Author

Would like to see the unrelated changes taken out.

These changes are the result of -Wdeprecated-anon-enum-enum-conversion triggering, being the result of there now being two enums. The changes dealing with this are all contained in the second commit, fwiw.

@Gymnasiast
Copy link
Member

Would like to see the unrelated changes taken out.

These changes are the result of -Wdeprecated-anon-enum-enum-conversion triggering, being the result of there now being two enums. The changes dealing with this are all contained in the second commit, fwiw.

Maybe they shouldn’t be in an enum at all, but be declared as regular constants. But that might be a step too far for this PR?

@AaronVanGeffen
Copy link
Member Author

Maybe they shouldn’t be in an enum at all, but be declared as regular constants. But that might be a step too far for this PR?

It's worth exploring alternatives, such as making them namespaced instead (e.g. OpenRCT2::StringIds::not_enough_funds). But yeah, that's something for another PR, I agree.

Thankfully, there are only 11 ternaries affected in the entire codebase, so it is easy enough to address the -Wdeprecated-anon-enum-enum-conversion warnings that have surfaced.

Copy link
Member

@Gymnasiast Gymnasiast left a comment

Choose a reason for hiding this comment

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

Not really a fan of some of the changes, but I’m not dying on Ternary Hill tonight.

@AaronVanGeffen AaronVanGeffen added this to the v0.4.12 milestone May 17, 2024
@AaronVanGeffen AaronVanGeffen merged commit 14828e4 into OpenRCT2:develop May 17, 2024
22 checks passed
@AaronVanGeffen AaronVanGeffen deleted the ui-string-ids branch May 18, 2024 06:56
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.

2 participants