Add content source inspection#44
Conversation
… enhancing UI information
|
另外{DisplayName} ({Id})似乎有点冗余了,可以考虑两者相等时只展示一个 |
|
Warning 此分析由 AI 自动生成,仅供开发者参考,最终判断请以人工确认为准。如有疑问建议结合本地环境进一步复现确认。 摘要该 PR 为 RitsuLib 框架新增了内容来源悬停提示功能——在卡牌、遗物、药水等内容的悬停说明前追加一行标注「来自哪个 Mod」的紫色提示文字。代码规模适中(6 文件,+135/−56),架构清晰:工厂类负责来源解析与缓存,三个 Harmony patch 分别处理关键字、模型属性以及 InspectScreen 的悬停集合,提供 重点结论
展开详细审阅、证据与验证变更概要
行为变更范围: 用户可见——在游戏内的 HoverTip 悬停提示中添加 mod 来源信息行。内部实现了来源解析工厂、三个 Harmony 补丁、设置开关以及双语本地化。 PR 说明与代码对照PR 正文列出 4 项变更点,全部在 diff 中体现:
PR 备注中提到的两个已知限制:
详细代码审阅ContentSourceHoverTipFactory.cs (新增)
IContentSourceSupplier.cs (新增)
ContentSourceHoverTipPatches.cs (新增,3 个 patch)
双重注入分析:
RitsuLibFramework.PatcherSetup.cs (修改)
本地化 (修改)
提交与范围规范性标题「Add content source inspection」与变更内容匹配。6 个文件的变更范围聚焦于同一功能点,无明显无关改动或范围膨胀。变更量(+135/−56)与新增完整功能相符,无异常大块变更。无需拆分。 详细验证建议
合并与回滚风险
English translationSummaryThis PR adds a content source hover tip feature to the RitsuLib framework — injecting a purple "which mod is this from?" line before existing hover tip descriptions for cards, relics, potions, and more. The change is well-scoped (6 files, +135/−56), with a clean architecture: a factory class handles source resolution and caching, three Harmony patches cover keywords, model property getters, and InspectScreen hover tip collections respectively, and an Key Takeaways
Expand detailed analysis, evidence, and verificationChange Summary
Behavioral scope: User-visible — adds a mod source info line to in-game hover tips. Internally implements a source resolution factory, three Harmony patches, settings toggle, and bilingual localization. PR Description vs. CodeThe PR body lists 4 change items, all accounted for in the diff:
Known limitations stated in the PR:
Detailed Code ReviewContentSourceHoverTipFactory.cs (new)
IContentSourceSupplier.cs (new)
ContentSourceHoverTipPatches.cs (new, 3 patches)
Dual injection analysis:
RitsuLibFramework.PatcherSetup.cs (modified)
Localization (modified)
Commit & Scope ComplianceTitle "Add content source inspection" matches the change scope. All 6 files are tightly focused on a single feature, with no unrelated changes or scope creep. The change volume (+135/−56) is proportionate to adding a complete new feature. No splitting needed. Verification Checklist
Merge & Rollback Risk
工具侧记录
|
Summary / 概要
IContentSourceSupplier以实现自定义模组来源显示(例如联动的模组卡牌)Why / 背景与动机
What changed / 变更点
Notes / 备注
WithTooltip未添加来源显示。IContentSourceSupplier只提供了string类型并且已被颜色bbcode包裹。也许可以提供更好的接口。