Skip to content

[Breaking Changes] RitsuLib 0.6.0: framework overhaul - #108

Draft
BAKAOLC wants to merge 13 commits into
devfrom
refactor/modular-runtime
Draft

[Breaking Changes] RitsuLib 0.6.0: framework overhaul#108
BAKAOLC wants to merge 13 commits into
devfrom
refactor/modular-runtime

Conversation

@BAKAOLC

@BAKAOLC BAKAOLC commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Warning

本次更新调整了运行时目录、程序集分布和资源打包方式。请安装完整包;手动引用 DLL、通过反射枚举程序集类型,或使用调整过的 UI API 的 Mod,需要检查并适配。

Summary / 概要

为 RitsuLib 0.6.0 重整模块与资源布局,让多个游戏兼容版本共用公共代码、通用 UI、设置和资源,减少重复打包。新增主题文件选择器、通用资源读取 API 和 Godot 引擎错误诊断采集,同时完善 BaseLib 互通、泛型互操作、自定义牌堆及角色动画兼容。

What changed / 变更点

  • 模块与加载器:公共代码、UI 和设置拆为 Shared、Ui、Settings 模块,放入 shared/;兼容入口和游戏集成放入 compat/<API版本>/。根 DLL 根据游戏版本加载对应模块组合。
  • 通用 UI:UI 模块不依赖 Settings,开放折叠区域、操作菜单、滑块、拖动手柄、布局容器、控件工厂和主题布局值,并补充中英文 API 文档。
  • 文件选择器:新增 RitsuFileDialog,替换设置中的原生文件弹窗,支持文件、文件夹、多选和保存模式,使用库内控件及主题,支持手柄、触屏、悬停提示和嵌套弹窗。收藏夹、最近目录、显示偏好和上次目录可跨重启保存;文件夹模式只显示目录,文件模式按所选类型筛选。缩略图优先使用系统能力,图像解码作为回退。
  • 资源外置:图像、多语言和内置主题移至 assets/。Debug 部署散装目录,Release、NuGet 和多版本 Bundle 使用共用的 assets.zip
  • 资源 API:新增 ResourcePack,支持任意 ZIP 或目录的字节读取、文本读取和文件枚举,复用 ZIP 句柄并支持显式释放;新增 I18N.FromResourcePack
  • 引擎错误诊断:采集缺失节点、资源加载失败等未抛出 C# 异常的 Godot 引擎错误,遵循诊断授权和申请方过滤。保留错误位置、可用堆栈及资源和节点路径,对本机绝对路径脱敏,并限制重复或过量上报。
  • 日志控制:移除游戏日志镜像开关,游戏日志始终进入本地日志缓冲区并可用于多人状态不同步诊断;日志查看器和遥测上传分别控制。
  • 构建与分发:改用标准 .NET Debug/Release 配置,移除 Godot 项目和导出流水线;按配置及兼容目标隔离产物,统一单版本构建、NuGet、Bundle、CI 和发布脚本的完整安装布局,并提供单独打包资源的命令。
  • 角色动画兼容:修复自定义角色的专属动作被默认攻击覆盖或重复播放的问题,并改善商人动画兼容性。
  • 自定义牌堆:修复快捷键绑定与清理、牌堆升级预览的显示及点击区域、排序控件布局和初始排序状态;牌堆与额外手牌遵循一致的可见性和打开条件,查看卡牌时阻止底层控件误响应。
  • BaseLib 设置与血条:设置镜像遵循分组的默认折叠状态。血条预测支持从当前生命值向外延伸,以及从最大生命值向内覆盖;支持与 BaseLib 互通,并在旧版 BaseLib 下使用本库渲染,避免重复绘制。
  • 泛型互操作:新增 InteropTargetAttribute.GenericTypes,通过具体类型的非泛型存根绑定封闭泛型目标类型和方法;新增 InteropIgnoreAttribute 排除辅助成员,修复属性访问器重复绑定及忽略标注失效。
  • 卡图与类型发现:卡图覆盖在完整或局部刷新、布局切换及节点复用时保持一致,移除覆盖后恢复当前外观,并保留 Beta 卡图预加载。缓存模组类型发现结果,减少重复扫描、分配和不必要的兼容桥接。
  • 主菜单:长菜单采用插值滚动和边缘缩放、淡出效果;修复滚动边界与焦点可达性,悬停目标变化时及时更新边缘缩放。

