Skip to content

Commit

Permalink
nyaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 27, 2024
1 parent 7262972 commit 1b80e4d
Show file tree
Hide file tree
Showing 21 changed files with 277 additions and 429 deletions.
23 changes: 9 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ file(GLOB SOURCES
src/*/*/*.cpp
)

#if ("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS" OR IOS)
# src/*.mm
# src/*/*.mm
# src/*/*/*.mm
#endif()
file(GLOB OBJC_SOURCES
src/*.mm
src/*/*.mm
src/*/*/*.mm
)

add_library(${PROJECT_NAME} SHARED ${SOURCES})

Expand All @@ -44,15 +44,10 @@ endif()
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
include_directories(include)

file(READ "modules.txt" MODULES_CONTENT)
add_definitions(-DSTATUS_TEXTS)

string(REGEX REPLACE "\n$" "" MODULES_CONTENT "${MODULES_CONTENT}")
string(REPLACE "\n" ";" MODULES_LIST "${MODULES_CONTENT}")
CPMAddPackage("gh:matcool/gd-imgui-cocos#09a9555")

foreach(MODULE ${MODULES_LIST})
if(NOT MODULE MATCHES "^//")
add_definitions(-D${MODULE})
endif()
endforeach()
target_link_libraries(${PROJECT_NAME} imgui-cocos)

setup_geode_mod(${PROJECT_NAME})
setup_geode_mod(${PROJECT_NAME})
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.6.1

- Fixed game loading slowly if speedhack was turned to really low (<0.01)
- Fixed Editor Wave Trail changing the position while not the wave
- Transparent BG Now updates live when you change it
- Added **Hide Pause Menu**
- Added **Auto Clicker**

# 1.6.0

- Fixed Transparent BG not working on apple devices
Expand Down
33 changes: 32 additions & 1 deletion src/Client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,35 @@ bool Client::handleKeybinds(enumKeyCodes key, bool isDown, bool isRepeatedKey)
}

return false;
}
}

bool Client::useImGuiUI()
{
return false;
}

void Client::initImGui()
{
ImGuiStyle* style = &ImGui::GetStyle();
ImGuiIO* io = &ImGui::GetIO();

io->ConfigWindowsMoveFromTitleBarOnly = true;

style->FramePadding = ImVec2(3, 6);
style->Colors[ImGuiCol_TitleBg] = ImVec4(20.0f / 255, 20.0f / 255, 20.0f / 255, 1);
}

void Client::drawImGui()
{
for (auto window : windows)
{
window->drawImGui();
}

ImGui::ShowStyleEditor();
}

void Client::sortWindows()
{

}
6 changes: 6 additions & 0 deletions src/Client/Client.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <imgui-cocos.hpp>
#include "../Defines/Platform.h"

#include "Types/InputModule.hpp"
Expand Down Expand Up @@ -37,6 +38,11 @@ class Client
static Client* get();

bool handleKeybinds(enumKeyCodes key, bool isDown, bool isRepeatedKey);

bool useImGuiUI();
void initImGui();
void drawImGui();
void sortWindows();

//[[deprecated("GetModuleEnabled has been deprecated due to lag, please rember to cache the module :3")]]
static bool GetModuleEnabled(std::string id)
Expand Down
31 changes: 21 additions & 10 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ClientUtils
Window* speedhack = new Speedhack();
speedhack->name = "Speedhack";
speedhack->id = "speedhack-window";
speedhack->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 2, 50);
//speedhack->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 2, 50);

speedhack->modules.push_back(new SpeedhackTop());
speedhack->modules.push_back(new SpeedhackEnabled());
Expand All @@ -73,7 +73,7 @@ class ClientUtils
Window* level = new Level();
level->name = "Level";
level->id = "level-window";
level->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 1, 50);
//level->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 1, 50);

