Skip to content

Commit

Permalink
fdgsfgdgsf
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 11, 2024
1 parent 5c4f138 commit 2472743
Show file tree
Hide file tree
Showing 24 changed files with 887 additions and 274 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
project(CheatClient VERSION 1.0.0)

file(GLOB SOURCES
src/*.cpp
src/*.h
src/Hacks/*.cpp
src/Client/*.cpp
src/Client/*.h
src/Hacks/*.cpp
src/Layers/*.h
src/Replay/*.cpp
src/Replay/*.h
src/*.cpp
src/*.h
)

#add_library(${PROJECT_NAME} SHARED ${SOURCES} "src/Client/Module.h" "src/Client/Window.h" "src/Client/Client.h" "src/Client/DrawUtils.h" "src/Client/ColourUtility.cpp" "src/Client/ClientSetup.h" "src/Hacks/UnlockHacks.cpp" "src/Hacks/CloseEndLevelLayer.cpp" "src/Hacks/TransitionTimeCustomiser.cpp" "src/Hacks/Speedhack.cpp" "src/Hacks/Noclip.cpp" "src/Hacks/Hitbox.cpp" "src/Hacks/NoRotation.cpp" "src/Hacks/Variables.cpp" "src/Hacks/FullOptions.cpp" "src/Hacks/StatusText.cpp" "src/Hacks/FireInTheHole.cpp" "src/Hacks/InstantComplete.cpp" "src/Hacks/ForcePlatformer.cpp" "src/Hacks/CopyHack.cpp" "src/Hacks/NocMark.cpp" "src/Hacks/SafeMode.cpp" "src/Hacks/SliderLimit.cpp" "src/Hacks/PracticeAlert.cpp" "src/Hacks/TextLimitBypass.cpp")
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# 1,1,4
# 1.1>4

- Added additional borders for npesta texture pack users
- Fixed RobTop levels with the level edit fix
- Added Force Object Visibility
- Added No Glow
- Added Noclip Deaths and Noclip Accuracy
- Temporarily removed thicker hitboxes due to lag :(

# 1.1.3

Expand Down
2 changes: 0 additions & 2 deletions src/Client/AndroidUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,6 @@ class $modify (AppDelegate)
}
}

log::info("ok create new ball");

p0->addChild(AndroidBall::create());
cocos::handleTouchPriority(AndroidBall::instance);
}
Expand Down
178 changes: 177 additions & 1 deletion src/Client/Client.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#pragma once

#include "Window.h"

class Client
{
public:
static inline Client* instance = nullptr;
static MyReplay replay;

std::vector<Window*> windows;
ImVec2 tileSize = ImVec2(150, 30);
Expand Down Expand Up @@ -95,4 +98,177 @@ class Client

return nullptr;
}
};
};


class SaveMacroPopup : public FLAlertLayer, TextInputDelegate
{
public:
geode::InputNode* inp = nullptr;
CCLabelBMFont* errorLbl = nullptr;
ButtonSprite* bs = nullptr;
CCMenuItemSpriteExtra* ok = nullptr;

void onClose(CCObject*)
{
this->removeFromParent();
}

void onOk(CCObject*)
{
//log::info("n: {}", Client::GetModuleEnabled("noclip"));

//Client::replay.author = GJAccountManager::get()->m_username;

//std::vector<uint8_t> output = replay.exportData(true);
//std::string str(output.begin(), output.end());

//utils::file::writeString(Mod::get()->getConfigDir() / "macros" / inp->getString() / ".gdr", str.c_str());

TextAlertPopup::create("a", 0.3f, 0.1f, 1, "unk");

this->removeFromParent();
}

virtual void keyBackClicked()
{
onClose(nullptr);
}

virtual void textChanged(CCTextInputNode* p0)
{
errorLbl->setString("");
bs->updateBGImage("GJ_button_01.png");
ok->setEnabled(true);

//if (Client::replay.inputs.size() == 0)
if (false)
{
errorLbl->setString("Macro cannot be empty");
errorLbl->limitLabelWidth(725*0.375, 1.0f, 0.1f);

bs->updateBGImage("GJ_button_04.png");
ok->setEnabled(false);

return;
}

if (p0->getString().size() == 0)
{
errorLbl->setString("Macro name cannot be empty");
errorLbl->limitLabelWidth(725*0.375, 1.0f, 0.1f);

bs->updateBGImage("GJ_button_04.png");
ok->setEnabled(false);

return;
}

std::stringstream ss;
ss << Mod::get()->getConfigDir().string();
ss << "/macros/";
ss << p0->getString().c_str();
ss << ".gdr";

log::info("path: {}", ss.str());

if (CCFileUtils::get()->isFileExist(ss.str()))
{
errorLbl->setString("Macro already exists by that name");
errorLbl->limitLabelWidth(725*0.375, 1.0f, 0.1f);

bs->updateBGImage("GJ_button_04.png");
ok->setEnabled(false);
}
}

bool init()
{
if (!FLAlertLayer::init(0))
return false;

this->runAction(CCFadeTo::create(1, 100));
//this->setTouchEnabled(true);
this->setKeypadEnabled(true);

auto l = CCMenu::create();
l->setContentSize(ccp(330, 210));
l->setPosition(CCDirector::get()->getWinSize() / 2);
l->ignoreAnchorPointForPosition(false);
l->setTouchPriority(-514);

std::stringstream ss;
ss << "GJ_square0";
ss << Mod::get()->getSavedValue<int>("theme", 5);
ss << ".png";

auto panel = CCScale9Sprite::create(ss.str().c_str());
panel->setContentSize(l->getContentSize());
panel->setAnchorPoint(ccp(0, 0));
panel->setID("panel");
l->addChild(panel);

auto title = CCLabelBMFont::create("Save Macro As", "bigFont.fnt");
title->setPosition(l->getContentSize() / 2 + ccp(0, 90));
title->setOpacity(100);
title->setScale(0.5f);
l->addChild(title);

auto lb = CCLabelBMFont::create("Macro Name:", "bigFont.fnt");
lb->setPosition(l->getContentSize() / 2 + ccp(0, 50));
lb->setScale(0.55f);
l->addChild(lb);

inp = geode::InputNode::create(lb->getScaledContentSize().width + 150, "Macro Name (.gdr)");
inp->setPosition(l->getContentSize() / 2 + ccp(0, 5));
inp->getInput()->setAllowedChars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNNM098765431");
inp->getInput()->setMaxLabelLength(32);
inp->getInput()->setDelegate(this);
inp->getInput()->setID("IGNOREBYPASSES"_spr);
l->addChild(inp);

errorLbl = CCLabelBMFont::create(/*Client::replay.inputs.size()*/1 == 0 ? "Macro cannot be empty" : "Macro name cannot be empty", "bigFont.fnt");
errorLbl->setColor(ccc3(255, 0, 0));
errorLbl->setOpacity(100);
errorLbl->setPosition(l->getContentSize() / 2 + ccp(0, -25));
errorLbl->limitLabelWidth(725*0.375, 1.0f, 0.1f);
l->addChild(errorLbl);