Test plan / 测试计划

  • 四个兼容目标构建通过:0.111.0、0.110.0、0.109.0、0.107.1。
  • 修改的 C# 文件完成格式化、Rider 和 InspectCode 检查,最终零诊断。
  • CI 打包验证通过,完整 Release Bundle 已安装到游戏目录并验证加载。
  • 验证散装与 ZIP 资源加载、资源 API、异常行为及 NuGet 部署。
  • 游戏内验证文件选择器的样式、筛选、持久化、手柄、触屏、弹窗层级、悬停提示及 Windows 缩略图。
  • 使用真实引擎错误验证遥测采集、授权过滤、路径脱敏、去重限流及递归保护。
  • 针对性验证自定义牌堆的快捷键、升级预览、排序和输入隔离。
  • 针对性验证设置默认折叠、泛型互操作、成员排除及血条预测显示。
  • 在引擎中针对性验证角色动画兼容、连续命中、受击动画和 RitsuLib 自定义形象播放;动画修复通过当前默认目标的正常构建和安装。

Notes / 备注

  • 玩家安装:请安装完整运行时目录,保留 shared/compat/、模块清单和资源包,不能只替换根 DLL。
  • 手动引用:使用安装目录中的 RitsuLib.References.props 导入所需程序集。单版本目录会自动选择唯一目标;引用多版本 Bundle 时需设置 RitsuLibReferenceTarget。单独引用 compat/ 中的兼容入口 DLL 不足以提供全部编译依赖。
  • 程序集与资源迁移:按单个程序集枚举类型的代码需适应模块分布;直接读取原 DLL 内嵌图像、翻译或主题的代码需改用新的资源来源。
  • 替换资源:散装 assets/ 目录整体优先于 assets.zip。切换到 ZIP 部署时需移除旧散装目录;替换已打开的 ZIP 前应释放对应 ResourcePack,游戏安装包应在关闭游戏后替换。
  • 缩略图与堆栈:缩略图格式取决于操作系统及已安装组件;引擎错误的脚本堆栈可能为空。

BAKAOLC and others added 5 commits September 9, 2026 14:28
Split common services, reusable UI and settings into shared assemblies while keeping game integration in per-version runtimes. Load and register complete module sets, validate their manifests and hashes, and preserve existing public types through compatibility forwarding.

Expose reusable collapsible sections, action menus, sliders, drag handles, layout containers, control factories and theme layout values with bilingual API documentation.

Replace the Godot build and export pipeline with standard .NET Debug and Release configurations. Isolate outputs by configuration and game API version, and update local builds, deployment, NuGet packaging, bundles, CI and release scripts together.

Provide a single MSBuild import for local assembly references and document the complete runtime directory layout and assembly-enumeration migration requirements. Apply repository formatting and resolve the resulting code inspections.
Add ResourcePack for reading arbitrary ZIP files and directories by relative path, with lazy ZIP handle reuse, serialized reads and explicit disposal. Integrate resource packs with I18N through a public factory and document ownership and failure behavior.

Move bundled images, translations and themes out of assemblies into a shared asset tree. Deploy loose resources for Debug and assets.zip for Release, NuGet and compatibility bundles while preserving existing image paths and localization entry points.

Add resource-only packaging and update deployment targets and contributor documentation. Validate formatting and inspections, all four compatibility targets, package deployment and resource loading in the game.
Replace settings file dialogs with reusable file, folder, multi-file and save pickers using library controls. Preserve navigation, favorites, recent folders, filters, sorting, grid and list views, folder creation and overwrite confirmation. Hide files in directory-selection mode.

Apply shared scrollbar, tooltip, input-menu, hover and focus styles, with themed split grips and localized control hints. Add controller navigation, touch scrolling and selection, input-specific hints, modal input isolation and focus restoration across nested dialogs. Persist favorites, recent folders, display preferences and per-purpose starting directories locally.

Load thumbnails through Windows Shell, macOS Quick Look and available Linux desktop services, with bounded background work, image-decoding fallback and an in-memory cache. Add localized labels, icons and bilingual public API documentation.

Validate formatting and both inspection paths, all four compatibility builds and full bundle packaging. Exercise file selection, filtering, theme refresh, visible tooltips, save paths, persistence, controller and touch input, nested dialogs, ownership and Windows thumbnails in the game.
Forward errors from the existing Godot logger into authorized diagnostics requests, retaining engine locations and available script backtraces without synthesizing exceptions. Preserve resource and node paths while redacting local absolute paths.

