-
Notifications
You must be signed in to change notification settings - Fork 8
Group Conditions
Group conditions allow you to enable or display different sets of MCM Controls under different circumstances.
For example, a mod's Advanced Settings can be set to display only if a toggle labeled 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
"groupBehavior": "hide" // Optional. Defaults to "disable".
}
The possible groupBehavior
values are disable
, hide
, and skip
. The skip
option allows you to dynamically change the layout of a page, but you will need to call ForcePageReset
from the Papyrus script in order to update a page that is already shown.
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": {"NOT": 1}
"groupCondition": [1, 2]
"groupCondition": {"OR": [1, 2]}
"groupCondition": {"AND": [1, 2]}
"groupCondition": {"ONLY": [1, 2]}