世界存档消音器

世界存档消音器

为Valheim提供的客户端HUD生活质量模组,可将侵入式屏幕中央世界保存倒计时警告和通知重新定位或静音。

[size=6]WorldSaveMuzzler[/size]


[url=https://github.com/dreamwraith/Valheim-WorldSaveMuzzler/releases][img]https://img.shields.io/github/v/release/dreamwraith/Valheim-WorldSaveMuzzler?logo=github&color=1081c2[/img][/url] [url=https://github.com/dreamwraith/Valheim-WorldSaveMuzzler/releases][img]https://img.shields.io/github/downloads/dreamwraith/Valheim-WorldSaveMuzzler/total?logo=github&color=1081c2[/img][/url] [url=https://github.com/dreamwraith/Valheim-WorldSaveMuzzler/commits/master][img]https://img.shields.io/github/last-commit/dreamwraith/Valheim-WorldSaveMuzzler?logo=git[/img][/url] [url=https://github.com/dreamwraith/Valheim-WorldSaveMuzzler/actions][img]https://img.shields.io/github/actions/workflow/status/dreamwraith/Valheim-WorldSaveMuzzler/publish.yml?label=Publish%20Portals&logo=githubactions[/img][/url] [url=https://thunderstore.io/c/valheim/p/DreamWraith/WorldSaveMuzzler/][img]https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fthunderstore.io%2Fapi%2Fexperimental%2Fpackage%2FDreamWraith%2FWorldSaveMuzzler%2F&query=%24.latest.version_number&label=Thunderstore&logo=thunderstore&color=2980b9[/img][/url] [url=https://valheim.hexium.gg/mods/DreamWraith/WorldSaveMuzzler][img]https://img.shields.io/badge/Hexium-WorldSaveMuzzler-6c5ce7[/img][/url] [url=https://www.nexusmods.com/valheim/mods/4330][img]https://img.shields.io/badge/Nexus_Mods-4330-da8e35?logo=nexusmods&logoColor=white[/img][/url] [url=https://store.steampowered.com/app/892970/Valheim/][img]https://img.shields.io/badge/Valheim-Deep_North_%2F_1.x-1b2838?logo=steam&logoColor=white[/img][/url] [url=https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/][img]https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fthunderstore.io%2Fapi%2Fexperimental%2Fpackage%2Fdenikson%2FBepInExPack_Valheim%2F&query=%24.latest.version_number&label=BepInEx&color=5B57E7[/img][/url] [url=WorldSaveMuzzler.csproj][img]https://img.shields.io/badge/.NET%20Framework-4.8-512BD4?logo=dotnet[/img][/url] [url=README.md#the-solution][img]https://img.shields.io/badge/Type-100%25%20Client--Side-brightgreen[/img][/url] [url=LICENSE.md][img]https://img.shields.io/github/license/dreamwraith/Valheim-WorldSaveMuzzler?color=blue[/img][/url] [url=https://gist.github.com/dreamwraith/77c91d656c842611bf8c40febf8056f2][img]https://img.shields.io/badge/AI%20Philosophy-Software%20Craft-2ea44f?logo=github[/img][/url]



一个独立的、100% 客户端侧的生活质量模组,为《英灵神殿》中那些烦人的、抢占屏幕的世界存档提示戴上嘴套,让它们终于闭嘴,不再在你拼命战斗时横穿准星狂吼。



[quote]


[!NOTE]


[b]仅客户端:[/b] 此模组安装在你本地的 PC 上。它[b]不[/b]需要安装在服务器上,在单人游戏或连接任何专用服务器或社区服务器时均可使用。


[/quote]


[quote]


[!IMPORTANT]


[b]Valheim Community Patch Extras 提示:[/b]


此代码已合并至 [b]Valheim Community Patch Extras[/b],但为那些不想安装 VCP Extra 模组的用户单独发布。如果已安装 Valheim Community Patch Extras,WorldSaveMuzzler 将自动检测并安全地自我禁用,以防止重复处理。


[/quote]


[line]



[size=5]问题所在[/size]


在原版《英灵神殿》中,[b]Game.UpdateSaving[/b] 会使用 [b]MessageHud.MessageType.Center[/b] 广播一条 30 秒自动存档警告([b]"$msg_worldsavewarning 30s"[/b])以及一条存档完成提示([b]"$msg_worldsaved"[/b])。



这会在你的准星和战斗视野正中央泼洒一条巨大的、占满屏幕的黄色横幅。此外,许多专用服务器和管理脚本会使用屏幕中央的浮动提示向所有玩家广播自定义倒计时。



在激烈战斗、Boss 遭遇、海上航行或精密的脚手架建造过程中,屏幕中央突然被自动存档横幅致盲,很容易导致弹反时机失误、迷失方向、意外坠落或死亡。



[size=5]解决方案[/size]


[b]WorldSaveMuzzler[/b] 拦截 [b]MessageHud.ShowMessage[/b],并提供简洁、可自定义的显示选项:


[list]


[*] [b]RelocateToTopLeft(默认)[/b]:将世界存档倒计时警告和存档提示移至低调的左上角通知栏。你仍能得知即将到来的存档,而不会让准星或视野被遮挡。


[*] [b]Mute[/b]:完全静音屏幕中央的世界存档通知,带来不被打断的沉浸式体验。


[*] [b]Native[/b]:保持通知居中显示,不做任何更改。


[/list]


[line]



[size=5]配置[/size]


设置可直接在游戏内通过 BepInEx [b]Configuration Manager[/b](视配置而定按 F1 / F5)进行自定义,或通过编辑 [b]BepInEx/config/dreamwraith.WorldSaveMuzzler.cfg[/b]:




[b]区段 | 键 | 类型 | 默认值 | 描述[/b]


[b]1 - General[/b] | [b]WorldSaveNoticeMode[/b] | [b]enum[/b] | [b]RelocateToTopLeft[/b] | 显示模式:[b]RelocateToTopLeft[/b](低调的左上角通知栏)、[b]Mute[/b](完全隐藏)或 [b]Native[/b](居中的黄色横幅)。


[line]



[size=5]兼容性[/size]


[list]


[*] [b]Valheim Community Patch Extras[/b]:此代码已合并至 [b]Valheim Community Patch Extras[/b],但为那些不想安装 VCP Extra 模组的用户单独发布。如果存在 VCP Extras,WorldSaveMuzzler 会自动自我禁用,以防止重复或冲突的通知处理。


[*] [b]100% 客户端侧[/b]:可在任何服务器上安全使用。服务器无需安装此模组。


[*] [b]智能检测[/b]:可识别原版《英灵神殿》本地化键([b]$msg_worldsavewarning[/b]、[b]$msg_worldsaved])以及来自常见服务器脚本的纯英文倒计时广播(例如 [i]"World save in 30s"[/i])。


