Skip to content

miaonet: 删掉「隐藏原生越界名字」选项(这个职责归 MiaoNet 自己) - #9

Merged
Dilant merged 1 commit into
std-microblock:masterfrom
std-external:fix/miaonet-offscreen-names
Nov 1, 2026
Merged

Dilant merged 1 commit into
std-microblock:masterfrom
std-external:fix/miaonet-offscreen-names

Conversation

@std-external

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

Copy link
Copy Markdown
Contributor

按 @Dilant 的意见,这个改动从「修 bug」改成「直接删掉这个选项」。

为什么删

  • 这个职责该由 MiaoNet 自己做:GhostNameTag.Render 本来就把屏幕外的名字夹到屏幕边缘再按
    OffScreenPlayerNameOpacity 渐隐,玩家把它设成 0 就没有越界名字了,不需要再加一个开关。
  • 留在 mbqol 里就得跟小地图状态耦合(小地图开没开、画不画越界玩家、名字模式),关系很别扭,
    而且默认开启时会直接吞掉标签。

删了什么

  • Source/MiaoNetBridge.cs:整个 TryInstallOffscreenNameHook()(GhostNameTag.Render 的
    DynamicMethod + MonoMod.RuntimeDetour.Hook detour)、ShouldRenderGhostNameTag()、钩子字段,
    以及 Update() 的安装调用和 Unload() 的清理;顺带去掉 System.Reflection.Emit、
    MonoMod.RuntimeDetour 两个 using。MiaoNet 桥的其它部分(读玩家位置/名字/头像、/qol 聊天命令)不动。
  • Source/QolSettings.cs:HideMiaoNetOffscreenNames 设置项。
  • Source/QolSettingsOverlay.cs:小地图页里的「隐藏原生越界名字」开关。
  • README.md / README.en.md:对应两行说明。

删除设置项对老配置安全:Everest 的 YamlHelper.DeserializerUsing 用
IgnoreUnmatchedProperties()(Celeste.Mod.mm/Mod/Helpers/YamlHelper.cs:26),旧的
HideMiaoNetOffscreenNames: true 键会被忽略,下次保存设置就自动消失。

净效果:+1 / -84,5 个文件,没有残留的死代码。

测试

  • dotnet build Source/MicroblocksQolUtils.csproj -c Release(CelesteRoot = Everest stable-1.6485.0
    lib-stripped)→ Build succeeded,0 warning / 0 error
  • dotnet run --project Tests/Capture/Capture.csproj -c Release → PASS
  • CI(commit 46834c1):Tests、Linux x64、Windows x64、macOS x64、Android ARM64 全 pass

@Dilant

Dilant commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

我觉得直接把这个选项删掉吧

  • 跟别的选项的耦合关系很奇怪
  • 这个职责应当 MiaoNet 自己做,实际上 MiaoNet 自己已经有 离屏玩家不透明度 选项,设为 0 就能关闭

MiaoNet already owns this behaviour: GhostNameTag clamps names for players
outside the camera onto the screen edge and fades them to
OffScreenPlayerNameOpacity, which players can set to 0 if they want them gone.
Keeping a second switch in mbqol meant coupling it to the minimap options and
silently swallowing the labels when the plugin was enabled.

Removes the GhostNameTag.Render detour (and its reflection/IL plumbing), the
setting, the options row and the README lines.
@std-external
std-external force-pushed the fix/miaonet-offscreen-names branch from 7bfb3fb to 46834c1 Compare November 1, 2026 07:41
@std-external std-external changed the title miaonet: 不再默认吞掉屏幕外玩家的名字标签(小地图没顶替时保留原生标签) miaonet: 删掉「隐藏原生越界名字」选项(这个职责归 MiaoNet 自己) Nov 1, 2026
@std-external

Copy link
Copy Markdown
Contributor Author

已按这个意见改成直接删除,PR 现在是纯删除(+1/−84,5 个文件):

  • Source/MiaoNetBridge.cs:删掉整个 TryInstallOffscreenNameHook()(GhostNameTag.Render 的 DynamicMethod detour)、ShouldRenderGhostNameTag()、相关字段,以及 Update()/Unload() 里的调用和清理,顺带去掉 System.Reflection.Emit、MonoMod.RuntimeDetour 两个 using。读玩家/头像/聊天命令那部分没动。
  • Source/QolSettings.cs:删 HideMiaoNetOffscreenNames。
  • Source/QolSettingsOverlay.cs(小地图页末尾的开关行)、README.md、README.en.md 一起清掉。

老配置里的旧键是安全的:Everest 的 YamlHelper.DeserializerUsing 带 IgnoreUnmatchedProperties(),旧 HideMiaoNetOffscreenNames 会被忽略、下次存档自然消失。

验证:dotnet build -c Release 通过(0 warning / 0 error),Tests/Capture PASS,CI 见下方 checks。

流程上记下了:这类「先定成因」的活应该先在群里把成因和修改计划说清楚、等确认,再动 PR。

@Dilant
Dilant merged commit 63fc7fb into std-microblock:master Nov 1, 2026
8 checks passed
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