Settings Extender
An extremely simple way to add new pages to the Settings window.
截圖 共 1 張
模組介紹 作者原文
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.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: