You are viewing a potentially older version of this package. View all versions.
lemon666-ModConfigManager-1.0.6 icon

ModConfigManager

A universal configuration manager UI for YAPYAP mods. Supports real-time editing, tooltips, and multilingual UI. 制作:哔哩哔哩-华丽的小柠檬

Date uploaded 2 weeks ago
Version 1.0.6
Download link lemon666-ModConfigManager-1.0.6.zip
Downloads 1166
Dependency string lemon666-ModConfigManager-1.0.6

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2304 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2304

README

YAPYAP MOD 通用配置框架 (ModConfigManager)

制作:哔哩哔哩-华丽的小柠檬

这是一个为 YAPYAP 开发的通用配置管理框架,旨在为 MOD 开发者提供一个统一、美观且易用的 UI 界面,让玩家可以直接在游戏中修改各个 MOD 的 BepInEx 配置项,而无需手动编辑 .cfg 文件。

功能特性

  • 即时生效:在 UI 中修改数值后点击“保存”即可实时应用配置(需 MOD 支持)。
  • 多语言支持:界面支持中英双语,并可根据游戏语言自动切换。
  • 数值自定义:支持布尔值、数字(滑块/输入框)、枚举(下拉菜单)等多种类型。
  • 重置功能:支持单个配置项独立重置为默认值。
  • 悬浮提示:鼠标悬停在配置项上可实时读取并显示配置文件中的描述信息。
  • 调试模式:内置双语调试日志系统,方便开发者调试。

开发者使用指南 (Developer API)

如果你希望你的 MOD 能更好地适配本框架,或者需要根据配置界面的显示状态调整 MOD 逻辑:

  1. 添加引用与依赖

    • ModConfigManager.dll 添加到你的 C# 项目引用(Reference)中。
    • 在你的插件类(继承自 BaseUnityPlugin)上声明硬依赖:
      [BepInDependency("com.hali.yapyap.modconfigmanager")]
      
  2. 自动扫描机制

    • 本框架会自动扫描所有继承自 BaseUnityPlugin 的 MOD,并提取其通过 Config.Bind() 注册的所有配置项。
    • 建议为你的配置项提供清晰的 Description(支持中英双语,建议格式:"中文描述 | English Description"),框架会自动解析并作为悬浮提示显示。
  3. 监听配置变更

    • 为了实现“即时生效”而不必重启游戏,建议监听配置项的变更事件:
      var myConfig = Config.Bind("General", "Speed", 1.0f, "移动速度");
      myConfig.SettingChanged += (sender, args) => {
          // 在这里编写配置变更后的逻辑
          Debug.Log("配置已更新!");
      };
      
  4. 判断 UI 是否显示

    • 如果你的 MOD 在配置时需要暂停某些逻辑(如屏蔽游戏输入),可以通过以下属性判断:
      if (ModConfigManager.ModConfigManager.IsUIShown) {
          // UI 正在显示,执行相关逻辑
      }
      
  5. 手动刷新 MOD 列表

    • 正常情况下框架会自动处理。如果你有动态加载 MOD 的需求,可以通过 ModConfigUI.Instance.RefreshModList() 手动触发 UI 刷新。

安装方法 (玩家)

  1. 安装 BepInEx
  2. ModConfigManager.dll 放入 BepInEx/plugins 文件夹。
  3. 进入游戏主菜单,点击左下角的 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:

  1. Add Reference & Dependency

    • Add ModConfigManager.dll to your C# project references.
    • Declare a hard dependency in your BaseUnityPlugin class:
      [BepInDependency("com.hali.yapyap.modconfigmanager")]
      
  2. 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").
  3. 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
      };
      
  4. Check UI Visibility

    • To pause logic or block inputs when the config UI is open:
      if (ModConfigManager.ModConfigManager.IsUIShown) {
          // UI is open
      }
      

Installation (Players)

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

Powered by ModConfigManager Framework | 制作:哔哩哔哩-华丽的小柠檬

CHANGELOG

Changelog - ModConfigManager

[1.0.6] - 2026-02-11

Fixed

  • Input Compatibility: Implemented "Surgical Input Blocking". Global mouse input is now only blocked when the cursor is outside the MOD UI panel. This fixes the issue where MOD buttons were unclickable while still preventing clicking through to the main menu.
  • Raycaster Optimization: Increased frequency of background raycaster disabling for more responsive input management.

修复

  • 输入兼容性优化: 实现了“外科手术式输入拦截”。现在仅在鼠标位于 MOD 界面面板之外时才拦截全局鼠标信号。这既解决了 MOD 自身按钮无法点击的问题,又保证了不会穿透点击到大厅主菜单。
  • 射线检测优化: 提升了背景射线发射器禁用的频率,使输入管理更加实时响应。

[1.0.5] - 2026-02-11

Added

  • Game Update Compatibility: Fully adapted to the February 10th game update.
  • UI Occlusion Fix: Fixed the issue where the lobby mod configuration button would occlude the bottom-left UI when the mod interface was open.
  • Button Interaction: Fixed the issue where UI buttons were unclickable in the new game version.

修复与更新

  • 游戏版本兼容: 深度适配并兼容 2月10日 更新的游戏新版本。
  • UI 遮挡修复: 修复了开启 MOD 配置界面后,大厅注入按钮会遮挡左下角 UI 的问题。
  • 交互修复: 解决了在新版本中 MOD 界面按钮无法点击的兼容性问题。

[1.0.4] - 2026-02-08

Fixed

  • Mouse Penetration (Ultra): Implemented a "Violent" input blocking system via global Harmony patches to UnityEngine.Input to completely intercept clicks when the UI is open.
  • FPS & Performance: Optimized the Update loop by throttling raycaster searches to every 0.5s. Significantly reduced CPU usage and fixed lag in large mod lists.
  • Code Review: Cleaned up redundant debug logs and optimized internal logic for better readability and performance.
  • Guest Multiplayer Visibility: Fixed the issue where the MOD button would incorrectly show for guest players joining via invitation.
  • Scene Transition Logic: Added SceneManager.sceneLoaded listener to ensure the button is hidden during the entire loading process when entering game scenes.
  • Enhanced Verification: Added real-time scene name validation to the visibility tracking system for better reliability in online sessions.

修复

  • 鼠标穿透修复 (增强版): 实现了“暴力”输入拦截系统。通过对 UnityEngine.Input 添加全局 Harmony 补丁,在 MOD 界面打开时彻底切断底层鼠标点击信号。
  • 性能与帧数优化: 优化了 Update 循环,将昂贵的射线发射器搜索频率降低至每 0.5 秒一次。显著降低了 CPU 占用,解决了条目较多时的掉帧卡顿。
  • 代码审查: 清理了冗余的调试日志并优化了内部逻辑结构,提升了代码的可读性与运行效率。
  • 客机联机显示修复: 修复了客机通过好友邀请进入游戏时,游戏内错误显示 MOD 配置按钮的问题。
  • 场景切换优化: 引入了 SceneManager.sceneLoaded 监听机制,确保从大厅进入游戏场景的整个加载过程中按钮处于隐藏状态。
  • 增强校验系统: 在显示追踪系统中增加了实时的场景名校验,提升了联机模式下 UI 显示/隐藏的可靠性。

[1.0.3] - 2026-02-08

Fixed

  • TMPro NRE: Resolved a NullReferenceException in clipping logic when processing complex mods like SpellCustomizer and YapLocalizer.
  • Input Field Crash: Fixed a critical game crash when clicking empty input fields after saving specific configurations.
  • Config Saving: Improved ApplyAllChanges to ensure all configuration files are properly saved to disk.
  • Scroll Experience: Increased mouse wheel scroll sensitivity and added visible scrollbars to both side panels.

修复

  • TMPro 空引用修复: 解决了在处理如 SpellCustomizer/YapLocalizer 等大型 MOD 时,裁剪逻辑触发的 NullReferenceException 报错。
  • 输入框崩溃修复: 修复了在保存特定配置后点击空字符串输入框导致的游戏闪退问题。
  • 配置保存优化: 改进了 ApplyAllChanges 逻辑,确保所有修改都能正确写入到各自的配置文件中。
  • 滚动体验优化: 提升了鼠标滚轮的灵敏度,并为左右面板都增加了可见的滚动条。

[1.0.2] - 2026-02-08

Fixed

  • UI Visibility: Implemented logic to ensure the MOD config button is only visible and available for MOD configuration entry operation in the Lobby, and is prohibited from being displayed in-game to avoid disrupting normal game operations.
  • Transition Logic: Fixed button persistence issues during game start transitions.

修复

  • 显示逻辑修复: 确保 MOD 配置按钮仅在大厅显示和配置 MOD 条目使用!禁止在游戏内显示,避免扰乱游戏的正常操作等行为!
  • 切换逻辑优化: 修复了点击开始游戏进入游戏过程中按钮残留的问题。

[1.0.1] - 2026-02-08

  • Initial release of the ModConfigManager.
  • ModConfigManager 初始版本发布。