Settings GUI: Add setting dependencies #13704
Merged
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.
Part of #13476
The aim of this PR is to improve User Experience by only showing settings when they make sense. This is currently done in a hardcoded way for shader settings in "Most Used", this PR makes it more generic and will allow removing Most Used in the future.
Settings can have a list of requirements, defined in the settingtypes.txt file. For example:
These requirements may be:
enable_dynamic_shadows
shaders
(both enable_shaders and a video driver that supports it)desktop
android
touchscreen_gui
for builds with touchscreen controlsopengl
/gles
To do
This PR is a Work in Progress
enable_shaders
doesn't show settings againShow fields as greyed out with a tooltip if it's possible to enable them?Future PRQuestion: Should setting and engine-defined keys be distinguished? Perhaps all engine-defined keys should be in capitals -
TOUCHSCREEN_GUI
,SHADERS
,DESKTOP
, etc. This may be a good idea for future compat. Say we add a new engine-defined value in the future:foobar
. A mod may add this as a requirement in their settingtypes.txt, but this would result in older versions of the engine assuming that it is a setting value not an engine-defined value, and thus showing a warning and considering it not fulfilled. But perhaps its a good thing to have unknown values be unfulfilledHow to test
Try enabling and disabling shaders. Try various shader options as well
In check_requirements, add the following to the top to pretend to be Android:
local TOUCHSCREEN_GUI = true
local PLATFORM = "Android"