-
Notifications
You must be signed in to change notification settings - Fork 39
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
libtrx/config: refactor enforced config approach #1858
libtrx/config: refactor enforced config approach #1858
Conversation
Download the built assets for this pull request: |
What if we try to set the enforced config options in the gameflow file instead? Probably a tough cookie, as we read that file much later. Maybe a separate file such as TR1X-lock.json (or less clumsy naming)? That way the files are free to be shipped and override existing installations, which removes the burden of maintaining backwards compatibility with existing user setups. |
Ok, I think it's doable and I think it will be nicer in the long-run. If it wasn't for the UB snag we'd be home and dry pretty much 😄 No need to test just yet @walkawayy, @aredfan - I'll let you know when it's updated and ready. |
f5c22f4
to
698f32a
Compare
Ok, we should be good for testing this now. The gameflow now accepts the The config tool will continue to show where settings are enforced, as it also reads both files now. |
src/libtrx/config/file.c
Outdated
@@ -165,6 +193,9 @@ bool ConfigFile_Write(const char *path, void (*dump)(JSON_OBJECT *root_obj)) | |||
if (old_data != NULL) { | |||
Memory_FreePointer(&old_data); | |||
} | |||
if (enforced_data != NULL) { | |||
Memory_FreePointer(&enforced_data); | |||
} |
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.
Memory_Free family already checks for nulls so no need for this double safety.
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.
Thanks, updated.
This refactors the enforced config control from LostArtefacts#1854 into the gameflow and removes the legacy settings for enforcing game modes and save crystals. Resolves LostArtefacts#1857.
698f32a
to
641e00d
Compare
Resolves #1857.
Checklist
Description
This removes the dedicated enforced game modes and save crystals settings from the gameflow files, as these can now be controlled by builders in the main config file. The only exception is the UB gameflow, as we need to continue enforcing save crystals to be disabled there, and this can't be done through the config file. As a result, backwards compatibility is in place as standard with this, while the documentation points to the correct procedure for enforcing settings.LMK if you think we can remove backwards compatibility forforce_game_modes
, I'm inclined to perhaps leave it for a while.This refactors the enforced config control from #1854 into the gameflow and removes the legacy settings for enforcing game modes and save crystals.