level->modules.push_back(new Module("Noclip", "noclip", "Prevents the player from dying"));
level->modules.push_back(new Module("Instant Complete", "instant", "Instantly completes a level.\nMay not work because of the <cg>Geometry Dash</c> anti-cheat.\nUsing this cheat on a <co>rated level</c> <cr>WILL GET YOU LEADERBOARD BANNED</c>", false, "<cr>Warning!</c>\nUsing this cheat on a <co>rated level</c> <cr>WILL GET YOU LEADERBOARD BANNED</c>", true));
Expand Down Expand Up @@ -122,6 +122,8 @@ class ClientUtils

level->modules.push_back(new Module("Suicide", "you-should-kill-yourself-now", "Kills the player instantly"));
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("Frame Stepper", "frame-stepper", "Step the game through frames by tapping a button"));


Expand Down Expand Up @@ -162,14 +164,21 @@ class ClientUtils
//Client::GetModule("smart-startpos")->optionSizeForce = Client::GetModule("smart-startpos")->options[0]->sizeForOptionsPage();

Client::GetModule("custom-respawn-time")->options.push_back(new InputModule("Delay:", "respawn-time-delay", "4.2069"));

Client::GetModule("auto-clicker")->options.push_back(new InputModule("Interval", "auto-clicker-delay", "6"));
Client::GetModule("auto-clicker")->options.push_back(new InputModule("Hold For", "auto-clicker-hold-for", "3"));
Client::GetModule("auto-clicker")->options.push_back(new Module("Player 1", "auto-clicker-player1", "Should it click for player 1", true));
Client::GetModule("auto-clicker")->options.push_back(new Module("Player 2", "auto-clicker-player2", "Should it click for player 2", true));
as<InputModule*>(Client::GetModule("auto-clicker")->options[0])->allowedChars = "0123456789";
as<InputModule*>(Client::GetModule("auto-clicker")->options[1])->allowedChars = "0123456789";
}

static void SetupBypass()
{
Window* bypass = new Window();
bypass->name = "Bypass";
bypass->id = "bypass-window";
bypass->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);
//bypass->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);

//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 @@ -181,7 +190,7 @@ class ClientUtils
Window* bypass = new Universal();
bypass->name = "Universal";
bypass->id = "universal-window";
bypass->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);
//bypass->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);


bypass->modules.push_back(new Module("Practice Music Sync", "practice-bypass", "Unlocks the Practice Music Sync button in the pause menu options"));
Expand Down Expand Up @@ -213,6 +222,8 @@ class ClientUtils

bypass->modules.push_back(new Module("Show Touches", "show-touches", "Shows a circle on the screen whenever you touch"));
bypass->modules.push_back(new Module("Auto LDM", "auto-ldm", "Automatically enable Low Detail Mode in levels when you view them"));

bypass->modules.push_back(new Module("Hide Pause Menu", "hide-pause-menu", "Hides the pause menu :3"));

Client::instance->windows.push_back(bypass);

Expand All @@ -235,7 +246,7 @@ class ClientUtils
Window* creator = new Window();
creator->name = "Creator";
creator->id = "creator-window";
creator->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);
//creator->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 0, 50);

creator->modules.push_back(new SetValueModule("Set Scale:", "set-scale"));
creator->modules.push_back(new SetValueModule("Set Rotation:", "set-rot"));
Expand Down Expand Up @@ -278,7 +289,7 @@ class ClientUtils
Window* cosmetic = new Window();
cosmetic->name = "Cosmetic";
cosmetic->id = "cosmetic-window";
cosmetic->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 3, 50);
//cosmetic->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 3, 50);

//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"));
Expand Down Expand Up @@ -357,7 +368,7 @@ class ClientUtils
Window* misc = new Window();
misc->name = "Misc";
misc->id = "misc-window";
misc->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 4, 50);
//misc->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 4, 50);

//misc->modules.push_back(new Module("Use Full Options", "full-options", "Opens the full options menu instead of the mini options in the pause menu.\nAlso adds a button to the normal pause menu to open the mini options."));

