Skip to content
Александр 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.

Advanced Conditions

More complex conditions can be created with the AND and OR operators.

The following are equivalent:

Display if groupControl 1 is true.

  • "groupCondition": 1
  • "groupCondition": [1]
  • "groupCondition": {"OR": [1]}

Display if either groupControl 1 OR 2 is true.

  • "groupCondition": [1, 2]
  • "groupCondition": {"OR": [1, 2]}

Display if both groupControl 1 AND 2 are true.

  • "groupCondition": {"AND": [1, 2]}

Display if both groupControl 1 AND 2 are true and all others groupControls at this page false.

  • "groupCondition": {"ONLY": [1, 2]}