From 17ce5e6ce21e427505f49f1daeb27b894d08685e Mon Sep 17 00:00:00 2001 From: 32th-System Date: Thu, 18 Jul 2024 23:01:53 +0200 Subject: [PATCH] Revert "Allow setting starting resources in all games" This reverts commit f3b8ad5667f23e0fef98006aec3eb4106b12488f. --- thprac/src/thprac/thprac_games.h | 32 ------------------------------- thprac/src/thprac/thprac_th06.cpp | 17 +--------------- thprac/src/thprac/thprac_th07.cpp | 16 +--------------- thprac/src/thprac/thprac_th08.cpp | 15 +-------------- thprac/src/thprac/thprac_th10.cpp | 17 +--------------- thprac/src/thprac/thprac_th11.cpp | 16 +--------------- thprac/src/thprac/thprac_th12.cpp | 16 +--------------- thprac/src/thprac/thprac_th13.cpp | 16 +--------------- thprac/src/thprac/thprac_th14.cpp | 16 +--------------- thprac/src/thprac/thprac_th15.cpp | 17 +--------------- thprac/src/thprac/thprac_th16.cpp | 16 +--------------- thprac/src/thprac/thprac_th17.cpp | 16 +--------------- thprac/src/thprac/thprac_th18.cpp | 16 +--------------- 13 files changed, 12 insertions(+), 214 deletions(-) diff --git a/thprac/src/thprac/thprac_games.h b/thprac/src/thprac/thprac_games.h index 69b4a61..183eb57 100644 --- a/thprac/src/thprac/thprac_games.h +++ b/thprac/src/thprac/thprac_games.h @@ -10,38 +10,6 @@ struct IDirect3DDevice8; namespace THPrac { -struct THRelayUI : public Gui::GameGuiWnd { - int lives = 2; - int bombs = 3; - - bool has_bombs = true; - - THRelayUI() noexcept - { - SetTitle("Relay Resources"); - SetWndFlag(ImGuiWindowFlags_NoCollapse); - SetSizeRel(0.5f, 0.25f); - SetFade(0.8f, 0.8f); - Open(); - } - - virtual void OnContentUpdate() - { - ImGui::SliderInt("Lives", &lives, 0, 32); - if (!has_bombs) - ImGui::BeginDisabled(); - ImGui::SliderInt("Bombs", &bombs, 0, 32); - if (!has_bombs) - ImGui::EndDisabled(); - ImGui::NewLine(); - if (ImGui::Button("Close (Press Ins to re-open)")) { - Close(); - } - } - - SINGLETON(THRelayUI); -}; - struct Float2 { float x; float y; diff --git a/thprac/src/thprac/thprac_th06.cpp b/thprac/src/thprac/thprac_th06.cpp index 5472c7f..790361b 100644 --- a/thprac/src/thprac/thprac_th06.cpp +++ b/thprac/src/thprac/thprac_th06.cpp @@ -1855,14 +1855,6 @@ namespace TH06 { pCtx->Eip = 0x42d839; } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x436DFB) - { - auto& r = THRelayUI::singleton(); - *(char*)0x69D4BA = r.lives; - *(char*)0x69D4BB = r.bombs; - r.Close(); - } - PATCH_DY(th06_reacquire_input, 0x41dc58, "\x00\x00\x00\x00\x74", 5); EHOOK_DY(th06_activateapp, 0x420D96) { @@ -2066,14 +2058,7 @@ namespace TH06 { THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - - GameGuiEnd(THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THPauseMenu::singleton().IsOpen() || THRelayUI::singleton().IsOpen()); + GameGuiEnd(THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THPauseMenu::singleton().IsOpen()); } EHOOK_DY(th06_render, 0x41cb6d) { diff --git a/thprac/src/thprac/thprac_th07.cpp b/thprac/src/thprac/thprac_th07.cpp index b991b86..8249e8d 100644 --- a/thprac/src/thprac/thprac_th07.cpp +++ b/thprac/src/thprac/thprac_th07.cpp @@ -1656,13 +1656,6 @@ namespace TH07 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x42EA41) - { - auto& r = THRelayUI::singleton(); - *GetMemAddr(0x00626278, 0x5C) = r.lives; - *GetMemAddr(0x00626278, 0x68) = r.bombs; - r.Close(); - } PATCH_DY(th07_reacquire_input, 0x430f03, "\x00\x00\x00\x00\x74", 5); EHOOK_DY(th07_everlasting_bgm, 0x44d2f0) { @@ -1842,14 +1835,7 @@ namespace TH07 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } diff --git a/thprac/src/thprac/thprac_th08.cpp b/thprac/src/thprac/thprac_th08.cpp index 538edb3..ba776a0 100644 --- a/thprac/src/thprac/thprac_th08.cpp +++ b/thprac/src/thprac/thprac_th08.cpp @@ -2110,12 +2110,6 @@ namespace TH08 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x43AE67) { - auto& r = THRelayUI::singleton(); - *GetMemAddr(0x160F510, 0x74) = r.lives; - *GetMemAddr(0x160F510, 0x80) = r.bombs; - r.Close(); - } EHOOK_ST(th08_familiar, 0x42a55f) { uint32_t target = *(uint32_t*)(pCtx->Ebp - 8); @@ -2295,14 +2289,7 @@ namespace TH08 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } diff --git a/thprac/src/thprac/thprac_th10.cpp b/thprac/src/thprac/thprac_th10.cpp index 7672bfd..74cea54 100644 --- a/thprac/src/thprac/thprac_th10.cpp +++ b/thprac/src/thprac/thprac_th10.cpp @@ -2143,13 +2143,6 @@ namespace TH10 { } PATCH_ST(th10_real_bullet_sprite, 0x406e03, "\x0F\x84\x13\x05\x00\x00", 6); HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x417976) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x474C70 = r.lives; - r.Close(); - } - EHOOK_DY(th10_everlasting_bgm, 0x43e460) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -2284,14 +2277,7 @@ namespace TH10 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } @@ -2320,7 +2306,6 @@ namespace TH10 { // Reset thPracParam thPracParam.Reset(); - THRelayUI::singleton().has_bombs = false; } static __declspec(noinline) void THInitHookDisable() { diff --git a/thprac/src/thprac/thprac_th11.cpp b/thprac/src/thprac/thprac_th11.cpp index 8dacf0b..e7134bb 100644 --- a/thprac/src/thprac/thprac_th11.cpp +++ b/thprac/src/thprac/thprac_th11.cpp @@ -1659,12 +1659,6 @@ namespace TH11 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x41FA60) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4A5718 = r.lives; - r.Close(); - } EHOOK_DY(th11_everlasting_bgm, 0x44a9c0) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -1809,14 +1803,7 @@ namespace TH11 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } @@ -1847,7 +1834,6 @@ namespace TH11 { // Reset thPracParam thPracParam.Reset(); - THRelayUI::singleton().has_bombs = false; } static __declspec(noinline) void THInitHookDisable() { diff --git a/thprac/src/thprac/thprac_th12.cpp b/thprac/src/thprac/thprac_th12.cpp index 5ba242b..c2fbe62 100644 --- a/thprac/src/thprac/thprac_th12.cpp +++ b/thprac/src/thprac/thprac_th12.cpp @@ -1438,13 +1438,6 @@ namespace TH12 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x421EA9) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4B0C98 = r.lives; - *(int32_t*)0x4B0CA0 = r.bombs; - r.Close(); - } EHOOK_DY(th12_everlasting_bgm, 0x454960) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -1559,14 +1552,7 @@ namespace TH12 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } diff --git a/thprac/src/thprac/thprac_th13.cpp b/thprac/src/thprac/thprac_th13.cpp index 5d1bc25..85ad32e 100644 --- a/thprac/src/thprac/thprac_th13.cpp +++ b/thprac/src/thprac/thprac_th13.cpp @@ -1494,13 +1494,6 @@ namespace TH13 { bool th13ElBgmFlag = false; HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x42BC3E) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4BE7F4 = r.lives; - *(int32_t*)0x4BE800 = r.bombs; - r.Close(); - } EHOOK_ST(th13_dump_rep, 0x448d8c) { auto filePtr = (void*)pCtx->Eax; @@ -1647,14 +1640,7 @@ namespace TH13 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); THAdvOptWnd::singleton().FpsUpd(); GameGuiEnd(drawCursor); diff --git a/thprac/src/thprac/thprac_th14.cpp b/thprac/src/thprac/thprac_th14.cpp index ecc508a..737ec45 100644 --- a/thprac/src/thprac/thprac_th14.cpp +++ b/thprac/src/thprac/thprac_th14.cpp @@ -2247,13 +2247,6 @@ namespace TH14 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x435D68) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4F5864 = r.lives; - *(int32_t*)0x4F5870 = r.bombs; - r.Close(); - } EHOOK_DY(th14_everlasting_bgm, 0x46ef90) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -2396,14 +2389,7 @@ namespace TH14 { THGuiRep::singleton().Update(); THOverlay::singleton().Update(); THGuiSP::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen() || THRelayUI::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen(); GameGuiEnd(drawCursor); } diff --git a/thprac/src/thprac/thprac_th15.cpp b/thprac/src/thprac/thprac_th15.cpp index 16b1776..a35dd81 100644 --- a/thprac/src/thprac/thprac_th15.cpp +++ b/thprac/src/thprac/thprac_th15.cpp @@ -1743,13 +1743,6 @@ namespace TH15 { static bool frameStarted = false; HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x43C2D9) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4E7450 = r.lives; - *(int32_t*)0x4E745C = r.bombs; - r.Close(); - } EHOOK_DY(th15_everlasting_bgm, 0x476f10) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -1858,15 +1851,7 @@ namespace TH15 { THGuiPrac::singleton().Update(); THGuiRep::singleton().Update(); THOverlay::singleton().Update(); - - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen(); GameGuiEnd(drawCursor); } EHOOK_DY(th15_render, 0x40170a) diff --git a/thprac/src/thprac/thprac_th16.cpp b/thprac/src/thprac/thprac_th16.cpp index 7760753..88d35e5 100644 --- a/thprac/src/thprac/thprac_th16.cpp +++ b/thprac/src/thprac/thprac_th16.cpp @@ -2132,13 +2132,6 @@ namespace TH16 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x42CE1A) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4A57F4 = r.lives; - *(int32_t*)0x4A5800 = r.bombs; - r.Close(); - } EHOOK_DY(th16_spbugfix, 0x4214fa) { char* sub_str; @@ -2410,14 +2403,7 @@ namespace TH16 { THGuiRep::singleton().Update(); THOverlay::singleton().Update(); THGuiSP::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen(); GameGuiEnd(drawCursor); } EHOOK_DY(th16_render, 0x40168a) diff --git a/thprac/src/thprac/thprac_th17.cpp b/thprac/src/thprac/thprac_th17.cpp index ac8e80b..a3f1d16 100644 --- a/thprac/src/thprac/thprac_th17.cpp +++ b/thprac/src/thprac/thprac_th17.cpp @@ -1783,13 +1783,6 @@ namespace TH17 { #define TH17AddGoast(goast_id) asm_call<0x40f980, Thiscall>(GetMemContent(0x4b7684), goast_id) HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x430474) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4B5A40 = r.lives; - *(int32_t*)0x4B5A4C = r.bombs; - r.Close(); - } EHOOK_DY(th17_window_mousedown, 0x46198b) { auto& adv_opt = THAdvOptWnd::singleton(); @@ -2006,14 +1999,7 @@ namespace TH17 { THGuiPrac::singleton().Update(); THOverlay::singleton().Update(); THGuiSP::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen(); GameGuiEnd(drawCursor); } EHOOK_DY(th17_render, 0x4014d0) diff --git a/thprac/src/thprac/thprac_th18.cpp b/thprac/src/thprac/thprac_th18.cpp index 91caea3..723b4eb 100644 --- a/thprac/src/thprac/thprac_th18.cpp +++ b/thprac/src/thprac/thprac_th18.cpp @@ -2789,13 +2789,6 @@ namespace TH18 { } HOOKSET_DEFINE(THMainHook) - EHOOK_DY(relay_patch_main, 0x442978) - { - auto& r = THRelayUI::singleton(); - *(int32_t*)0x4CCD48 = r.lives; - *(int32_t*)0x4CCD58 = r.bombs; - r.Close(); - } EHOOK_DY(th18_everlasting_bgm, 0x477a50) { int32_t retn_addr = ((int32_t*)pCtx->Esp)[0]; @@ -3044,14 +3037,7 @@ namespace TH18 { THGuiRep::singleton().Update(); THOverlay::singleton().Update(); THGuiSP::singleton().Update(); - - if (Gui::KeyboardInputGetRaw(VK_INSERT)) { - THRelayUI::singleton().Open(); - } - - THRelayUI::singleton().Update(); - - bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen() || THRelayUI::singleton().IsOpen(); + bool drawCursor = THAdvOptWnd::StaticUpdate() || THGuiPrac::singleton().IsOpen() || THGuiSP::singleton().IsOpen(); GameGuiEnd(drawCursor); } EHOOK_DY(th18_render, 0x401510)