Table of Contents

Namespace MCM.Abstractions.Xml

Classes

PresetXmlModel
<Preset Id="performance" DisplayName="{=id}Performance">
  <Property Id="SomeBool" Value="true" />
</Preset>

Values are written the way the property's Default attribute is written. A dropdown takes the option index.

PropertyBaseXmlModel

Common attributes of every property declared in a <Settings> XML block: Id, DisplayName, Order, HintText, RequireRestart.

PropertyBoolXmlModel

<Bool Id="" DisplayName="" Default="false" IsToggle="false" />

PropertyDropdownXmlModel
<Dropdown Id="" DisplayName="" Default="0">
  <Option Value="First" />
  <Option Value="Second" />
</Dropdown>

Default and Value are option indices.

PropertyFloatingIntegerXmlModel

<FloatingInteger Id="" DisplayName="" MinValue="0" MaxValue="1" Default="0.5" ValueFormat="0.00" />

PropertyGroupXmlModel
<Group Name="{=id}Display Name" Order="0">
  <Bool ... />
  <Group Name="Nested"> ... </Group>
</Group>

A nested group becomes a sub group. Its full name is Parent/Nested, joined with the settings' sub group delimiter.

PropertyIntegerXmlModel

<Integer Id="" DisplayName="" MinValue="0" MaxValue="10" Default="5" ValueFormat="0" />

PropertyTextXmlModel

<Text Id="" DisplayName="" Default="" />

SettingsXmlModel

Settings declared in XML instead of code. The block can be the root of its own file or a child of <Module> in a mod's SubModule.xml, where MCM discovers it without the mod referencing MCM. The file is also the store: every property carries its Default, and the current value is written back as a Value attribute by MCM or by the mod itself (see SettingsXmlWriter).

<Settings>
  <Group Name="{=id}General">
    <Bool Id="Enabled" DisplayName="{=id}Enabled" HintText="{=id}..." Default="true" RequireRestart="false" />
  </Group>
  <Preset Id="off" DisplayName="Off"><Property Id="Enabled" Value="false" /></Preset>
</Settings>

Properties placed directly under <Settings> go to the default (Misc) group. In a SubModule.xml, Id defaults to the module id and DisplayName to the module name.

SettingsXmlWriter

Writes current values back into the file a <Settings> block was declared in, as Value attributes on the property elements. Only those attributes change: the file is edited as text, not re-serialized, so comments, quotes, attribute layout, line endings, encoding and byte order mark stay as they are.


This page was last modified at 10/17/2026 15:12:19 +00:00 (UTC).