Skip to content

Commit

Permalink
cache more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Feb 12, 2024
1 parent 33ae384 commit dde18ad
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/Hacks/ForcePlatformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ class $modify (DashRingObject)

class $modify (PlayerObject)
{
bool f;

virtual void update(float dt)
{
if (Client::GetModuleEnabled("force-plat"))
{
this->togglePlatformerMode(true);
#ifdef GEODE_IS_ANDROID
//if (PlayLayer::get() && PlayLayer::get()->m_uiLayer)
// PlayLayer::get()->m_uiLayer->togglePlatformerMode(true);
if (!m_fields->f)
{
m_fields->f = true;
if (PlayLayer::get() && PlayLayer::get()->m_uiLayer)
PlayLayer::get()->m_uiLayer->togglePlatformerMode(true);
}
#endif
}

Expand Down
34 changes: 27 additions & 7 deletions src/Hacks/StatusText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ class StatusNode : public CCNode
return nullptr;
}

NoclipLayer* v;

bool mods;
Module* testmode;
Module* fps;
Module* noclip;
Module* deaths;
Module* accuracy;

CCLabelBMFont* tl;
CCLabelBMFont* tr;

Expand Down Expand Up @@ -71,27 +80,38 @@ class StatusNode : public CCNode

void update(float dt)
{
if (!mods)
{
mods = true;

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

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

updateVis();

if (Client::GetModuleEnabled("status-testmode") && PlayLayer::get()->m_isTestMode)
if (testmode->enabled && PlayLayer::get()->m_isTestMode)
WriteText("Testmode", "", Mod::get()->getSavedValue<int>("testmode_side", 0));

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

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

if (Client::GetModuleEnabled("noclip"))
if (noclip->enabled)
{
auto v = as<NoclipLayer*>(PlayLayer::get());

float acc = (((1 - ((v->m_fields->t * 1.0f) / (v->m_gameState.m_unk1f8 * 1.0f))) * 100.0f));

if (Client::GetModuleEnabled("status-accuracy"))
if (accuracy)
WriteText("Accuracy: %%", floatToString(acc), Mod::get()->getSavedValue<int>("accuracy_side", 0));

if (Client::GetModuleEnabled("status-death"))
if (deaths)
WriteText("Deaths: %", std::to_string((int)v->m_fields->t), Mod::get()->getSavedValue<int>("death_side", 0));
}
}
Expand Down

0 comments on commit dde18ad

Please sign in to comment.