模组简介
CYLib —— 模组配置平台 v0.1.4 《杀戮尖塔 2》的 模组配置平台 :在游戏主界面(模式 / 时间线 / 百科 那排按钮处)提供「模组配置」入口。 各模组通过 CYLib 的 API 注册自己的配置页,由 CYLib 统一提供界面、持久化、默认值重置与变更通知 ——各模组不必自己写 UI、自己管存档。 玩家会看到什么 • 两个入口 :主菜单的「模组配置」按钮 + 设置 → 游戏设置里的「模组配置」行 • 与 BaseLib / RitsuLib 共存 :装了它们时走统一入口(重复入口会被隐藏),在 CYLib 界面底部可以一键跳转到它们自己的配置菜单,内容不丢 • 配置界面 :左栏模组列表、右栏设置项,小节可折叠;支持开关 / 整数滑条 / 整数输入框 / 小数输入框 / 文本 / 下拉 / 热键录入 / 动作按钮 / 说明行与动态信息行 • 自动保存 :改动 0.5 秒防抖落盘,关闭界面与退出游戏时强制保存;每模组一个 JSON,原子写 + 损坏自动备份 + 未知键保留 • 重置为默认 :每个设置项都能一键「重置为默认」(带确认弹窗) 给模组作者:接入只要两步 ① 在自己的清单里声明依赖(保证 CYLib 先加载): "dependencies": [{ "id": "CYLib", "min_version": "v0.1.3" }] ② 初始化时注册一个配置页: CYLibConfig.Register( new ConfigPageBuilder("MyMod", "我的模组") .Section("常规", s => s .Toggle("enable_x", "启用 X", defaultValue: true, onChanged: v => MyMod.EnableX = v) .IntSlider("power", "强度", min: 1, max: 10, defaultValue: 3) .FloatInput("rate", "成长系数(千分比)", defaultValue: 1.0))); 提供 builder 式声明、类型化取值、Set 写值、ValueChanged 事件与惰性本地化文本; 支持条件显隐、条件置灰、「需要重启生效」标注。 v0.1.4 新增 : • 动态行文案 ——设置项自己的标题 / 说明也能传解析器,随配置变动自动重新求值,每行可以直接显示自己的当前状态 • RestartNote ——标了「需要重启生效」的项,可以再写一行说明 为什么 要重启(支持动态文本) • 动态信息行( Info(...) / InfoTitle(...) )的求值链更稳,值一变就刷新 安装 • 订阅本模组( 无前置依赖 ),在 设置 → 模组设置 里确认已启用,然后 完全重启游戏 • 游戏版本需 v0.111.0 及以上 • 配置文件在游戏 user:// 目录的 mod_configs\ .json (配置页「存储」小节里有「打开配置目录」按钮) 配合使用的模组 • 愈深愈肉 —— Deeper and Tankier (成长系数直接在配置页里调) • 更好的进阶难度 —— CY's BetterAscension (进阶 11 ~ 20 每一阶单独开关) 版本与许可 v0.1.4 | 源码采用 MIT 许可证 。 English A configuration platform for Slay the Spire 2 mods: it adds a "Mod Config" entry to the main menu (next to Mode / Timeline / Compendium). Mods register their own config page through the CYLib API, and CYLib provides the UI, persistence, default-value reset and change notifications for them —— so a mod does not have to write its own screen or manage its own save file. What players get • Two entry points : a "Mod Config" button on the main menu, plus a "Mod Config" row in Settings → Game Settings • Works alongside BaseLib / RitsuLib : when they are installed CYLib uses a unified entry (their duplicate entries are hidden) and its screen has a one-click jump to their own config menus; nothing is lost • Config screen : mod list on the left, settings on the right, collapsible sections; toggles / int sliders / number inputs / decimal inputs / text / dropdowns / hotkey capture / action buttons / info rows and dynamic info rows • Auto-save : changes are debounced 0.5 s and written to disk; closing the screen or quitting the game forces a save. One JSON per mod, atomic write, auto backup on corruption, unknown keys preserved • Reset to default : one click per setting (with a confirmation dialog) For mod authors: two steps 1) Declare the dependency in your manifest (so CYLib loads first): "dependencies": [{ "id": "CYLib", "min_version": "v0.1.3" }] 2) Register a config page during initialization: CYLibConfig.Register( new ConfigPageBuilder("MyMod", "My Mod") .Section("General", s => s .Toggle("enable_x", "Enable X", defaultValue: true, onChanged: v => MyMod.EnableX = v) .IntSlider("power", "Strength", min: 1, max: 10, defaultValue: 3) .FloatInput("rate", "Growth rate (per mille)", defaultValue: 1.0))); The API offers builder-style declarations, typed getters, Set, a ValueChanged event and lazy localized text; rows support conditional visibility, conditional disabling and a "requires restart" marker. New in v0.1.4 : • Dynamic row text —— a setting's own label / description can take a resolver and is re-evaluated whenever config changes, so a row can show its own current state • RestartNote —— items marked "requires restart" can carry one extra line explaining why a restart is needed (dynamic text supported) • The dynamic info row chain ( Info(...) / InfoTitle(...) ) is more robust: it refreshes on every value change Install • Subscribe (there are no dependencies at all ), make sure it is enabled in Settings → Mod Settings, then fully restart the game • Requires game version v0.111.0 or newer • Config files live in the game user:// directory: mod_configs\ .json (there is an "Open config folder" button in the Storage section) Mods using CYLib • Deeper and Tankier (its growth rate can be tuned right in the config screen) • CY's BetterAscension (each of Ascension 11 ~ 20 can be toggled on or off individually) Version and license v0.1.4 | Source code is MIT licensed .
详情图片
条目信息
- 所属游戏
- 杀戮尖塔 2 (Slay the Spire 2)
- 创意工坊 ID
- 3812834784
- 文件名
- 3812834784.bin
- 文件大小
- 144.2 KB
- 最后更新
- 2026/10/08
- 内容版本
- v1791392980-8899be56f38275ac
- 作者与来源
- 由原作者发布于 Steam 创意工坊。本站不改变署名,作者信息与原始内容请以 Steam 原始页面 为准。
