From fc9c7ffb3aab871d9e4398996c743e213e0e58ed Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Sun, 8 Dec 2024 01:37:16 +0000 Subject: [PATCH] CHudPause: make button guide respect HUD toggle --- UnleashedRecomp/api/SWA/HUD/Pause/HudPause.h | 2 ++ UnleashedRecomp/patches/ui/CHudPause_patches.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/api/SWA/HUD/Pause/HudPause.h b/UnleashedRecomp/api/SWA/HUD/Pause/HudPause.h index f4e6709..a93bf45 100644 --- a/UnleashedRecomp/api/SWA/HUD/Pause/HudPause.h +++ b/UnleashedRecomp/api/SWA/HUD/Pause/HudPause.h @@ -63,5 +63,7 @@ namespace SWA be m_Menu; be m_Status; be m_Transition; + SWA_INSERT_PADDING(0x20); + bool m_IsShown; }; } diff --git a/UnleashedRecomp/patches/ui/CHudPause_patches.cpp b/UnleashedRecomp/patches/ui/CHudPause_patches.cpp index 18225bb..9e57e6d 100644 --- a/UnleashedRecomp/patches/ui/CHudPause_patches.cpp +++ b/UnleashedRecomp/patches/ui/CHudPause_patches.cpp @@ -160,7 +160,9 @@ PPC_FUNC(sub_824B0930) { g_achievementMenuIntroTime = 0; - if (pHudPause->m_IsShown && pHudPause->m_Transition == SWA::eTransitionType_Undefined) + const auto ms_IsRenderHud = (bool*)g_memory.Translate(0x8328BB26); + + if (*ms_IsRenderHud && pHudPause->m_IsShown && pHudPause->m_Transition == SWA::eTransitionType_Undefined) { ButtonGuide::Open(Button(Localise("Achievements_Name"), EButtonIcon::Back, EButtonAlignment::Left, EFontQuality::Low)); g_isClosed = false;