auto cancel = CCMenuItemSpriteExtra::create(ButtonSprite::create("Cancel"), this, menu_selector(SaveMacroPopup::onClose));
cancel->setPosition(l->getContentSize() / 2 + ccp(-40, -82));
l->addChild(cancel);

bs = ButtonSprite::create("OK", "goldFont.fnt", "GJ_button_04.png");

ok = CCMenuItemSpriteExtra::create(bs, this, menu_selector(SaveMacroPopup::onOk));
ok->setPosition(l->getContentSize() / 2 + ccp(58, -82));
ok->setEnabled(false);
l->addChild(ok);

this->addChild(l);

l->setScale(0.1f);
l->runAction(CCEaseElasticOut::create(CCScaleTo::create(1, 1)));

return true;
}

static SaveMacroPopup* create()
{
SaveMacroPopup* pRet = new SaveMacroPopup();
if (pRet && pRet->init()) {
pRet->autorelease();
return pRet;
} else {
delete pRet;
return nullptr;
}
}

static void addToScene()
{
auto pRet = SaveMacroPopup::create();

CCScene::get()->addChild(pRet, 99999);
}
};
22 changes: 15 additions & 7 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ClientUtils
SetupCosmetic();
SetupIconEffects();
SetupSpeedhack();
SetupStatus();

