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.
I asked for opinions about this concept earlier in the Discord server, but got no response. I decided to open a PR, so this doesn't get missed/forgotten. I am open to suggestions on this.
Short explaination about what this PR adds:
Dependencies don't have to be based on boolean property states. Dependencies can be based on any function that returns a boolean. Properties may depend on a specific state of another property (not limited to boolean values). They can also depend on a completely external thing that isn't even a part of the config.
From the perspective of a mod dev, the changes in this PR don't change the behavior or usage of normal boolean property based dependencies, and instead just adds more options for making dependencies. However there are some changes under the hood.
A practical use case for this:
In a config I am developing, I want to have a (dropdown) selector that chooses one mode for an animation. After that config property, I would like to have settings relevant to that selected mode. In other words, I want to hide all settings that aren't related to the selected mode.
I could set the mode-specific settings to depend on the mode chooser, but the issue is that normally Vigilance dependencies only support boolean properties (a selector isn't one of them, because there can be more than 2 options) as the dependencies.
With something like the changes in this PR, I could specify the conditions when to display a property based on whatever I want.