Skip to content

modoptions: 修复键盘/手柄配置界面被设置页盖住 + 返回时的泛白 - #6

Merged
Dilant merged 5 commits into
std-microblock:masterfrom
std-external:fix/modoptions-key-config-layer
Oct 23, 2026
Merged

Dilant merged 5 commits into
std-microblock:masterfrom
std-external:fix/modoptions-key-config-layer

Conversation

@std-external

@std-external std-external commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

问题

从模组设置页进入「键盘配置 / 游戏手柄配置」后,Everest 的按键配置界面被设置页盖住,看不清也点不到;设置完键位按 Esc 返回时还会泛白一下。

原因

  • Everest 的 ModuleSettingsKeyboardConfigUI / ModuleSettingsButtonConfigUI 是加到同一个 scene、Depth 0 的实体;MaterialModOptions 是盖在它上面的设置页。
  • 设置页走 acrylic 合成:MaterialAcrylicRenderer 会把整个 scene(包括配置界面、HUD、雪)先渲染进快照做模糊背景,再把设置页画一遍在最上层,所以配置界面被“吸”进背景。
  • 上一版把设置页 Depth 改成 1 让它排到配置界面后面。但 Overworld 的其它 Depth 0 实体(山、雪等)也在同一层,配置界面淡出时亮色世界会从设置页后面漏出来,形成一瞬间的泛白。

修法

  • 设置页保持原 Depth 不动;检测到 KeyboardConfigUI / ButtonConfigUI 时把配置界面抬到设置页上一层(Depth - 1),按键界面自然盖在设置页上。
  • 新增 IMaterialAcrylicOverlay:acrylic 抓快照前把“在设置页之上”的 HUD 实体(配置界面、InputEntity 等)临时隐藏,快照/模糊完成后在设置页上方重新绘制;HiresSnow 同样从快照拿掉并在页面上方渲染(vanilla 里雪本来就在最前)。
  • 配置界面打开期间冻结设置页自己的输入处理,并清空它的触屏目标,避免按键/触摸漏到背后的设置行。
  • 不再翻转设置页 Depth,也不再反复开关 acrylic,配置界面淡出时不会出现“亮色世界漏出/重合成”的泛白。

改动文件

文件 说明
Source/MaterialModOptions.cs 检测配置界面、抬高一层、收集/隐藏/重绘 HUD 覆盖层、冻结输入/触屏目标
Source/MaterialAcrylicRenderer.cs 快照前后隐藏/恢复覆盖层,页面与覆盖层分开绘制,雪单独处理
Source/IMaterialAcrylicPage.cs 新增 IMaterialAcrylicOverlay 接口
Source/MaterialTouch.cs 抽 Suppress 辅助
Source/QolSettingsOverlay.cs 键位配置打开时清空触屏目标

本 PR 只含键位配置修复;string 设置项 / 游戏内文本框在 #5。两个 PR 都动了 MaterialModOptions.Update / UpdateInteractions,先合哪个都行,另一个我会 rebase。

验证

  • dotnet build Source/MicroblocksQolUtils.csproj:0 error / 0 warning(Everest stable lib-stripped)
  • dotnet run --project Tests/Capture/Capture.csproj:PASS
  • 手工验证(需要实机,本机 Linux 跑不了游戏):
    1. Mod Options → Everest Core →「键盘配置」:弹出的界面完整可见、可聚焦、能改键、能重置;改一项后 Esc 返回,画面不应泛白,设置页仍然正常。
    2. 同样流程试「游戏手柄配置」。
    3. 在游戏内暂停菜单打开 Mod Options 再走一遍(Level / pause 路径);返回后其它弹层(下拉、复合菜单、收藏)和触屏点选不受影响。

Review 备注

  • externalOverlays 会收集所有 Tags.HUD 且 Depth 在设置页之上的实体(目前主要是配置界面和 InputEntity)。这符合普通渲染的层级,但以前 acrylic 页面会把这些一起盖掉;如果其它 mod 的 HUD 也挂在这个区间,现在会重新显示在设置页上方,属于有意的行为变化。
  • HiresSnow 现在对所有 acrylic 页面(包括章节选择)都画在页面上方,和 vanilla “雪在 UI 最前”一致;确认这是想要的效果即可。

The Everest keyboard/button config UI is an entity added at depth 0 while
the material mod options page is drawn on top of it, and the acrylic pass
renders the whole scene into a blurred snapshot before drawing the page
again. Suppress acrylic while the config screen is open, freeze the page's
input, and lift the config screen to a foreground depth instead.

That also fixes the white flash on Esc: the old fix pushed the page to
depth 1, which put it behind depth-0 Overworld entities (mountain, snow),
so the bright world leaked through while the config screen faded out.
@std-external

Copy link
Copy Markdown
Contributor Author

看了一遍最新实现,结论:层级修对了,泛白也按正确方向修掉了。

  • 设置页不再翻转 Depth,配置界面抬到 Depth - 1,不会再出现“亮色世界漏出”的层级错位。
  • acrylic 抓快照时把配置界面和页面上方的 HUD 临时隐藏、快照后在页面之上重绘;HiresSnow 同样处理。这样配置界面不会进模糊背景,返回时也不用反复开关 acrylic,避免重合成闪白。
  • 配置期间冻结页面输入 + 清空触屏目标没问题。

我这边拉最新 head 跑了 dotnet build(0 error / 0 warning)和 Tests/Capture(PASS);没有需要补的代码,只把 PR 描述更新成了当前实现(Depth-1、IMaterialAcrylicOverlay、雪的处理)。

两个小观察,没改:

  1. externalOverlays 收集所有 Depth 在页面之上的 HUD 实体(目前主要是配置界面和 InputEntity),符合普通渲染层级,但其它 mod 的 HUD 若在同一区间也会重新显示到设置页上方,属于有意行为变化。
  2. HiresSnow 会对所有 acrylic 页面(包括章节选择)画到页面上方,和 vanilla“雪在 UI 最前”一致,确认是想要的效果即可。

本机 Linux 跑不了游戏,实机验证还得麻烦你在 Windows / Android 上过一遍 PR 里的三步。

@Dilant
Dilant merged commit d123e8b into std-microblock:master Oct 23, 2026
8 checks passed
@std-external
std-external deleted the fix/modoptions-key-config-layer branch October 23, 2026 13:43
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