Skip to content

Commit

Permalink
mrrow
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Sep 17, 2024
1 parent 3d871b7 commit 713a54f
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 13 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.6.6

- Changed Safe Mode to show the endscreen instead of kicking out of the level
- Added **Editor Extension**

# 1.6.5

- Rewrote old bad code to help improve code readibility
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.7.1",
"version": "v1.6.5",
"version": "v1.6.6",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down
3 changes: 2 additions & 1 deletion src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class ClientUtils
creator->modules.push_back(new Module("Editor Wave Trail", "editor-wave-trail", "Shows the wave trail in the editor"));
creator->modules.push_back(new Module("Smooth Editor Trail", "smooth-editor-trail", "Updates the editor trail at your screen refresh rate instead of 30 fps"));

//creator->modules.push_back(new Module("Editor Extension", "editor-extension", "Editor Extension Help :)"));
creator->modules.push_back(new Module("Editor Extension", "editor-extension", "Increases the length of the editor by <cs>17895</c> times :3"));

//auto misc = new Module("Misc Bypasses", "misc-bypass", "Random <cl>Client Side</c> bypasses / unlocks to random editor limits");
//misc->options.push_back(new Module("Zoom Limit", "zoom-limit", "Bypass the editor zoom limit", true));
Expand Down Expand Up @@ -603,6 +603,7 @@ class ClientUtils
#ifdef GEODE_IS_ARM_MAC
Client::GetModule("tps-bypass")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>ARM Mac</c>");
Client::GetModule("editor-wave-trail")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>ARM Mac</c>");
Client::GetModule("editor-extension")->setIncompatible("This mod has <cr>not yet</c> been ported to <cl>ARM Mac</c>");
#endif

#ifdef GEODE_IS_MACOS
Expand Down
36 changes: 28 additions & 8 deletions src/Hacks/Patches/EditorExtension.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
/*#include <Geode/Geode.hpp>
#include <Geode/Geode.hpp>
#include <Geode/modify/PauseLayer.hpp>
#include "../../Client/Client.h"

using namespace geode::prelude;

$execute
{
// first address is found in CCPoint * EditorUI::getLimitedPosition(EditorUI *this,CCPoi nt *__return,CCPoint param_3)
// second address is found in void EditorUI::constrainGameLayerPosition(EditorUI *this,fl oat param_2,float param_3)

std::vector<geode::Patch*> patches = {};

//#ifdef GEODE_IS_WINDOWS
//patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x5ed33c), { 0x1, 0x0, 0x0, 0x0 }));
//#endif
#ifdef GEODE_IS_WINDOWS
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x5ed33c), { 0xFF, 0xFF, 0xFF, 0xFF }));
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x5ed340), { 0xFF, 0xFF, 0xFF, 0xFF }));
#endif

#ifdef GEODE_IS_ANDROID32
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + (0x37e678 - 0x10000)), { 0xFF, 0xFF, 0xFF, 0xFF }));
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + (0x37ea1c - 0x10000)), { 0xFF, 0xFF, 0xFF, 0xFF }));
#endif

#ifdef GEODE_IS_ANDROID64
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + (0x76cdb4 - 0x100000)), { 0xFF, 0xFF, 0xFF, 0xFF }));
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + (0x76d2fc - 0x100000)), { 0xFF, 0xFF, 0xFF, 0xFF }));
#endif

#ifdef GEODE_IS_INTEL_MAC
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x822770), { 0xFF, 0xFF, 0xFF, 0xFF }));
patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x82258c), { 0xFF, 0xFF, 0xFF, 0xFF }));
#endif

//#ifdef GEODE_IS_ANDROID32
//patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + 0x5ed33c), { 0x1, 0x0, 0x0, 0x0 }));
//#endif
#ifdef GEODE_IS_ARM_MAC
//patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + ), { 0xFF, 0xFF, 0xFF, 0xFF }));
//patches.push_back(createPatchSafe(reinterpret_cast<void*>(geode::base::get() + ), { 0xFF, 0xFF, 0xFF, 0xFF }));
#endif

Loader::get()->queueInMainThread([patches]{
for (auto patch : patches)
Expand All @@ -25,4 +45,4 @@ using namespace geode::prelude;
};
//win:
//0x5ed33c
//0x*/
//0x
27 changes: 24 additions & 3 deletions src/Hacks/SafeMode/SafeMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ void SafePlayLayer::resetLevel()
void SafePlayLayer::levelComplete()
{
auto kick = SafeMode::get()->shouldKickFromLevel();
SafeMode::get()->safeEndScreen = kick;
auto v = m_isTestMode;

if (kick)
{
return this->onQuit();
}
m_isTestMode = true;

PlayLayer::levelComplete();

m_isTestMode = v;
}

void SafePlayLayer::showNewBest(bool p0, int p1, int p2, bool p3, bool p4, bool p5)
Expand All @@ -169,4 +171,23 @@ void SafeGJGameLevel::savePercentage(int p0, bool p1, int p2, int p3, bool p4)
{
if (!SafeMode::get()->shouldKickFromLevel())
GJGameLevel::savePercentage(p0, p1, p2, p3, p4);
}

void SafeEndLevelLayer::customSetup()
{
EndLevelLayer::customSetup();

if (SafeMode::get()->safeEndScreen)
{
if (auto area = getChildOfType<TextArea>(m_mainLayer, -1))
{
area->setString("Safe Mode :3");
area->setScale(0.7f);
}
else if (auto lbl = getChildOfType<CCLabelBMFont>(m_mainLayer, -1))
{
lbl->setString("Safe Mode :3");
lbl->setScale(0.7f);
}
}
}
7 changes: 7 additions & 0 deletions src/Hacks/SafeMode/SafeMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/GJGameLevel.hpp>
#include <Geode/modify/EndLevelLayer.hpp>
#include "../../Client/Client.h"
#include "../../Labels/Labels.h"

Expand All @@ -29,6 +30,7 @@ class SafeMode

public:
bool speedhackKick;
bool safeEndScreen;

std::vector<std::string> hacks = {
"instant",
Expand Down Expand Up @@ -73,4 +75,9 @@ class $modify (SafePlayLayer, PlayLayer)
class $modify (SafeGJGameLevel, GJGameLevel)
{
void savePercentage(int p0, bool p1, int p2, int p3, bool p4);
};

class $modify (SafeEndLevelLayer, EndLevelLayer)
{
virtual void customSetup();
};

0 comments on commit 713a54f

Please sign in to comment.