From c114cfc81e4a8b2f368eed6d3c4862135da6440b Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 29 Aug 2021 19:11:58 +0200 Subject: [PATCH] Close battle net popup if open --- src/component/patches.cpp | 10 ++++++++++ src/game/symbols.hpp | 1 + 2 files changed, 11 insertions(+) diff --git a/src/component/patches.cpp b/src/component/patches.cpp index af264143..f23706cc 100644 --- a/src/component/patches.cpp +++ b/src/component/patches.cpp @@ -1,6 +1,8 @@ #include #include "loader/component_loader.hpp" +#include "scheduler.hpp" + #include "game/game.hpp" #include "game/dvars.hpp" @@ -32,6 +34,14 @@ namespace patches // Disable battle net popup utils::hook::set(game::base_address + 0xBE7F83C, true); + scheduler::once([]() + { + if (game::Menu_IsMenuOpenAndVisible(0, "bnet_error_popup")) + { + game::LUI_OpenMenu(0, "", 1, 0, 0); + } + }, scheduler::pipeline::main); + pm_crashland_hook.create(game::base_address + 0x688A20, pm_crashland_stub); dvars::jump_enableFallDamage = dvars::register_bool("jump_enableFallDamage", 1, game::DVAR_FLAG_REPLICATED); diff --git a/src/game/symbols.hpp b/src/game/symbols.hpp index 6ef5b81c..e90904ed 100644 --- a/src/game/symbols.hpp +++ b/src/game/symbols.hpp @@ -59,6 +59,7 @@ namespace game uint32_t imageFlags, DXGI_FORMAT imageFormat, int a8, const char* name, const void* initData)> Image_Setup{0x74B2A0}; WEAK symbol LUI_OpenMenu{0x5F0EE0}; + WEAK symbol Menu_IsMenuOpenAndVisible{0x5EE1A0}; WEAK symbol Material_RegisterHandle{0x759BA0};