//SetupVariables(android);

Expand Down Expand Up @@ -60,6 +61,8 @@ class ClientUtils

level->modules.push_back(new Module("Force Platformer", "force-plat", "Force Platformer mode on all levels."));
level->modules.push_back(new Module("Level Edit", "level-edit", "Allows you to edit any level"));


//level->modules.push_back(new Module("Startpos Switcher", "startpos-switcher", "Switch between start-positions in the level"));
//level->modules.push_back(new Module("Show Hitboxes", "hitbox"));

Expand All @@ -86,8 +89,8 @@ class ClientUtils
bypass->modules.push_back(new Module("Auto Safe mode", "auto-safe-mode", "Automatically enables safe mode if you have cheats enabled", true));
bypass->modules.push_back(new Module("Safe mode", "safe-mode", "Disables all progress on levels"));

bypass->modules.push_back(new Module("Character Limit", "char-limit", "Removes the <cl>character limit</c> on input fields"));
bypass->modules.push_back(new Module("Character Filter", "char-filter", "Allows you to input <cg>any</c> character in input fields"));
bypass->modules.push_back(new Module("Character Limit", "char-limit", "Removes the <cl>character limit</c> on input fields", false, "<cr>Warning!</c>\nThis module has been <cl>known</c> to cause issues on <cg>some</c> devices such as:\n<cl>- Crashing when you type</c>\n- Crashing when the input field goes away.\nIf the game crashes pressing an ok button, <cr>Disable</c> this module", true));
bypass->modules.push_back(new Module("Character Filter", "char-filter", "Allows you to input <cg>any</c> character in input fields", false, "<cr>Warning!</c>\nThis module has been <cl>known</c> to cause issues on <cg>some</c> devices such as:\n<cl>- Crashing when you type</c>\n- Crashing when the input field goes away.\nIf the game crashes pressing an ok button, <cr>Disable</c> this module", true));

#ifdef GEODE_IS_ANDROID
//bypass->modules.push_back(new Module("Slider Limit Bypass", "slider-limit", "Allows sliders to go beyond the limit of the slider. <cr>Doesn't work for scaling in the editor currently</c>"));
Expand All @@ -106,7 +109,8 @@ class ClientUtils

//cosmetic->modules.push_back(new Module("Hide Endscreen BTN", "end-screen", "Adds an arrow to hide the end screen"));
cosmetic->modules.push_back(new Module("No Transition", "no-trans", "Disables the fade scene transitions"));
cosmetic->modules.push_back(new Module("Thicker Hitboxes", "thick-hitbox", "Makes the hitboxes in gd thicker ;)"));
cosmetic->modules.push_back(new Module("No Camera Shake", "no-shake", "Disables camera shake globally"));
//cosmetic->modules.push_back(new Module("Thicker Hitboxes", "thick-hitbox", "Makes the hitboxes in gd thicker ;)"));

cosmetic->modules.push_back(new Module("No Shaders", "no-shaders", "Disables shaders, <cl>maybe read</c> the name"));
cosmetic->modules.push_back(new Module("No Death Effect", "no-death", "Disables the death effect on the player"));
Expand All @@ -120,6 +124,12 @@ class ClientUtils
cosmetic->modules.push_back(new Module("Force Trail On", "trail-on", "Forces the trail on"));
cosmetic->modules.push_back(new Module("Force Trail Off", "trail-off", "Forces the trail off"));

cosmetic->modules.push_back(new Module("No Glow", "no-glow", "Disables Object Glow"));
cosmetic->modules.push_back(new Module("Force Object Visibility", "force-obj-vis", "Forces all object to be visible"));

//cosmetic->modules.push_back(new Module("Force Don't Fade", "dont-fade", "Forces all object to be Don't Fade"));
//cosmetic->modules.push_back(new Module("Force Don't Enter", "dont-enter", "Forces all object to be Don't Enter"));

#ifndef GEODE_IS_ANDROID32
cosmetic->modules.push_back(new Module("No Player Rotation", "no-rot", "Disables rotation on players"));
#endif
Expand All @@ -128,7 +138,6 @@ class ClientUtils
#endif

//cosmetic->modules.push_back(new Module("No Camera Movement", "no-camera", "Disables camera movements that are made with <cl>triggers</c>"));
cosmetic->modules.push_back(new Module("No Camera Shake", "no-shake", "Disables camera shake globally"));
//cosmetic->modules.push_back(new Module("No Player Rotation", "no-plr-rot", "Disables Player Rotation :3\nIt looks ugly imo but you do you"));

Client::instance->windows.push_back(cosmetic);
Expand Down Expand Up @@ -174,10 +183,9 @@ class ClientUtils
replay->modules.push_back(new StatusScale());

replay->modules.push_back(new Module("Testmode", "status-testmode", "Show the test mode text if there's a startpos"));
//replay->modules.push_back(new Module("Cheat Indicator", "", ""));
replay->modules.push_back(new Module("FPS Counter", "status-fps", "Shows your current game fps"));
//replay->modules.push_back(new Module("Noclip Deaths", "status-death", "Shows your death count (hidden when noclip is disabled)"));
//replay->modules.push_back(new Module("Noclip Accuracy", "status-accuracy", "Shows your death accuracy (hidden when noclip is disabled)"));
replay->modules.push_back(new Module("Noclip Deaths (not fully accurate)", "status-death", "Shows your death count (hidden when noclip is disabled)"));
replay->modules.push_back(new Module("Noclip Accuracy", "status-accuracy", "Shows your death accuracy (hidden when noclip is disabled)"));
//replay->modules.push_back(new Module("Attempts", "status-attempts", "Shows your attempt count"));
//replay->modules.push_back(new Module("Clicks", "status-clicks", "Shows your click count"));
//replay->modules.push_back(new Module("Message", "status-message", "Write a message of your choice to be shown"));
Expand Down
5 changes: 5 additions & 0 deletions src/Client/Dropdown.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#pragma once

#include "Client.h"

class Client;
class SaveMacroPopup;

#include <Geode/Geode.hpp>
#include "CCContentSizeTo.h"
#include "ClippingNode.h"
Expand Down
29 changes: 28 additions & 1 deletion src/Client/Module.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once

#include "ColourUtility.h"
#include "DrawUtils.h"

#include "../Layers/ColouredAlertLayer.h"

using namespace geode::prelude;

class Module
Expand Down Expand Up @@ -32,13 +36,15 @@ class Module
this->load();
}

Module(std::string n, std::string i, std::string d, bool _def = false)
Module(std::string n, std::string i, std::string d, bool _def = false, std::string a = "", bool as = false)
{
name = n;
id = i;
description = d;
enabled = false;
def = _def;
useAlert = as;
alert = a;

this->load();
}
Expand All @@ -55,7 +61,13 @@ class Module
std::string name;
std::string id;
std::string description;
std::string alert;
bool enabled;
bool useAlert;
bool onceAlert;

bool vAlert;

bool def;
float value = 1.0f;

Expand Down Expand Up @@ -128,6 +140,21 @@ class Module
{
auto dat = static_cast<Module*>(static_cast<CCNode*>(sender)->getUserData());

log::info("alert: {}", dat->alert.c_str());

if (dat->useAlert && !dat->vAlert)
{
//create(FLAlertLayerProtocol* delegate, char const* title, gd::string desc, char const* btn1, char const* btn2, float width, bool scroll, float height, float textScale)
//ColouredAlertLayer::addToScene(dat->name, dat->alert);
FLAlertLayer::create(dat->name.c_str(), dat->alert.c_str(), "OK")->show();

dat->vAlert = true;

as<CCMenuItemToggler*>(sender)->toggle(!as<CCMenuItemToggler*>(sender)->isToggled());

return;
}

dat->enabled = !dat->enabled;
dat->save();

Expand Down
Loading

0 comments on commit 2472743

Please sign in to comment.