From 7657f2d617649652182aeea4eecc2360dac47ffd Mon Sep 17 00:00:00 2001 From: TheSillyDoggo Date: Mon, 16 Sep 2024 17:45:26 +1000 Subject: [PATCH] best update --- changelog.md | 3 ++ src/Client/ClientSetup.h | 5 +-- src/Hacks/StopTriggersOnDeath.cpp | 31 ++++++++++++++++ src/Hacks/ToolboxLimit.cpp | 60 +++++++------------------------ src/Utils/CCBlurLayer.cpp | 2 ++ src/Utils/Utils.mm | 2 -- 6 files changed, 52 insertions(+), 51 deletions(-) create mode 100644 src/Hacks/StopTriggersOnDeath.cpp diff --git a/changelog.md b/changelog.md index 22e6469..94c6d53 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,10 @@ - Rewrote old bad code to help improve code readibility - Fixed CPS Counter not being reset to white when restarting +- Fixed blur background looking weird when a blending layer is visible on screen (like loading circles) - Ported **Physics Bypass** to Windows +- Ported **Custom Object Limit Bypass** to All Platforms +- Added **Stop Triggers on Death** # 1.6.4 diff --git a/src/Client/ClientSetup.h b/src/Client/ClientSetup.h index 4a91c41..4a818c8 100644 --- a/src/Client/ClientSetup.h +++ b/src/Client/ClientSetup.h @@ -124,6 +124,7 @@ class ClientUtils level->modules.push_back(new Module("No Checkpoint Limit", "no-checkpoint-limit", "Removes the 50 checkpoint limit from practice mode")); level->modules.push_back(new Module("Auto Clicker", "auto-clicker", "Automatically clicks (and holds for) every X ticks")); + level->modules.push_back(new Module("Stop Triggers on Death", "stop-triggers-on-death", "Stops triggers whenever you die :3")); //level->modules.push_back(new Module("Frame Stepper", "frame-stepper", "Step the game through frames by tapping a button")); @@ -561,7 +562,7 @@ class ClientUtils #endif #ifndef GEODE_IS_WINDOWS - Client::GetModule("custom-obj-limit")->setIncompatible("This mod only supports Windows currently"); + //Client::GetModule("custom-obj-limit")->setIncompatible("This mod only supports Windows currently"); #endif #ifndef QOLMOD_AUTOSONG @@ -584,7 +585,7 @@ class ClientUtils //Client::GetModule("tps-bypass")->setIncompatible("This mod has not yet been ported to Windows 2.206"); //Client::GetModule("all-plat")->setIncompatible("This mod has not yet been ported to 2.206 on Windows."); Client::GetModule("no-shake")->setIncompatible("This mod has not yet been ported to 2.206 on Windows."); - Client::GetModule("custom-obj-limit")->setIncompatible("This mod has not yet been ported to 2.206 on Windows."); + //Client::GetModule("custom-obj-limit")->setIncompatible("This mod has not yet been ported to 2.206 on Windows."); #ifndef QOLMOD_FREESCROLL Client::GetModule("free-scroll")->setIncompatible("This mod has not yet been ported to 2.206"); diff --git a/src/Hacks/StopTriggersOnDeath.cpp b/src/Hacks/StopTriggersOnDeath.cpp new file mode 100644 index 0000000..cc0682f --- /dev/null +++ b/src/Hacks/StopTriggersOnDeath.cpp @@ -0,0 +1,31 @@ +#include +#include +#include "../Client/Client.h" + +using namespace geode::prelude; + +class $modify (GJBaseGameLayer) +{ + virtual void update(float dt) + { + if (m_player1 && m_player1->m_isDead) + return; + + if (m_player2 && m_player2->m_isDead) + return; + + GJBaseGameLayer::update(dt); + } + + static void onModify(auto& self) + { + auto hook = self.getHook("GJBaseGameLayer::update"); + self.setHookPriority("GJBaseGameLayer::update", 9999999999); + + Loader::get()->queueInMainThread([hook] + { + auto modu = Client::GetModule("stop-triggers-on-death"); + modu->addHookRaw(hook); + }); + } +}; \ No newline at end of file diff --git a/src/Hacks/ToolboxLimit.cpp b/src/Hacks/ToolboxLimit.cpp index ea4df7c..dbd05cd 100644 --- a/src/Hacks/ToolboxLimit.cpp +++ b/src/Hacks/ToolboxLimit.cpp @@ -5,56 +5,22 @@ using namespace geode::prelude; -std::vector toolboxpatches = {}; - -void updateToolboxPatches(bool tpsEnabled) -{ - if (toolboxpatches.size() > 0) +class $modify (EditorUI) +{ + void onNewCustomItem(cocos2d::CCObject* sender) { - for (auto catgirl : toolboxpatches) + CCArray* objs = m_selectedObjects; + + if (m_selectedObjects->count() == 0) { - Mod::get()->disownPatch(catgirl); // goodbye cutie you will be very missed :3c + objs = CCArray::create(); + objs->addObject(m_selectedObject); } - toolboxpatches.clear(); - } - - if (tpsEnabled) - { - log::info("patching toolbox"); - - #ifdef GEODE_IS_WINDOWS - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0xa82ad)), {0x3d, 0xFF, 0xFF, 0xFF, 0xFF}).unwrap()); // custom object count - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0xa820f)), {0x3d, 0xFF, 0xFF, 0xFF, 0xFF}).unwrap()); // object count - #endif - - //#ifdef GEODE_IS_IOS - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0xa82ad)), {0x3d, 0x99, 0x99, 0x99, 0x99}).unwrap()); // custom object count - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0xa820f)), {0x3d, 0x99, 0x99, 0x99, 0x99}).unwrap()); // object count - //#endif - - //#ifdef GEODE_IS_ANDROID32 - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0x3a0d82 - 0x10000)), {0xe0, 0xf0, 0x0b, 0xe7}).unwrap()); // custom object count - //toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0xa820f)), {0x3d, 0x99, 0x99, 0x99, 0x99}).unwrap()); // object count - //#endif - } -} - -class ToolboxChangedDelegate : public ModuleChangeDelegate -{ - virtual void onModuleChanged(bool enabled) - { - updateToolboxPatches(Client::GetModuleEnabled("custom-obj-limit")); + GameManager::get()->addNewCustomObject(copyObjects(objs, false, false)); + m_selectedObjectIndex = 0; + reloadCustomItems(); } -}; - -$execute -{ - Loader::get()->queueInMainThread([] { - auto del = new ToolboxChangedDelegate(); - - Client::GetModule("custom-obj-limit")->delegate = del; - updateToolboxPatches(Client::GetModuleEnabled("custom-obj-limit")); - }); -} \ No newline at end of file + QOLMOD_MOD_ALL_HOOKS("custom-obj-limit") +}; \ No newline at end of file diff --git a/src/Utils/CCBlurLayer.cpp b/src/Utils/CCBlurLayer.cpp index 69a759f..901838d 100644 --- a/src/Utils/CCBlurLayer.cpp +++ b/src/Utils/CCBlurLayer.cpp @@ -100,6 +100,8 @@ void CCBlurLayer::visit() void CCBlurLayer::draw() { #ifndef GEODE_IS_MACOS + + ccBlendFunc(this->getBlendFunc()); if (blurStrength == 0) return CCLayerColor::draw(); diff --git a/src/Utils/Utils.mm b/src/Utils/Utils.mm index a1dd1bb..47205fa 100644 --- a/src/Utils/Utils.mm +++ b/src/Utils/Utils.mm @@ -6,13 +6,11 @@ UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; UIEdgeInsets insets = keyWindow.safeAreaInsets; - // Convert from points to Cocos2d-x points (same in this case) safeAreaInsets.origin.x = insets.left; safeAreaInsets.origin.y = insets.top; safeAreaInsets.size.width = insets.right; safeAreaInsets.size.height = insets.bottom; } else { - // Fallback on earlier versions safeAreaInsets = cocos2d::CCRect(0, 0, 0, 0); } return safeAreaInsets;