CHudPause_patches: fix achievements prompt appearing over PS3 loading

This commit is contained in:
Hyper 2025-02-09 17:43:09 +00:00
parent b7cee84bda
commit 8220f6772b
2 changed files with 12 additions and 1 deletions

View file

@ -71,7 +71,8 @@ namespace SWA
boost::shared_ptr<Hedgehog::Mirage::CMatrixNode> m_spMatrixNodeRoot;
SWA_INSERT_PADDING(0x14);
CGammaController m_GammaController;
SWA_INSERT_PADDING(0x1C);
boost::shared_ptr<CLoading> m_spLoading;
SWA_INSERT_PADDING(0x14);
boost::shared_ptr<Achievement::CManager> m_spAchievementManager;
boost::shared_ptr<CDatabaseTree> m_spDatabaseTree;
Hedgehog::Base::CSharedString m_Field10C;
@ -104,6 +105,7 @@ namespace SWA
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field74, 0x74);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spMatrixNodeRoot, 0x84);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_GammaController, 0xA0);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spLoading, 0xE0);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spAchievementManager, 0xFC);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spDatabaseTree, 0x104);
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field10C, 0x10C);

View file

@ -24,6 +24,9 @@ void CHudPauseAddOptionsItemMidAsmHook(PPCRegister& pThis)
bool InjectMenuBehaviour(uint32_t pThis, uint32_t count)
{
if (App::s_isLoading)
return true;
auto pHudPause = (SWA::CHudPause*)g_memory.Translate(pThis);
auto cursorIndex = *(be<uint32_t>*)g_memory.Translate(4 * (*(be<uint32_t>*)g_memory.Translate(pThis + 0x19C) + 0x68) + pThis);
@ -116,6 +119,12 @@ bool CHudPauseMiscInjectOptionsMidAsmHook(PPCRegister& pThis)
PPC_FUNC_IMPL(__imp__sub_824B0930);
PPC_FUNC(sub_824B0930)
{
if (App::s_isLoading)
{
__imp__sub_824B0930(ctx, base);
return;
}
auto pHudPause = (SWA::CHudPause*)g_memory.Translate(ctx.r3.u32);
auto pInputState = SWA::CInputState::GetInstance();