Skip to content

Commit

Permalink
icon fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Jan 23, 2024
1 parent 69d0c69 commit 92f13f9
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 36 deletions.
1 change: 1 addition & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"win": "2.204",
"android": "*"
},
"early-load": true,
"id": "TheSillyDoggo.Cheats",
"name": "QOLMod",
"developer": "TheSillyDoggo",
Expand Down
3 changes: 2 additions & 1 deletion src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ClientUtils
bypass->modules.push_back(new Module("Copy any level", "copy-hack", "Allows you to copy any level from the servers\nCode by Firee"));
bypass->modules.push_back(new Module("No Copy Mark", "noc-hack", "Hides the (c) mark from your levels on publish.\nCode by Firee"));
bypass->modules.push_back(new Module("Safe mode", "safe-mode", "Disables all progress on levels"));
bypass->modules.push_back(new Module("Auto Safe mode\nNOT YET IMPLEMENTED", "auto-safe-mode", "NOT YET IMPLEMENTED"));


Client::instance->windows.push_back(bypass);
Expand All @@ -84,7 +85,7 @@ 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("No Rotation", "no-rot", "Disables ALL rotation on ALL objects. This can make some levels impossible"));
cosmetic->modules.push_back(new Module("No Player Rotation", "no-rot", "Disables rotation on players"));
//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
2 changes: 1 addition & 1 deletion src/Client/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Window

for (size_t m = 0; m < modules.size(); m++)
{
modules[m]->makeAndroid(menu, {20, (menu->getContentSize().height - 20 - 20) - 15 - (35.0f * (m - 1.0f))});
modules[m]->makeAndroid(menu, {20, (menu->getContentSize().height - 20 - 20) - 7 - (28.0f * (m - 1.0f))});
}
}
};
Expand Down
3 changes: 1 addition & 2 deletions src/Hacks/ForcePlatformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using namespace geode::prelude;

/*
class $modify (PlayerObject)
{
virtual void update(float dt)
Expand All @@ -13,4 +12,4 @@ class $modify (PlayerObject)

PlayerObject::update(dt);
}
};*/
};
22 changes: 20 additions & 2 deletions src/Hacks/UnlockHacks.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/GameStatsManager.hpp>
#include <Geode/modify/GameManager.hpp>
#include "../Client/Client.h"

using namespace geode::prelude;
Expand All @@ -8,13 +9,13 @@ class $modify (GameStatsManager)
{
bool isItemUnlocked(UnlockType type, int id)
{
if (Client::GetModuleEnabled("icon-bypass"))
/*if (Client::GetModuleEnabled("icon-bypass"))
{
if (type != UnlockType::GJItem)
{
return true;
}
}
}*/

if (id == 16 && Client::GetModuleEnabled("music-bypass"))
{
Expand All @@ -29,4 +30,21 @@ class $modify (GameStatsManager)
return GameStatsManager::isItemUnlocked(type, id);
}
}
};

class $modify(GameManager) {

bool isIconUnlocked(int id, IconType type) {
if (Client::GetModuleEnabled("icon-bypass"))
return true;

return GameManager::isIconUnlocked(id, type);
}

bool isColorUnlocked(int id, UnlockType type) {
if (Client::GetModuleEnabled("icon-bypass"))
return true;

return GameManager::isColorUnlocked(id, type);
}
};
79 changes: 49 additions & 30 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "include.h"
#include <Geode/modify/LoadingLayer.hpp>

bool showing = false;
#ifdef GEODE_IS_ANDROID
Expand Down Expand Up @@ -129,45 +130,63 @@ void DrawDescription()
DrawUtils::anchoredText(ImVec2(pos.x + 10, pos.y - 10 - (ImGui::CalcTextSize(Module::descMod.c_str()).y)), ImVec2(ImGui::CalcTextSize(Module::descMod.c_str()).x, ImGui::CalcTextSize(Module::descMod.c_str()).y), Module::descMod.c_str(), ImColor(255, 255, 255, 255), ImVec2(0, 0));
}

$on_mod(Loaded) {
ImGuiCocos::get().setup([] {
// this runs after imgui has been setup,
// its a callback as imgui will be re initialized when toggling fullscreen,
// so use this to setup any themes and or fonts!
bool v = false;

auto* font = ImGui::GetIO().Fonts->AddFontFromFileTTF((Mod::get()->getResourcesDir() / "verdana.ttf").string().c_str(), 32.0f);
ImGui::GetIO().FontDefault = font;
ImGui::GetIO().FontGlobalScale = 0.5f;

}).draw([] {
class $modify (LoadingLayer)
{
bool init(bool p0)
{
if (!LoadingLayer::init(p0))
return false;

if (!android)
if (!v)
{
if (client->animStatus == 0)
{
InputModule::selected = nullptr;
}
AndroidBall::position = ccp(32, CCDirector::get()->getWinSize().height / 2);

ImGuiCocos::get().setup([] {
// this runs after imgui has been setup,
// its a callback as imgui will be re initialized when toggling fullscreen,
// so use this to setup any themes and or fonts!

if (ImGui::IsMouseDown(ImGuiMouseButton_Left))
InputModule::selected = nullptr;
auto* font = ImGui::GetIO().Fonts->AddFontFromFileTTF((Mod::get()->getResourcesDir() / "verdana.ttf").string().c_str(), 32.0f);
ImGui::GetIO().FontDefault = font;
ImGui::GetIO().FontGlobalScale = 0.5f;

client->animStatus += ((showing ? 1 : -1) * ImGui::GetIO().DeltaTime) / 0.25f;
client->animStatus = clampf(client->animStatus, 0, 1);
}).draw([] {

client->draw();
if (!android)
{
if (client->animStatus == 0)
{
InputModule::selected = nullptr;
}

if (!showing)
ImGui::GetIO().WantCaptureMouse = false;
if (ImGui::IsMouseDown(ImGuiMouseButton_Left))
InputModule::selected = nullptr;

if (showing)
{
if (Module::descMod != "")
DrawDescription();
}
client->animStatus += ((showing ? 1 : -1) * ImGui::GetIO().DeltaTime) / 0.25f;
client->animStatus = clampf(client->animStatus, 0, 1);

ImGui::End();
client->draw();

if (!showing)
ImGui::GetIO().WantCaptureMouse = false;

if (showing)
{
if (Module::descMod != "")
DrawDescription();
}

ImGui::End();
}
});

v = true;
}
});
}

return true;
}
};

#endif

0 comments on commit 92f13f9

Please sign in to comment.