Skip to content

Commit

Permalink
aaasdfasdfdsfsd
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 13, 2024
1 parent e52828d commit 627b634
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 190 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Fixed RobTop levels with the level edit fix
- Added Force Object Visibility
- Added No Glow
- Added Noclip Deaths and Noclip Accuracy
- ~~Added Noclip Deaths and Noclip Accuracy~~ it's delayed because this shits annoying to fix
- Added Alerts to the text bypasses to let the user know that they can crash
- Added Instant Restart
- Fixed Solid Wave Trail white being broken
Expand Down
176 changes: 1 addition & 175 deletions src/Client/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class Client
{
public:
static inline Client* instance = nullptr;
static MyReplay replay;

std::vector<Window*> windows;
ImVec2 tileSize = ImVec2(150, 30);
Expand Down Expand Up @@ -98,177 +97,4 @@ 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);
}
};
};
6 changes: 6 additions & 0 deletions src/Client/Replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,10 @@ struct MyReplay : gdr::Replay<MyReplay, MyInput> {
int attempts = -1;

MyReplay() : Replay("QOLBot", "1.0") {}
};

class GJReplayManager
{
public:
static inline MyReplay replay = MyReplay();
};
1 change: 1 addition & 0 deletions src/Client/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../Layers/SetupFadeSetting.h"
#include "../Layers/SetupFPSBypass.h"
#include "../Layers/SetupTransitionCustomizer.h"
#include "../Layers/SaveMacroPopup.h"
#include "../Layers/EditStatusPositionLayer.h"

class Window
Expand Down
4 changes: 0 additions & 4 deletions src/Hacks/NoDeathEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class $modify (PlayerObject)
{
void playerDestroyed(bool p0)
{
log::info("penis");

log::info("unk: {}", p0);

if (Client::GetModuleEnabled("instant-restart") && PlayLayer::get())
PlayLayer::get()->resetLevel();

Expand Down
26 changes: 17 additions & 9 deletions src/Hacks/StatusText.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifdef STATUS_TEXTS

#include <Geode/Geode.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include "../Client/Client.h"
Expand Down Expand Up @@ -86,23 +88,27 @@ class StatusNode : public CCNode

//v = as<NoclipLayer*>(PlayLayer::get());

testmode = Client::instance->windows[5]->modules[0];
fps = Client::instance->windows[5]->modules[1];
testmode = Client::GetModule("status-testmode");
fps = Client::GetModule("status-fps");
noclip = Client::GetModule("noclip");
deaths = Client::instance->windows[5]->modules[2];
accuracy = Client::instance->windows[5]->modules[3];
deaths = Client::GetModule("status-death");
accuracy = Client::GetModule("status-accuracy");
}

if (!mods)
return;

updateVis();

if (testmode->enabled && PlayLayer::get()->m_isTestMode)
WriteText("Testmode", "", Mod::get()->getSavedValue<int>("testmode_side", 0));
//if (testmode->enabled && PlayLayer::get() && PlayLayer::get()->m_isTestMode)
// log::info("penis");
//WriteText("Testmode", "", Mod::get()->getSavedValue<int>("testmode_side", 0));

//if (Client::GetModuleEnabled("status-attempt"))
//WriteText("Attempt %", std::to_string(PlayLayer::get()->));

if (fps->enabled)
WriteText("FPS: %", std::to_string((int)round(1.0f / dt)), Mod::get()->getSavedValue<int>("fps_side", 0));
//if (fps->enabled)
//WriteText("FPS: %", std::to_string((int)round(1.0f / dt)), Mod::get()->getSavedValue<int>("fps_side", 0));

if (noclip->enabled)
{
Expand Down Expand Up @@ -187,4 +193,6 @@ class $modify (PlayLayer)
this->addChild(menu, 69420);
return true;
}
};
};

#endif
1 change: 0 additions & 1 deletion src/Layers/SaveMacroPopup.cpp

This file was deleted.

Loading

0 comments on commit 627b634

Please sign in to comment.