From 087fd43ac7fe1474fb74b2d60dcc70d85b9cd949 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Sat, 10 Sep 2022 03:44:16 -0600 Subject: [PATCH] Added block input mainly for free cam --- cheat-library/src/appdata/il2cpp-functions.h | 1 + .../src/user/cheat/visuals/FreeCamera.cpp | 25 +++++++++++++++++++ .../src/user/cheat/visuals/FreeCamera.h | 1 + 3 files changed, 27 insertions(+) diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index 5410dd0..d45c91c 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -301,6 +301,7 @@ DO_APP_FUNC(0x0143BF90, void, MoleMole_LCAbilityElement_ReduceModifierDurability DO_APP_FUNC(0x0218C660, BaseEntity*, MoleMole_GadgetEntity_GetOwnerEntity, (GadgetEntity* __this, MethodInfo* method)); DO_APP_FUNC(0x027385E0, bool, MoleMole_UIManager_HasEnableMapCamera, (MoleMole_UIManager* __this, MethodInfo* method)); +DO_APP_FUNC(0x0272BF00, void, MoleMole_UIManager_EnableInput, (MoleMole_UIManager* __this, bool playerInput, bool clearCurInputState, bool ignoreTouch, MethodInfo* method)); DO_APP_FUNC(0x010ED540, void, MonoMiniMap_Update, (MonoMiniMap* __this, MethodInfo* method)); DO_APP_FUNC(0x02DA4B00, MonoMiniMap*, MonoInLevelMainPage_get_miniMap, (void* __this, MethodInfo* method)); diff --git a/cheat-library/src/user/cheat/visuals/FreeCamera.cpp b/cheat-library/src/user/cheat/visuals/FreeCamera.cpp index 785860a..04e952d 100644 --- a/cheat-library/src/user/cheat/visuals/FreeCamera.cpp +++ b/cheat-library/src/user/cheat/visuals/FreeCamera.cpp @@ -25,6 +25,7 @@ namespace cheat::feature FreeCamera::FreeCamera() : Feature(), NF(f_Enabled, "Free Camera", "Visuals::FreeCamera", false), NF(f_FreezeAnimation, "Freeze Character Animation", "Visuals::FreeCamera", false), + NF(f_BlockInput, "Block Input", "Visuals::FreeCamera", false), NF(f_DamageOverlay, "Damage Overlay", "Visuals::FreeCamera", false), NF(f_HpOverlay, "Enemy HP Overlay", "Visuals::FreeCamera", false), NF(f_Speed, "Speed", "Visuals::FreeCamera", 1.0f), @@ -61,6 +62,7 @@ namespace cheat::feature { ConfigWidget("Enable", f_Enabled); ConfigWidget("Freeze Character Animation", f_FreezeAnimation, "Freezes the active character's animation."); + ConfigWidget("Block User Input", f_BlockInput, "If enabled, any input will be blocked."); if (f_Enabled) { ConfigWidget("Toggle Damage Overlay", f_DamageOverlay, "Remove damage output overlay"); @@ -242,6 +244,12 @@ namespace cheat::feature void FreeCamera::OnGameUpdate() { + auto uiManager = GET_SINGLETON(MoleMole_UIManager); + if (uiManager == nullptr) + return; + + static bool isBlock = false; + if (f_Enabled) { if (mainCam == nullptr) @@ -284,6 +292,23 @@ namespace cheat::feature hpOverlay = nullptr; } + if (f_BlockInput) + { + if (!isBlock) + { + app::MoleMole_UIManager_EnableInput(uiManager, false, false, false, nullptr); + isBlock = true; + } + } + else + { + if (isBlock) + { + app::MoleMole_UIManager_EnableInput(uiManager, true, false, false, nullptr); + isBlock = false; + } + } + // Taiga#5555: There's probably be a better way of implementing this. But for now, this is just what I came up with. auto& manager = game::EntityManager::instance(); auto animator = manager.avatar()->animator(); diff --git a/cheat-library/src/user/cheat/visuals/FreeCamera.h b/cheat-library/src/user/cheat/visuals/FreeCamera.h index 09d7d37..525b6ee 100644 --- a/cheat-library/src/user/cheat/visuals/FreeCamera.h +++ b/cheat-library/src/user/cheat/visuals/FreeCamera.h @@ -9,6 +9,7 @@ namespace cheat::feature public: config::Field> f_Enabled; config::Field> f_FreezeAnimation; + config::Field f_BlockInput; config::Field f_DamageOverlay; config::Field f_HpOverlay; config::Field f_Speed;