Apply applicant filters, bounded queues and fields, recent-error deduplication, rate limits and recursion protection. Keep capture callbacks lightweight and queue errors without waiting for network delivery.

Remove the game-log mirroring switch so local and multiplayer desynchronization diagnostics share the same log buffer independently of the viewer. Update consent descriptions and document the engine-error filter context.

Validate both inspection paths, all four compatibility targets and complete bundle packaging. Exercise actual engine failures, consent changes, filters, path redaction, concurrent errors, slow HTTP delivery and shutdown in the game.
@BAKAOLC BAKAOLC changed the title [Breaking Changes] RitsuLib 0.6.0: modular runtime, reusable UI, and resource packs [Breaking Changes] RitsuLib 0.6.0: modular runtime, file pickers, resource packs and engine diagnostics Sep 9, 2026
GlitchedReme and others added 8 commits September 9, 2026 20:59
Engage scrolling only after a height tolerance, snap steps from the
actual scroll position, and ease edge scale so top and bottom entries
stay reachable.
Reapply edge scaling for the previous and new reticle targets on
ShowReticles, HideReticles, and HideDecorations so buttons in the edge
zone no longer stay shrunk or full-sized until the next scroll.
Unify full, incremental and overlay refreshes so card textures, materials and layout overrides apply consistently. Restore current model resources when overrides are removed, preserve third-party replacements and clear state before pooled views are reused.

Coalesce runtime refreshes on later frames, preserve unrestricted requests when filters are added, and handle reentrant requests and nodes removed by predicates. Retain card Beta portrait preloads when character overrides replace only the main portrait.

Preserve public API signatures. Validate formatting, both inspection paths, all four compatibility targets and complete bundle packaging, with 542 engine checks passing in both Debug and Release.
Use native multi-assembly discovery when module association succeeds, retaining the cached reflection bridge for older hosts and association failures. Reuse complete static assembly scans and merged type arrays while retrying partial loads and rescanning dynamic assemblies.

Keep lifecycle snapshots when assembly membership is unchanged, and invalidate them when assemblies change or contain dynamically generated types.

Validate both inspection paths, all four compatibility targets and complete bundle packaging. Pass 24 runtime checks in Debug and Release; warmed native and fallback reads allocate no managed memory.
Bind pile input actions to visible controls, suspend opening beneath blocking screens, and remove owned bindings on exit. Apply the same visibility and opening behavior to extra hands, clear stale pointer presses, and keep empty piles out of custom open callbacks.

Initialize upgrade controls with valid scene ownership, explicit label sizing and matching hit areas. Fit sorting controls to the available width, reflect the configured initial order, and suspend underlying controls during card inspection.

Copy and validate hotkey and sorting configuration and clarify the bilingual input-action contract without changing public signatures.

Validate formatting, both inspection paths and all four compatibility targets, including normal packaging and installation. Pass 45 targeted configuration and headless engine checks.
Add outward forecasts from current HP and inward overlays from maximum HP, with clipping and deterministic layering. Bridge all four directions to current BaseLib and retain local rendering for older versions without duplicate overlays.

Support concrete generic target types and methods through GenericTypes, and preserve ignored members with InteropIgnore. Process property accessors once to prevent duplicate binding and honor accessor-level exclusions.

Preserve the default collapsed state of mirrored BaseLib settings. Add bilingual public API documentation while retaining existing signatures.

Validate formatting, both inspection paths and all four compatibility targets, including normal packaging and installation. Pass 81 targeted configuration, interop and headless engine checks.
Run creature and merchant animation routing at an explicit early priority instead of deferring BaseLib through an ordering dependency. Preserve the existing order between BaseLib and character mods while retaining precedence for visuals managed by RitsuLib.

Prevent Cloud and Tifa custom actions from being replaced by default attacks and avoid restarting strike animations on repeated hits.

Validate the normal build and installation, formatting and both inspection paths. Reproduce the old behavior with the published Cloud and Tifa DLLs and pass 12 targeted engine checks covering custom animations, repeated hits, hurt playback and opted-in RitsuLib visuals.
@BAKAOLC BAKAOLC changed the title [Breaking Changes] RitsuLib 0.6.0: modular runtime, file pickers, resource packs and engine diagnostics [Breaking Changes] RitsuLib 0.6.0: framework overhaul Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants