Display Conditions
Александр edited this page Nov 30, 2018
·
5 revisions
Display conditions allow you to display different sets of MCM Controls under different circumstances.
For example, a mod's Advanced Settings can be set to display only if a switcher labelled Show Advanced Options
is turned on, and otherwise stay hidden if the option is off.
To do this, assign all controls belonging to the advanced options to a group ID.
{
... (an advanced option control)
"groupCondition": 1
}
Then assign the groupControl
property with the same group ID to the control whose state should determine whether the group is displayed.
{
... (the Show Advanced Options switcher)
"groupControl": 1
}
The display state of controls with groupCondition = 1
will now be controlled by the state of the control with groupControl = 1
.
More complex conditions can be created with the AND
and OR
operators.
The following are equivalent:
"groupCondition": 1
"groupCondition": [1]
"groupCondition": {"OR": [1]}
"groupCondition": [1, 2]
"groupCondition": {"OR": [1, 2]}
"groupCondition": {"AND": [1, 2]}
"groupCondition": {"ONLY": [1, 2]}