From cffb4bcbddb46f5dfc50c1ee2a5429815f1452e3 Mon Sep 17 00:00:00 2001 From: maybegreat48 <96936658+maybegreat48@users.noreply.github.com> Date: Mon, 9 Jun 2025 20:36:30 -0400 Subject: [PATCH] this was a bad idea --- .../system/DisableLandingPageBail.cpp | 78 ------------------- src/game/frontend/submenus/Network.cpp | 1 - 2 files changed, 79 deletions(-) delete mode 100644 src/game/features/system/DisableLandingPageBail.cpp diff --git a/src/game/features/system/DisableLandingPageBail.cpp b/src/game/features/system/DisableLandingPageBail.cpp deleted file mode 100644 index 13bd28c..0000000 --- a/src/game/features/system/DisableLandingPageBail.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "core/commands/BoolCommand.hpp" -#include "game/backend/ScriptPatches.hpp" -#include "game/backend/NativeHooks.hpp" -#include "game/gta/ScriptFunction.hpp" -#include "game/gta/Natives.hpp" - -namespace YimMenu::Features -{ - static void SetScriptRouterLinkHook(rage::scrNativeCallContext* ctx); - - class DisableLandingPageBail : public BoolCommand - { - using BoolCommand::BoolCommand; - - std::vector m_DoTransitionPatches; - - constexpr static auto m_Scripts = std::to_array({ - "creator"_J, - "ingamehud"_J, - "main_persistent"_J, - "maintransition"_J, - "selector"_J - }); - - virtual void OnEnable() override - { - if (m_DoTransitionPatches.empty()) - { - for (auto script : m_Scripts) - { - // TODO: this doesn't work very well - m_DoTransitionPatches.push_back(ScriptPatches::AddPatch(script, ScriptPointer("DoTransitionPatch1", "2C 01 ? ? 06 39 06 55 41").Sub(21).Add(8), {0x00, 0x00, 0x55})); - m_DoTransitionPatches.push_back(ScriptPatches::AddPatch(script, ScriptPointer("DoTransitionPatch2", "2C 01 ? ? 06 39 06 55 41").Add(10), {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55})); - } - } - - for (auto script : m_Scripts) - { - NativeHooks::AddHook(script, NativeIndex::SET_SCRIPT_ROUTER_LINK, &SetScriptRouterLinkHook); - } - - for (auto& patch : m_DoTransitionPatches) - { - patch->Enable(); - } - } - - - virtual void OnDisable() override - { - for (auto& patch : m_DoTransitionPatches) - { - patch->Disable(); - } - } - }; - - static DisableLandingPageBail _DisableLandingPageBail{"disablelandingpagebail", "Disable Landing Page Bail", "Redirect all bails to singleplayer instead of the landing page"}; - - static void SetScriptRouterLinkHook(rage::scrNativeCallContext* ctx) - { - auto data = ctx->GetArg(0); - - if (_DisableLandingPageBail.GetState() && data[0] == 3 && data[1] == 5 && data[2] == 11) - { - auto script = SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME(); - - ScriptFunction doTransition(script, ScriptPointer("DoTransition", "2C 01 ? ? 06 39 06 55 41").Sub(21)); - doTransition.Call(58, UINT_MAX, 32); - - ctx->SetReturnValue(TRUE); - } - else - { - ctx->SetReturnValue(MISC::SET_SCRIPT_ROUTER_LINK(data)); - } - } -} \ No newline at end of file diff --git a/src/game/frontend/submenus/Network.cpp b/src/game/frontend/submenus/Network.cpp index 622a3cc..8ebc5f8 100644 --- a/src/game/frontend/submenus/Network.cpp +++ b/src/game/frontend/submenus/Network.cpp @@ -81,7 +81,6 @@ namespace YimMenu::Submenus enhancements->AddItem(std::make_shared("forcescripthost"_J)); enhancements->AddItem(std::make_shared("pausegame"_J)); enhancements->AddItem(std::make_shared("nocalls"_J)); - enhancements->AddItem(std::make_shared("disablelandingpagebail"_J)); session->AddItem(joinGroup); session->AddItem(bountyGroup);