SettingsApi

v1.1.1·Updated 2021-07-09

Settings API for allowing mods to add settings.

About this mod Author’s original text

Muck Settings API

This is a helper mod made to allow easier addition of settings to mods that require configuration, all in the in-game settings menu.

An example of implementing this library can be found in the "MuckSettingsExample" subdirectory of this repository.

To add your own settings, first patch one of the 5 tabs in `MuckSettings.Settings: either Gameplay, Controls, Graphics, Video or Audio. Don't worry about the settings overflowing, all pages are scrollable. Next, make sure you take a MuckSettings.Settings.Page argument called page in your patch, and you can add settings to that page. To save your settings, you should be using BepInEx.Configuration;, and create a ConfigFile to store your config. Make sure to specify that config.SaveOnConfigSet = true;` or else your config willl not save when the user changes the settings!

Different settings

Boolean Setting

This one is fairly straightforward. It's a toggle that can be either on, or off.

  • You should use `page.AddBoolSetting(string name, ConfigEntry configEntry) to create a setting that assigns the associated ConfigEntry` from your BepInEx config. The first parameter is the display name for the setting.
  • You can use `page.AddBoolSetting(string name, bool defaultValue, Action update) to create a low-level setting where you control it. name is the name that displays for the option. defaultValue is the value to show when the page loads, and update` is the Action to call with the new value whenever the user changes the setting.

Scroll Setting

A scroll setting lets the user scroll through a list of predetermined options.

  • You should use `page.AddScrollSetting(string name, ConfigEntry configEntry) where T: Enum to create a scroll setting from enum values with the given ConfigEntry`. For this to work correctly you need the values to be consecutive from 0 (i.e. just the names in the declaration, no values assigned).
  • You can use `page.AddScrollSetting(string name, T defaultValue, Action update) where T: Enum to create a scroll setting from enum values, starting at the specified defaultValue and telling when it changes using the update` callback.
  • You can use `page.AddScrollSetting(string name, int index, Action update) where T: Enum`. It works very similarly to the one above, but this one takes the value of the enums, and not the enum object straight up. You should probably only use this when you actually need the index values, such as when storing them and you cannot change that (i.e. the vanilla game's settings store, which is the only reason this overload exists).
  • You can use `page.AddScrollSetting(string name, string values, int defaultIndex, Action update) to create a with name still being the name that displays, values is the array of options to show, defaultIndex the index you loaded to show by default, and update` is a callback giving you the index of the option whenever the user changes it.

Slider Setting

A slider setting is... a slider, that you use to select a number within a range. The sliders are only whole numbers, and you can use divison if you want fractional values, such as with the music slider in the base game, which actually ranges from 0-1 internally but is divided by 10 since the slider range is 0-10.

  • You should use `page.AddSliderSetting(string name, ConfigEntry configEntry, int min, int max) to create a slider from the given ConfigEntry, ranging from min-max and with the display name name`.
  • You can use `page.AddSliderSetting(string name, int defaultValue, int min, int max, Action update) to create a slider setting with the given name and defaultValue, ranging from min to max and telling you when it changes with update`.

Control Setting

A control setting allows the user to choose a button on their keyboard or mouse to bind a specific action to.

  • You should use `page.AddControlSetting(string name, ConfigEntry configEntry) to create a control setting from the given ConfigEntry. name` is the display name in the settings page.
  • You

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

File & checksum

Filename
SettingsApi-1.1.1.zip
File size
2.7 MiB
SHA-256
5e25e358da7e6e769b80c05d0d2599a1aaa06d25a8d2878fdaa1947c6a801031
Stored at
2026-10-06 19:25