config: Add capability to disable/hide config options #594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds two optional properties to config options,
disabled
andhidden
, that can access the values of other config options in the config group and programmatically be hidden or disabled as other config options change. Essentially, this allows the ability to create "child" config options that will only appear or only be modifiable if their "parent" is set a certain way.I originally had a stronger use case for this with some FRU p4 stuff I was working on, but I figured out an alternative way to do it without needing configs. I was going to shelve this, but someone in discord recently requested an option to have relative (vs. true) directions called out for P3 Ultimate Relativity, so there is at least a potential use for this now.
Some completely made up mockups below to illustrate:
Parent Strat is
none
, so both sub-options are hidden:Parent strat set; both sub-options visible; but checkbox is false, so the final sub-option is disabled:
Checkbox now true, so the final sub-option is enabled: