Settings Extender
An extremely simple way to add new pages to the Settings window.
Screenshots 1 screenshots
About this mod Author’s original text
Settings Extender
An extremely simple way to add new pages to the Settings window.
Who is this for?
Dependencies and modders. This will either be required for a mod you want to use, or you want to include it as part of your own mod to have in-game settings.
Installation
The contents of plugins/ is moved into PEAK/BepInEx/plugins.
How to use in a mod
Include DLL reference
Add a line like so similar to others in your.csproj file to include it in your project:
Register page
Call SettingsRegistry.Register(string pageName) in your plugin's Awake method:
using BepInEx;
using SettingsExtender;
public class Plugin: BaseUnityPlugin
{
private void Awake()
{
SettingsRegistry.Register("Demo Page");
}
}
Create settings
This isn't a tutorial, but you'll need to create a class for each setting you want to include. There's a couple built-in under Zorro.Settings in the assembly, check them out and how PEAK uses them (like FovSetting).
public class DemoSliderSetting: FloatSetting, IExposedSetting
{
public string GetDisplayName()
{
return "Demo Slider";
}
public string GetCategory()
{
// Get our fake SettingsCategory id as a string
return SettingsRegistry.GetPageId("Demo Page");
}
protected override float GetDefaultValue()
{
return 50;
}
protected override float2 GetMinMaxValue()
{
return new float2(0, 100);
}
public override void ApplyValue()
{
//
}
}
Add settings
Once your setting is created, include it by setting it up with SettingsHandler in your plugin's Start method:
private void Start()
{
SettingsHandler.Instance.AddSetting(new DemoSliderSetting());
}
Once that's added it'll get picked up and included on the settings menu.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- 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.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- 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.
Install these first, or the mod will not work: