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
Close #19870: Make new colours compatible with UI themes #21991
base: develop
Are you sure you want to change the base?
Conversation
bfd88ea
to
0f3f53b
Compare
does this allow the colors to be used for ride names? |
No, that’s a different set of colours. |
Nice refactor, and good to have the extra colours exposed through the themes API. Things appear to be working properly as well. I wonder about the serialisation aspect of the implementation, though. Like before, colours are serialised to integer numbers, just longer ones. For example: {
"entries": {
"WC_CHEATS": {
"colours": [
257,
19
]
},
"WC_CLEAR_SCENERY": {
"colours": [
280,
24,
24
]
}, I'm wondering whether it would be better to take this opportunity to separate flags from colours as well, e.g.: {
"entries": {
"WC_CHEATS": {
"colours": [
1,
19
],
"flags": [
1,
0
]
},
"WC_CLEAR_SCENERY": {
"colours": [
24,
24,
24
],
"flags": [
1,
0,
0
]
}, It would be even better if everything used (string) constants, but I think that's overkill for a config that few people modify by hand. I think extracting the flags out would be a nice middle ground, though. |
Stuff left to do:
|
ea97f71
to
499080a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
I have split off the plugin stuff from this PR and instead emulated old behaviour. This will be revisited at a later date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing found no abnormalities. I like the improved JSON format as well, with colours now being stored as strings, and transparency being a boolean. Makes these theme config files way more readable. Nice work!
This refactors the usage of COLOUR_FLAG_* to a new struct with a field for colour and a field for flags. This frees up the upper bits, which were previously clashing with any colours with ID >= 32.
Future refactors left out of this PR: