皮皮配置: ModConfig

If you liked this item, please rate it up on Steam Workshop page.

Author: 皮一下就很凡

Last revision: 19 Jun at 04:02 UTC

File size: 382.11 KB

On Steam Workshop

Description:
ModConfig — 通用模组配置框架

已适配正式版 v0.107.1 最新版 / Compatible with the latest public release v0.107.1
Universal in-game configuration framework for Slay the Spire 2 mods.


简介 / Overview

为《杀戮尖塔2》模组提供统一的游戏内配置界面。

ModConfig 会在游戏「设置」页面中添加一个 模组配置 / Mods 标签页。其他模组只需通过简单 API 注册配置项,即可自动生成设置控件,不需要每个模组重复开发自己的设置界面。

ModConfig adds a shared Mods tab to the game’s Settings screen. Other mods can register their options through a simple API, and ModConfig will automatically render the corresponding controls.


支持控件 / Supported Controls

  • 开关 / Toggle — 布尔值开 / 关。Boolean on-off values.
  • 滑条 / Slider — 数值范围调节,支持自定义步进和显示格式。Numeric ranges with custom step and display format.
  • 下拉框 / Dropdown — 多个选项之间切换。Select from multiple options.
  • 快捷键绑定 / KeyBind — 点击后录入按键,支持所有键盘按键。Click-to-record keyboard shortcuts.
  • 文本输入 / TextInput — 自由文本输入。Free-form text input.
  • 分组标题和分隔线 / Headers & Separators — 整理复杂设置面板,保持界面清晰。Organize complex settings pages cleanly.


核心特性 / Features

  • 零依赖接入 / Optional integration
    其他模组可通过反射调用 API,无需直接引用 ModConfig DLL;即使玩家没有安装 ModConfig,模组本体也可以照常运行。
    Mods can call the API through reflection without directly referencing the ModConfig DLL. If ModConfig is not installed, integrated mods can still run normally.
  • 自动持久化 / Automatic persistence
    配置值自动保存到本地文件,下次启动自动恢复。
    Config values are saved locally and restored on the next launch.
  • 多语言支持 / Localization-ready
    控件标签支持 i18n,可跟随游戏语言切换。
    Control labels support i18n and can follow the game’s language setting.
  • 全平台兼容 / Cross-platform
    Windows / macOS 均可使用。
    Works on both Windows and macOS.


面向模组开发者 / For Mod Developers

接入只需要一次注册调用:

Register(modName, configEntries)

传入模组名和配置项列表即可;配置变更会通过回调函数实时通知。详见源码中的 ModConfigApi.cs

To integrate, call Register(modName, configEntries) once with your mod name and config entry list. Value changes are delivered through callbacks. See ModConfigApi.cs in the source code for details.

当前已适配 / Currently Integrated
  • Skada: Damage Meter(战斗数据统计)
    缩放、透明度、最大条数、自动重置、自动切换视图等配置。
    Scaling, opacity, maximum bars, auto reset, automatic view switching, and more.


作者与源码 / Author & Source

作者 / Author
皮一下就很凡@Bilibili[space.bilibili.com]

开源代码 / Source Code
https://github.com/xhyrzldf/ModConfig-STS2


皮皮模组系列 / PPDEV Mod Series

喜欢这个模组的话,也可以看看同作者的其他《杀戮尖塔2》模组:
If you like this mod, check out the other Slay the Spire 2 mods from the same author: