Skip to content

Commit b2ea7ca

Browse files
committed
chore(release): merge dev into main for v0.5.20
2 parents 2979dd3 + 8f68bf0 commit b2ea7ca

34 files changed

Lines changed: 1880 additions & 282 deletions

‎.github/ISSUE_TEMPLATE/bug-report.en.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ body:
6969
id: logs
7070
attributes:
7171
label: Logs / stack trace
72-
description: Paste relevant logs. If available, include `%AppData%\SlayTheSpire2\logs\godot.log`.
72+
description: |-
73+
Paste relevant logs. Runtime logs live at logs/godot.log under the game's user data directory:
74+
Windows: %AppData%\SlayTheSpire2\logs\godot.log
75+
macOS: ~/Library/Application Support/SlayTheSpire2/logs/godot.log
76+
Linux: ~/.local/share/SlayTheSpire2/logs/godot.log
7377
render: shell
7478
validations:
7579
required: false

‎.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ body:
99
value: |
1010
感谢反馈问题。
1111
12-
请尽量提供日志与最小复现步骤;若与 STS2 API 变更相关,请附带游戏版本/构建号。
12+
请尽量提供日志与最小复现步骤;如果与 STS2 API 变更有关,请附上游戏版本/构建号。
1313
- type: dropdown
1414
id: area
1515
attributes:
@@ -52,7 +52,7 @@ body:
5252
id: repro
5353
attributes:
5454
label: 复现步骤
55-
description: 以“最小复现”为目标。
55+
description: 给出能复现问题的最简步骤。
5656
placeholder: |
5757
1. ...
5858
2. ...
@@ -69,7 +69,11 @@ body:
6969
id: logs
7070
attributes:
7171
label: 日志 / 堆栈
72-
description: 粘贴相关日志。若可用,请附 `%AppData%\SlayTheSpire2\logs\godot.log` 片段。
72+
description: |-
73+
粘贴相关日志。运行时日志位于游戏用户数据目录下的 logs/godot.log:
74+
Windows:%AppData%\SlayTheSpire2\logs\godot.log
75+
macOS:~/Library/Application Support/SlayTheSpire2/logs/godot.log
76+
Linux:~/.local/share/SlayTheSpire2/logs/godot.log
7377
render: shell
7478
validations:
7579
required: false

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: Documentation / 文档
4-
url: https://github.com/BAKAOLC/sts-2-opencode
5-
about: Project entrypoint (update if you have a dedicated docs site).
4+
url: https://sts2-ritsulib.ritsukage.com/
5+
about: RitsuLib documentation site / RitsuLib 文档站。
66
- name: Discussions / 讨论区
77
url: https://github.com/BAKAOLC/sts-2-opencode/discussions
88
about: Ask questions or propose ideas.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
-
99

1010
## Test plan / 测试计划
11-
- [ ] Build passes
12-
- [ ] Basic runtime smoke test (if applicable)
11+
- [ ] Build passes / 构建通过
12+
- [ ] Basic runtime smoke test (if applicable) / 基本运行时冒烟测试(如适用)
1313

1414
## Notes / 备注
1515
-

‎CONTRIBUTING.md‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Contributing to RitsuLib
2+
3+
[中文](CONTRIBUTING.zh.md)
4+
5+
Bug reports, fixes, reusable APIs, documentation, and translations are all welcome. Keep each contribution focused on
6+
a single clear problem or use case.
7+
8+
## Issues and feature requests
9+
10+
Search existing issues first, then use the repository's issue templates. For bugs, include the game and RitsuLib versions, relevant mods, reproduction steps, expected behavior, and logs.
11+
Runtime logs are in `logs/godot.log` under the game's user data directory:
12+
13+
- Windows: `%AppData%\SlayTheSpire2\logs\godot.log`
14+
- macOS: `~/Library/Application Support/SlayTheSpire2/logs/godot.log`
15+
- Linux: `~/.local/share/SlayTheSpire2/logs/godot.log`
16+
17+
Remove sensitive information before sharing them.
18+
19+
Before adding an API or making substantial changes, describe the consuming mod's needs and discuss the proposed
20+
behavior with maintainers.
21+
22+
## Development setup
23+
24+
You'll need:
25+
26+
- a .NET SDK supporting `net9.0`;
27+
- Node.js and npm, for the bundled log viewer;
28+
- game assemblies matching the API target.
29+
30+
Open `STS2-RitsuLib.sln` in Rider (or Visual Studio with ReSharper) to use the repository's formatting and
31+
inspections.
32+
33+
The project finds local game installations automatically. To point it at specific paths, create a `local.props` based
34+
on [local.props.template](local.props.template):
35+
36+
- `Sts2Dir`: game installation directory for local testing.
37+
- `Sts2ApiSignatureRoot`: optional root for versioned API signatures. Each `<root>/<Sts2ApiCompat>/` folder must contain
38+
`sts2.dll`, `0Harmony.dll`, and `SmartFormat.dll`. Omit this property to reference the installed game.
39+
40+
Close the game, then run the following from the repository root:
41+
42+
```powershell
43+
dotnet build STS2-RitsuLib.sln
44+
```
45+
46+
The default build generates the manifest, builds the viewer, and installs RitsuLib into
47+
`<Sts2Dir>/mods/STS2-RitsuLib/`, replacing an existing variant pack with the local single-API build. RitsuLib is a
48+
DLL-only mod and does not require PCK export.
49+
50+
## Code and API design
51+
52+
Follow [.editorconfig](.editorconfig) and the surrounding code. Keep identifiers and implementation comments in
53+
English, and use localization for translated UI text. Implement game behavior through mod-owned code, patches, and
54+
resources; treat game files and recovered source as read-only references.
55+
56+
Public and protected APIs are long-term compatibility commitments. Add APIs for concrete consumer needs and preserve
57+
existing source and binary compatibility. Provide English and Chinese XML documentation covering usage, inputs,
58+
outputs, and any lifecycle or ownership requirements.
59+
60+
Validate inputs and define failure behavior. For shared APIs, account for multiple mods, repeated calls, and resource
61+
lifetime. Make registration conflicts and callback ordering explicit.
62+
63+
## Validation
64+
65+
Format changed C# files with the repository-configured ReSharper formatter and resolve all inspection findings.
66+
Verify the build, verify the affected behavior in the game, and check the logs. For public API changes, also build and
67+
test a consuming mod. Bug fixes should cover the original reproduction and relevant edge cases.
68+
69+
Changes affecting game API compatibility or package/manifest generation require sequential builds of all
70+
`RitsuLibCompatTargets` declared in [STS2-RitsuLib.csproj](STS2-RitsuLib.csproj). Select each target with
71+
`/p:Sts2ApiCompat=<version>` and provide matching reference assemblies. Only the latest API target installs into the
72+
game directory.
73+
74+
For documentation changes, check links, examples, and consistency between languages. For documentation-site changes,
75+
use the tool versions in [docs/package.json](docs/package.json) and [the docs workflow](.github/workflows/gh-pages.yml),
76+
then run from `docs/`:
77+
78+
```powershell
79+
pnpm install --frozen-lockfile
80+
pnpm build
81+
```
82+
83+
Preview the affected pages to check layout and navigation.
84+
85+
## Pull requests
86+
87+
Prefer `dev` as the PR merge target (base branch), unless maintainers specify another target.
88+
89+
Use [the PR template](.github/PULL_REQUEST_TEMPLATE.md) to explain the problem, the resulting behavior, and validation.
90+
Include examples or screenshots where they help reviewers. State which game/API versions were tested and be honest
91+
about checks you haven't finished.
92+
93+
Keep changes focused and update the corresponding English and Chinese documentation together. Leave local
94+
configuration, game binaries, and generated output out of the diff. Coordinate version and release metadata changes
95+
with maintainers.

‎CONTRIBUTING.zh.md‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# 参与 RitsuLib 开发
2+
3+
[English](CONTRIBUTING.md)
4+
5+
欢迎提 issue、修 bug、贡献可复用的 API、文档和翻译。每次贡献聚焦于一个明确的问题或使用场景。
6+
7+
## 问题反馈与功能建议
8+
9+
先搜索已有的 issue,再按仓库的 issue 模板提交。Bug 报告请带上:游戏和 RitsuLib 的版本、相关 Mod、复现步骤、预期行为、日志。运行时日志在游戏用户数据目录下的 `logs/godot.log`:
10+
11+
- Windows:`%AppData%\SlayTheSpire2\logs\godot.log`
12+
- macOS:`~/Library/Application Support/SlayTheSpire2/logs/godot.log`
13+
- Linux:`~/.local/share/SlayTheSpire2/logs/godot.log`
14+
15+
分享前把敏感信息删掉。
16+
17+
新增 API 或做较大调整时,先说明使用方 Mod 的实际需求,并与维护者讨论预期行为。
18+
19+
## 开发环境
20+
21+
需要准备:
22+
23+
- 支持 `net9.0` 的 .NET SDK;
24+
- Node.js 和 npm(内置日志查看器要用);
25+
- 与目标 API 匹配的游戏程序集。
26+
27+
用 Rider(或带 ReSharper 的 Visual Studio)打开 `STS2-RitsuLib.sln`,即可使用仓库配置的格式化与检查。
28+
29+
项目会自动定位本地游戏安装。需要手动指定路径时,参照 [local.props.template](local.props.template) 创建 `local.props`:
30+
31+
- `Sts2Dir`:本地测试用的游戏安装目录。
32+
- `Sts2ApiSignatureRoot`(可选):版本化 API signature 的根目录。每个 `<root>/<Sts2ApiCompat>/` 目录需包含 `sts2.dll`、`0Harmony.dll` 和 `SmartFormat.dll`;不设置此属性时引用已安装游戏的程序集。
33+
34+
先关闭游戏,然后在仓库根目录执行:
35+
36+
```powershell
37+
dotnet build STS2-RitsuLib.sln
38+
```
39+
40+
默认构建会生成 manifest 和构建查看器,并把 RitsuLib 安装到 `<Sts2Dir>/mods/STS2-RitsuLib/`。如果那里已装过变体包,会被本地单 API 构建替换。RitsuLib 是 DLL-only Mod,无需导出 PCK。
41+
42+
## 代码与 API 设计
43+
44+
遵守 [.editorconfig](.editorconfig),与相邻代码保持风格一致。标识符和实现注释用英文;需要翻译的界面文本放到本地化系统里。游戏行为通过 Mod 自己的代码、补丁和资源实现;游戏文件与恢复源码仅作只读参考。
45+
46+
public 和 protected API 是长期的兼容承诺:新增 API 要对应使用方 Mod 的实际需求,且不能破坏现有源码与二进制兼容性。提供中英文 XML 文档,说明用法、输入、输出,以及生命周期和所有权方面的要求。
47+
48+
对输入做校验,失败时的行为要写清楚。共享 API 要考虑多 Mod 并存、重复调用和资源生命周期;注册冲突如何处理、回调按什么顺序触发,都要明确说明。
49+
50+
## 验证
51+
52+
改过的 C# 文件用仓库配置的 ReSharper 格式化,并把检查报出的问题全部解决。确认构建通过,在游戏里实际验证受影响的行为,并检查日志。修改公共 API 时,还要构建并测试使用方 Mod;Bug 修复应覆盖原始复现步骤和相关的边界情况。
53+
54+
改动涉及游戏 API 兼容性或打包/manifest 生成时,把 [STS2-RitsuLib.csproj](STS2-RitsuLib.csproj) 中 `RitsuLibCompatTargets` 声明的全部目标逐个构建一遍:用 `/p:Sts2ApiCompat=<version>` 选择目标,准备匹配的引用程序集。只有最新 API 目标会安装到游戏目录。
55+
56+
改文档要检查链接、示例,以及中英文是否一致。改文档站时,工具版本以 [docs/package.json](docs/package.json) 和 [文档工作流](.github/workflows/gh-pages.yml) 中的为准,然后在 `docs/` 目录执行:
57+
58+
```powershell
59+
pnpm install --frozen-lockfile
60+
pnpm build
61+
```
62+
63+
预览改过的页面,检查排版和导航。
64+
65+
## Pull Request
66+
67+
PR 的合并目标(base 分支)应优先选择 `dev`,除非维护者明确指定其他目标分支。
68+
69+
按 [PR 模板](.github/PULL_REQUEST_TEMPLATE.md) 说明解决了什么问题、修改后的行为和验证结果;对评审有帮助的示例或截图也一并附上。写明在哪些游戏/API 版本上测试过,没完成的检查如实说明。
70+
71+
保持改动聚焦,中英文文档同步更新。本地配置、游戏二进制文件和生成产物不要提交进仓库。版本与发布元数据的调整请先与维护者协调。

‎README.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ RitsuLib's own docs are concise feature references. For a broader Chinese walkth
126126

127127
[SlayTheSpire2 Modding Tutorials](https://glitchedreme.github.io/SlayTheSpire2ModdingTutorials/index.html)
128128

129-
Original repository for this
130-
tutorial: [GlitchedReme/SlayTheSpire2ModdingTutorials](https://github.com/GlitchedReme/SlayTheSpire2ModdingTutorials)
131-
132129
## Related Libraries
133130

134131
For minion, summon, companion-card, or guardian-style mechanics, prefer
@@ -152,9 +149,8 @@ current RitsuLib capabilities or that all analyzer behavior is correct.
152149

153150
## Contributing
154151

155-
Use [local.props.template](local.props.template) to point the project at a Slay the Spire 2 install or API signature
156-
folder. RitsuLib is a DLL-only mod (`has_pck: false`), so normal validation is a DLL build for each declared
157-
compatibility target.
152+
See the [contribution guide](CONTRIBUTING.md) for development setup, code and public API conventions, validation,
153+
and pull request preparation.
158154

159155
## Acknowledgements
160156

‎README.zh.md‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
[Release](https://github.com/BAKAOLC/STS2-RitsuLib/releases) |
1212
[English README](README.md)
1313

14-
RitsuLib 为 Mod 作者提供一层稳定 API,用来处理内容注册、生命周期、Harmony 补丁、持久化、设置界面、本地化、音频、运行时 UI、诊断和兼容辅助。它不替代游戏原生 API,也不要求放弃
15-
[BaseLib](https://github.com/Alchyr/BaseLib-StS2);它更像一套把常见 Mod 编写流程整理好的工程工具层。
14+
RitsuLib 为 Mod 作者提供一层稳定的 API,用来处理内容注册、生命周期、Harmony 补丁、持久化、设置界面、本地化、音频、运行时 UI、诊断和兼容辅助。它与游戏原生 API、
15+
[BaseLib](https://github.com/Alchyr/BaseLib-StS2) 等库并存,不替代它们。
1616

1717
## 覆盖范围
1818

@@ -65,15 +65,15 @@ flowchart LR
6565
}
6666
```
6767

68-
如果项目没有使用 Central Package Management,请让包管理器或 IDE 选择当前兼容的包版本,不要从 README 复制固定版本号。
68+
如果项目没有启用 Central Package Management(中央包管理),让包管理器或 IDE 自己选择当前兼容的包版本,不要从 README 里抄固定的版本号。
6969

7070
## 包选择
7171

7272
| 场景 | 编译期包 | 运行时安装 |
7373
| --- | --- | --- |
7474
| 当前最高支持的游戏 API,通常是游戏 beta 分支 | `STS2.RitsuLib` | GitHub Release 中的 `STS2-RitsuLib` |
7575
| 稳定分支或旧游戏 API 分支 | `STS2.RitsuLib.Compat.<api-version>` | 匹配的 release 资产或变体包 |
76-
| 玩家需要一个文件夹支持多个 API 分支 | 你的 Mod 仍只引用一个包 | `STS2-RitsuLib.<version>.variant-pack.zip` |
76+
| 玩家需要一个文件夹同时兼容多个 API 分支 | 你的 Mod 仍只引用一个包 | `STS2-RitsuLib.<version>.variant-pack.zip` |
7777

7878
变体包会安装一个 `mods/STS2-RitsuLib/` 文件夹。根目录的 `STS2-RitsuLib.dll` 是加载器,真正按 API 区分的构建位于
7979
`lib/<api-version>/`。这只影响玩家安装运行时 Mod 的方式,不改变你的编译期 NuGet 引用。
@@ -102,7 +102,7 @@ RitsuLibFramework.CreateContentPack("MyMod")
102102
.Apply();
103103
```
104104

105-
建议从[快速入门](https://sts2-ritsulib.ritsukage.com/guide/getting-started)开始,再按正在编写的功能阅读对应专题。
105+
建议从 [快速入门](https://sts2-ritsulib.ritsukage.com/guide/getting-started) 开始,再按正在编写的功能阅读对应专题。
106106

107107
## 文档
108108

@@ -116,12 +116,10 @@ RitsuLibFramework.CreateContentPack("MyMod")
116116
| Mod 设置 | https://sts2-ritsulib.ritsukage.com/guide/mod-settings |
117117
| 诊断与兼容 | https://sts2-ritsulib.ritsukage.com/guide/diagnostics-and-compatibility |
118118

119-
RitsuLib 自带文档偏向简明功能参考。更完整的中文《杀戮尖塔 2》模组制作流程请看:
119+
RitsuLib 自带文档偏重简明的功能参考。更完整的中文《杀戮尖塔 2》模组制作流程请看:
120120

121121
[SlayTheSpire2 Modding Tutorials](https://glitchedreme.github.io/SlayTheSpire2ModdingTutorials/index.html)
122122

123-
这个教程的原始仓库:[GlitchedReme/SlayTheSpire2ModdingTutorials](https://github.com/GlitchedReme/SlayTheSpire2ModdingTutorials)
124-
125123
## 相关库
126124

127125
如果 Mod 需要随从、召唤物、组件卡牌、守护等机制,推荐优先使用
@@ -138,15 +136,15 @@ RitsuLib 风格项目的推荐可选分析器是
138136
(包名:`Miooowo.STS2RitsuLib.ModAnalyzers`)。它提供 RitsuLib 本地化与资源路径相关的 Roslyn 诊断,并且包内
139137
`buildTransitive` 会自动把常见项目文件传给 analyzer。
140138

141-
该分析器由第三方提供、维护和支持;RitsuLib 不保证它与当前 RitsuLib 能力完全对齐,也不保证所有分析器行为都正确。
139+
该分析器由第三方提供、维护和支持;RitsuLib 不保证它与当前 RitsuLib 的能力完全对齐,也不保证分析器的所有行为都正确。
142140

143141
## 参与开发
144142

145-
使用 [local.props.template](local.props.template) 指向《杀戮尖塔 2》安装目录或 API signature 目录。RitsuLib 是 DLL-only Mod(`has_pck: false`),正常验证路径是为声明的兼容目标分别执行 DLL 构建。
143+
开发环境配置、代码与公共 API 约定、验证要求和 PR 准备流程见 [贡献指南](CONTRIBUTING.zh.md)。
146144

147145
## 致谢
148146

149-
感谢在开发过程中帮助 RitsuLib 的人们,以及所有使用者。完整名单见 [ACKNOWLEDGEMENTS.md](ACKNOWLEDGEMENTS.md)。
147+
感谢开发过程中提供过帮助的人们和所有使用者,完整名单见 [ACKNOWLEDGEMENTS.md](ACKNOWLEDGEMENTS.md)。
150148

151149
## 许可证
152150

‎STS2-RitsuLib.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<PropertyGroup Label="NuGet package">
4949
<IsPackable>true</IsPackable>
50-
<Version>0.5.19</Version>
50+
<Version>0.5.20</Version>
5151
<Authors>OLC</Authors>
5252
<Description>Shared framework library for Slay the Spire 2 mods.</Description>
5353
<PackageReadmeFile>README.md</PackageReadmeFile>

‎mod_manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "RitsuLib",
55
"author": "OLC",
66
"description": "A shared Slay the Spire 2 mod framework library providing reusable patching, persistence, lifecycle, localization, and utility APIs for other mods.",
7-
"version": "0.5.19",
7+
"version": "0.5.20",
88
"has_pck": false,
99
"has_dll": true,
1010
"affects_gameplay": false,

0 commit comments

Comments
 (0)