From a74effabe7a7c984e756ce1d28cef48c215c8919 Mon Sep 17 00:00:00 2001 From: chihya72 Date: Thu, 6 Aug 2026 02:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddbgmode=E4=B8=8B=E6=AD=8C?= =?UTF-8?q?=E8=AF=8D=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 进入 Live 时歌词默认显示(仅每个 Presenter 实例第一次设置时强制 true), 之后玩家手动开关原样透传,不再覆盖关闭操作 --- src/GakumasLocalify/Hook.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/GakumasLocalify/Hook.cpp b/src/GakumasLocalify/Hook.cpp index 8a7f5a6..7d2e294 100644 --- a/src/GakumasLocalify/Hook.cpp +++ b/src/GakumasLocalify/Hook.cpp @@ -1806,16 +1806,23 @@ namespace GakumasLocal::HookMain { return PictureBookLiveSelectScreenPresenter_MoveLiveScene_Orig(self, produceLive, isPlayCharacterFocusCamera, mtd); } + // 进入 Live 时歌词默认显示:仅对每个 Presenter 实例的第一次设置强制 true, + // 之后(玩家的手动开关)原样透传,不再覆盖关闭操作。 + std::unordered_set g_lyricsInitialForced{}; + DEFINE_HOOK(void, LiveSceneModel_set_IsLyricsActive, (void* self, bool value, void* mtd)) { - return LiveSceneModel_set_IsLyricsActive_Orig(self, Config::dbgMode && Config::unlockAllLive ? true : value, mtd); + return LiveSceneModel_set_IsLyricsActive_Orig(self, value, mtd); } DEFINE_HOOK(void, LiveScenePresenter_SetLyricsActive, (void* self, bool value, void* mtd)) { - return LiveScenePresenter_SetLyricsActive_Orig(self, Config::dbgMode && Config::unlockAllLive ? true : value, mtd); + if (Config::dbgMode && Config::unlockAllLive && self && g_lyricsInitialForced.insert(self).second) { + value = true; + } + return LiveScenePresenter_SetLyricsActive_Orig(self, value, mtd); } DEFINE_HOOK(void, LiveSceneContentView_SetLyricsTextActive, (void* self, bool value, void* mtd)) { - return LiveSceneContentView_SetLyricsTextActive_Orig(self, Config::dbgMode && Config::unlockAllLive ? true : value, mtd); + return LiveSceneContentView_SetLyricsTextActive_Orig(self, value, mtd); } // std::string lastMusicId;