Skip to content

Commit

Permalink
best update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Sep 16, 2024
1 parent 7415842 commit 7657f2d
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 51 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"));


Expand Down Expand Up @@ -561,7 +562,7 @@ class ClientUtils
#endif

#ifndef GEODE_IS_WINDOWS
Client::GetModule("custom-obj-limit")->setIncompatible("This mod only supports <cl>Windows</c> <cg>currently</c>");
//Client::GetModule("custom-obj-limit")->setIncompatible("This mod only supports <cl>Windows</c> <cg>currently</c>");
#endif

#ifndef QOLMOD_AUTOSONG
Expand All @@ -584,7 +585,7 @@ class ClientUtils
//Client::GetModule("tps-bypass")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>Windows 2.206</c>");
//Client::GetModule("all-plat")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c> on <cl>Windows</c>.");
Client::GetModule("no-shake")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c> on <cl>Windows</c>.");
Client::GetModule("custom-obj-limit")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c> on <cl>Windows</c>.");
//Client::GetModule("custom-obj-limit")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c> on <cl>Windows</c>.");

#ifndef QOLMOD_FREESCROLL
Client::GetModule("free-scroll")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>2.206</c>");
Expand Down
31 changes: 31 additions & 0 deletions src/Hacks/StopTriggersOnDeath.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#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);
});
}
};
60 changes: 13 additions & 47 deletions src/Hacks/ToolboxLimit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,22 @@

using namespace geode::prelude;

std::vector<Patch*> 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<void*>(geode::base::get() + (0xa82ad)), {0x3d, 0xFF, 0xFF, 0xFF, 0xFF}).unwrap()); // custom object count
//toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast<void*>(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<void*>(geode::base::get() + (0xa82ad)), {0x3d, 0x99, 0x99, 0x99, 0x99}).unwrap()); // custom object count
//toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast<void*>(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<void*>(geode::base::get() + (0x3a0d82 - 0x10000)), {0xe0, 0xf0, 0x0b, 0xe7}).unwrap()); // custom object count
//toolboxpatches.push_back(Mod::get()->patch(reinterpret_cast<void*>(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"));
});
}
QOLMOD_MOD_ALL_HOOKS("custom-obj-limit")
};
2 changes: 2 additions & 0 deletions src/Utils/CCBlurLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ void CCBlurLayer::visit()
void CCBlurLayer::draw()
{
#ifndef GEODE_IS_MACOS

ccBlendFunc(this->getBlendFunc());

if (blurStrength == 0)
return CCLayerColor::draw();
Expand Down
2 changes: 0 additions & 2 deletions src/Utils/Utils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7657f2d

Please sign in to comment.