[*] [b]无头安全[/b]:在未渲染 [b]MessageHud[/b] 的无头服务器上不产生任何作用。


[/list]


[line]



[size=5]安装[/size]



[quote]


[!TIP]


[b]仅客户端[/b]:通过你偏好的模组管理器(Gale / r2modman / Thunderstore)或手动拖放安装到本地 PC。服务器上无需安装任何内容。


[/quote]


[size=4]模组管理器(推荐)[/size]


[list=1]


[*] 通过 [b]Gale[/b]、[b]Thunderstore Mod Manager[/b] 或 [b]r2modman[/b] 安装。


[*] 启动游戏,享受清晰的战斗视野!


[/list]


[size=4]手动安装[/size]


[list=1]


[*] 确保已安装 [b]BepInExPack Valheim[/b]。


[*] 下载并解压发布压缩包。


[*] 将 [b]WorldSaveMuzzler.dll[/b] 放入你的 [b]Valheim/BepInEx/plugins/[/b] 目录。


[*] 启动《英灵神殿》。


[/list]


[line]



[size=5]从源码构建[/size]


本项目使用可移植的 MSBuild 配置,可自动检测标准 Steam 路径。



[code]dotnet build -c Release[/code]



编译后的程序集将放置于 [b]bin/Release/net48/WorldSaveMuzzler.dll[/b]。在 [b]Release[/b] 配置下构建还会自动将分发包打包到 [b]bin/Publish/WorldSaveMuzzler-<Version>.zip[/b]。



[size=4]自定义与 CI 路径[/size]


对于非标准 Steam 库位置,请将 [b]WorldSaveMuzzler.csproj.user.example[/b] 复制到项目根目录下的 [b]WorldSaveMuzzler.csproj.user[/b](此文件已被 git 忽略,由 MSBuild 自动加载):



[code]<?xml version="1.0" encoding="utf-8"?>


<Project>


<PropertyGroup>


<GamePath>D:\SteamLibrary\steamapps\common\Valheim</GamePath>


<BepInExCorePath>$(UserProfile)\AppData\Roaming\com.kesomannen.gale\valheim\profiles\<ProfileName>\BepInEx\core</BepInExCorePath>


</PropertyGroup>


</Project>[/code]



[line]



[size=5]打包、发布与版本发布[/size]


所有用于发布管理、打包以及发布到 [b]Thunderstore[/b]、[b]Hexium[/b] 和 [b]Nexus Mods[/b] 的开发者自动化工具,都整合到单一的 PowerShell 7 入口点 [url=.scripts/modtools.ps1].scripts/modtools.ps1[/url],由共享的 [url=https://github.com/DreamWraith/DW-ValheimModTools][b]DW.ValheimModTools[/b][/url] 模块驱动:


[list]


[*] [b]发布管理[/b]:pwsh ./.scripts/modtools.ps1 release 以 Release 配置编译,创建模组与源码压缩包,提取变更日志说明,并使用 gh CLI 发布 GitHub Releases(默认草稿,或使用 -Publish 发布)。


[*] [b]打包与版本号递增[/b]:pwsh ./.scripts/modtools.ps1 package -Bump Patch 递增 WorldSaveMuzzler.csproj 中的 SemVer,更新 manifest.json,并打包分发包。


[*] [b]门户发布[/b]:pwsh ./.scripts/modtools.ps1 publish -Target All 直接上传到 Thunderstore、Hexium 和 Nexus Mods API。


[*] [b]CI/CD 工作流[/b]:[url=.github/workflows/publish.yml].github/workflows/publish.yml[/url] 提供自动化的 GitHub Actions 工作流,每当发布 GitHub Release 时便发布到 Thunderstore、Hexium 和 Nexus Mods。


[/list]


有关标志、工作流和密钥配置的详细文档,请参阅 [url=.scripts/README.md].scripts/README.md[/url]。



[line]



[size=5]许可证与作者说明[/size]


[list]


[*] 本项目采用 GNU General Public License v3.0 许可 - 详情请参阅 [url=LICENSE.md]LICENSE.md[/url] 文件。


[*] [url=https://gist.github.com/dreamwraith/98564f8441dc234bfadd7e2b605c694c][b]关于我针对《英灵神殿》模组开发的一点说明[/b][/url] - 关于开源模组开发、社区包容性和反守门主义的思考。


[*] [url=https://gist.github.com/dreamwraith/77c91d656c842611bf8c40febf8056f2][b]关于 AI、软件工艺以及此代码为何存在的说明[/b][/url] - 关于软件工艺、人类能动性和工程责任的个人随笔。


[/list]