Follow the Tutorial. You will also want to read Updating Mod Configurations Dynamically
See the ModConfigDependencyTest project in this repo for a working example.
This mod supports several very useful advanced features that let you make your settings page more dynamic. See the Advanced Features documentation for details.
For a complete catalog of all of the functions available to you, see API Documentation
Here are MCM's core object types, which also correspond to its core concepts:
- The API Instance (
MCM_API_Instance
) is the entry point for the MCM API. Your mod will create its settings pages from here. - The Page (
MCM_API_SettingsPage
) represents a visual page of settings, which you can access by clicking the corresponding tab in the options screen. Each page contains groups of settings. Most mods will use only one page. - The Group (
MCM_API_SettingsGroup
) is a visual grouping of settings. Most mods might only need one group, but more complex mods might want to organize settings into groups. - The Setting (
MCM_API_Setting
and other Settings classes) are the actual widgets: checkboxes, sliders, dropdowns, etc. Typically these widgets represent some adjustable setting in your mod.
A typical workflow would look like this:
- Call the API instance to create a page.
- Add groups to the page.
- Add settings to the groups.
- Hook up the code to save settings to an INI file.