ModConfigManager

版本 v1.0.6·更新於 2026-02-11

A universal configuration manager UI for YAPYAP mods. Supports real-time editing, tooltips, and multilingual UI. 製作:嗶哩嗶哩-華麗的小檸檬

模組介紹 作者原文

YAPYAP MOD 通用配置框架 (ModConfigManager)

製作:嗶哩嗶哩-華麗的小檸檬

這是一個爲 YAPYAP 開發的通用配置管理框架,旨在爲 MOD 開發者提供一個統一、美觀且易用的 UI 界面,讓玩家可以直接在遊戲中修改各個 MOD 的 BepInEx 配置項,而無需手動編輯.cfg 文件。

功能特性

  • 即時生效:在 UI 中修改數值後點擊“保存”即可實時應用配置(需 MOD 支持)。
  • 多語言支持:界面支持中英雙語,並可根據遊戲語言自動切換。
  • 數值自定義:支持布爾值、數字(滑塊/輸入框)、枚舉(下拉菜單)等多種類型。
  • 重置功能:支持單個配置項獨立重置爲默認值。
  • 懸浮提示:鼠標懸停在配置項上可實時讀取並顯示配置文件中的描述信息。
  • 調試模式:內置雙語調試日誌系統,方便開發者調試。

開發者使用指南 (Developer API)

如果你希望你的 MOD 能更好地適配本框架,或者需要根據配置界面的顯示狀態調整 MOD 邏輯:

  • 添加引用與依賴
  • 將 ModConfigManager.dll 添加到你的 C# 項目引用(Reference)中。
  • 在你的插件類(繼承自 BaseUnityPlugin)上聲明硬依賴:

[BepInDependency("com.hali.yapyap.modconfigmanager")]

  • 自動掃描機制
  • 本框架會自動掃描所有繼承自 BaseUnityPlugin 的 MOD,並提取其通過 Config.Bind() 註冊的所有配置項。
  • 建議爲你的配置項提供清晰的 Description(支持中英雙語,建議格式:"中文描述 | English Description"),框架會自動解析並作爲懸浮提示顯示。
  • 監聽配置變更
  • 爲了實現“即時生效”而不必重啓遊戲,建議監聽配置項的變更事件:

var myConfig = Config.Bind("General", "Speed", 1.0f, "移動速度");

myConfig.SettingChanged += (sender, args) => {

// 在這裏編寫配置變更後的邏輯

Debug.Log("配置已更新!");

};

  • 判斷 UI 是否顯示
  • 如果你的 MOD 在配置時需要暫停某些邏輯(如屏蔽遊戲輸入),可以通過以下屬性判斷:

if (ModConfigManager.ModConfigManager.IsUIShown) {

// UI 正在顯示,執行相關邏輯

}

  • 手動刷新 MOD 列表
  • 正常情況下框架會自動處理。如果你有動態加載 MOD 的需求,可以通過 ModConfigUI.Instance.RefreshModList() 手動觸發 UI 刷新。

安裝方法 (玩家)

  • 安裝 BepInEx。
  • 將 ModConfigManager.dll 放入 BepInEx/plugins 文件夾。
  • 進入遊戲主菜單,點擊左下角的 MOD 配置 按鈕即可打開界面。

YAPYAP Universal Mod Config Framework (ModConfigManager)

Created by: Bilibili - 華麗的小檸檬

A universal configuration management framework for YAPYAP mods. It provides a unified, clean, and user-friendly UI for mod developers, allowing players to modify BepInEx configurations directly in-game without manual.cfg file editing.

Features

  • Instant Apply: Real-time configuration updates after clicking "Save" (requires mod support).
  • Multilingual Support: Supports Chinese and English, automatically switching based on game language.
  • Customizable Values: Supports booleans, numbers (sliders/input fields), enums (dropdowns), and more.
  • Reset Function: Independent reset buttons for individual configuration entries.
  • Tooltips: Real-time display of descriptions from the config file on mouse hover.
  • Debug Mode: Built-in bilingual debug logging system for developers.

Developer API Guide

To better integrate your mod with this framework or adjust logic based on the UI state:

  • Add Reference & Dependency
  • Add ModConfigManager.dll to your C# project references.
  • Declare a hard dependency in your BaseUnityPlugin class:

[BepInDependency("com.hali.yapyap.modconfigmanager")]

  • Automatic Scanning
  • The framework automatically scans all BaseUnityPlugin mods and extracts all entries registered via Config.Bind().
  • Provide clear Description for your entries (supports bilingual format: "Chinese Description | English Description").
  • Listen for Changes
  • For instant application without restarts, listen to the SettingChanged event:

var myConfig = Config.Bind("General", "Speed", 1.0f, "Move Speed");

myConfig.SettingChanged += (sender, args) => {

// Your logic here

};

  • Check UI Visibility
  • To pause logic or block inputs when the config UI is open:

if (ModConfigManager.ModConfigManager.IsUIShown) {

// UI is open

}

Installation (Players)

  • Install BepInEx.
  • Place ModConfigManager.dll into the BepInEx/plugins folder.
  • In the main menu, click the MOD CONFIG button at the bottom left to open the UI.

Powered by ModConfigManager Framework | 製作:嗶哩嗶哩-華麗的小檸檬

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
ModConfigManager-1.0.6.zip
檔案大小
52.4 KiB