Expand Down Expand Up @@ -448,7 +459,7 @@ class ClientUtils
Window* replay = new Window();
replay->name = "Config";
replay->id = "options-window";
replay->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 4, 50);
//replay->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 4, 50);

if (android)
{
Expand Down Expand Up @@ -488,7 +499,7 @@ class ClientUtils
Window* theming = new Window();
theming->name = "Theming";
theming->id = "themes-window";
theming->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 5, 50);
//theming->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 5, 50);

theming->modules.push_back(new ColourModule("Accent", "accent-colour", ccc3(10, 0, 0)));

Expand All @@ -502,7 +513,7 @@ class ClientUtils
Window* devtools = new Window();
devtools->name = "Developer";
devtools->id = "devtools-window";
devtools->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 5, 50);
//devtools->windowPos = ccp(50 + (50 + (Client::instance->tileSize.x)) * 5, 50);

devtools->modules.push_back(new Module("Recompile Shader", "recomp-shaders", "Recompiles blur shader"));

Expand Down
55 changes: 8 additions & 47 deletions src/Client/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,12 @@

#include "../Layers/ModuleOptionsLayer.h"
#include "Dropdown.h"
#include "../UI/PCDrawUtils.hpp"

bool Module::touchBegan(CCPoint point, CCTouch* touch)
void Module::drawImGui()
{
if (CCRectMake(0, 0, Client::tileSize.x, Client::tileSize.y).containsPoint(point))
{
log::info("id: {}", id);
mouseHeldDown = true;

return true;
}

return false;
}

bool Module::touchMoved(CCPoint point, CCTouch* touch)
{
return false;
}

bool Module::touchEndedOrCancelled(CCPoint point, CCTouch* touch, bool cancelled)
{
if (mouseHeldDown)
{
enabled = !enabled;
save();
onChange();

if (enabled)
enableHooks();
else
disableHooks();

if (enabled)
enablePatches();
else
disablePatches();

mouseHeldDown = false;
}

return false;
}


void Module::drawModule(CCPoint pointTopLeft)
{
PCDrawUtils::drawRect(pointTopLeft, Client::tileSize, ccc4(0, 0, 255, 255));
ImGui::Button(this->name.c_str());
}


void Module::onOptionsAndroid(CCObject* sender)
{
auto dat = static_cast<Module*>(static_cast<CCNode*>(sender)->getUserData());
Expand Down Expand Up @@ -87,6 +42,9 @@ void Module::onToggleAndroid(CCObject* sender)
else
disableHooks();

if (onToggle)
onToggle(enabled);

return;
}

Expand Down Expand Up @@ -115,6 +73,9 @@ void Module::onToggleAndroid(CCObject* sender)
dat->enableHooks();
else
dat->disableHooks();

if (dat->onToggle)
dat->onToggle(dat->enabled);
}

void Module::makeAndroid(CCNode* menu, CCPoint pos)
Expand Down
15 changes: 4 additions & 11 deletions src/Client/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class Module : public UIComponent

bool mouseHeldDown = false;

geode::utils::MiniFunction<void(bool)> onToggle;
ModuleChangeDelegate* delegate = nullptr;

CCSize optionSizeForce = CCSizeZero;

void addHookRaw(Result<Hook*> hook);
Expand All @@ -65,6 +67,8 @@ class Module : public UIComponent
void disablePatches();
void enablePatches();

virtual void drawImGui();

Module()
{

Expand Down Expand Up @@ -95,17 +99,6 @@ class Module : public UIComponent

// options
CCSize sizeForOptionsPage();


/// @brief
/// @param point the position of the touch relative to where the module should be drawn
/// @param touch touch
/// @return should stop input passing to gd
bool touchBegan(CCPoint point, CCTouch* touch);
bool touchMoved(CCPoint point, CCTouch* touch);
bool touchEndedOrCancelled(CCPoint point, CCTouch* touch, bool cancelled);

void drawModule(CCPoint pointTopLeft);

virtual void onChange()
{
Expand Down
Loading

0 comments on commit 1b80e4d

Please sign in to comment.