Skip to content

Commit

Permalink
dddddd
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 11, 2024
1 parent 4e8cf58 commit 3e98223
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 2 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
- Fixed Crash With All Modes Platformer
- Fixed Crash when tapping really early on the loading screen with Show Touches enabled
- Made Pause Countdown have a minimum countdown of 1 second
- Added A Pause Button to the Pause Countdown menu to repause the game on mobile
- Added The Pause Button to the Pause Countdown menu to repause the game on mobile
- Added **Clock Label**

# 1.5.5

Expand Down
1 change: 1 addition & 0 deletions src/Client/ClientSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ class ClientUtils
replay->modules.push_back(new Module("Session Time", "status-session", "Shows the time you've had the game open for in the format <cg>hh::mm::ss</c>"));
replay->modules.push_back(new Module("CPS Counter", "status-cps", "Shows your clicks per second. Tints <cg>Green</c> while you are clicking"));
replay->modules.push_back(new Module("Best Run", "best-run", "Shows your best run"));
replay->modules.push_back(new Module("Clock", "status-clock", "Shows your current device time"));
//replay->modules.push_back(new StatusMessage());


Expand Down
Empty file.
8 changes: 8 additions & 0 deletions src/Hacks/Frame Stepper/GameObjectHook.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*#pragma once
#include <Geode/Geode.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include "../../Client/Client.h"
using namespace geode::prelude;*/
14 changes: 14 additions & 0 deletions src/Hacks/Frame Stepper/ParticleSystemHook.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*#pragma once
#include <Geode/Geode.hpp>
#include <Geode/modify/CCParticleSystem.hpp>
#include "../../Client/Client.h"
using namespace geode::prelude;
class $modify (SteppedParticleSystem, CCParticleSystem)
{
bool shouldStepFrame();
virtual void update(float dt);
};*/
5 changes: 5 additions & 0 deletions src/Hacks/StartposSwitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Geode/modify/UILayer.hpp>
#include "../Client/Client.h"
#include "../Layers/EditPositionLayer.hpp"
#include "../Labels/BestRun.hpp"

using namespace geode::prelude;

Expand Down Expand Up @@ -46,9 +47,13 @@ class $modify (StartposPlayLayer, PlayLayer)
if (m_isPracticeMode)
resetLevelFromStart();

base_cast<BestPlayLayer*>(this)->m_fields->ignoreBest = true;

resetLevel();
startMusic();

base_cast<BestPlayLayer*>(this)->m_fields->ignoreBest = false;

updateUI();
}

Expand Down
3 changes: 3 additions & 0 deletions src/Labels/BestRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

void BestPlayLayer::resetLevel()
{
if (m_fields->ignoreBest)
return PlayLayer::resetLevel();

m_fields->toPercent = getCurrentPercent();

auto length = m_fields->toPercent - m_fields->fromPercent;
Expand Down
2 changes: 2 additions & 0 deletions src/Labels/BestRun.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class $modify (BestPlayLayer, PlayLayer)
float bestFrom;
float bestTo;
float bestLength;

bool ignoreBest;
};

void resetLevel();
Expand Down
8 changes: 7 additions & 1 deletion src/Labels/Labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool StatusNode::init()
bottomRight->setID("bottom-right");
this->addChild(bottomRight);

int count = 10;
int count = 11;

for (size_t i = 0; i < count; i++)
{
Expand Down Expand Up @@ -234,6 +234,9 @@ void StatusNode::update(float dt)

if (!bestRun)
bestRun = Client::GetModule("best-run");

if (!clock)
clock = Client::GetModule("status-clock");

if (!attPL)
attPL = static_cast<AttemptBaseGameLayer*>(GJBaseGameLayer::get());
Expand All @@ -258,6 +261,7 @@ void StatusNode::update(float dt)
sLabels[7]->setVisible(session->enabled);
sLabels[8]->setVisible(cpsM->enabled);
sLabels[9]->setVisible(bestRun->enabled);
sLabels[10]->setVisible(clock->enabled);

if (PlayLayer::get())
{
Expand Down Expand Up @@ -329,6 +333,8 @@ void StatusNode::update(float dt)
else
sLabels[9]->setString("Best Run: Editor");

sLabels[10]->setString(formatTime().c_str());

updateVis();
}

Expand Down
23 changes: 23 additions & 0 deletions src/Labels/Labels.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#include <Geode/modify/LevelEditorLayer.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include "BestRun.hpp"
#include <chrono>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <sstream>
#include "../Client/Client.h"

using namespace geode::prelude;
Expand Down Expand Up @@ -61,6 +66,7 @@ class StatusNode : public CCNode
static inline Module* session = nullptr;
static inline Module* cpsM = nullptr;
static inline Module* bestRun = nullptr;
static inline Module* clock = nullptr;

static inline Module* noclip = nullptr;

Expand Down Expand Up @@ -106,6 +112,23 @@ class StatusNode : public CCNode
return formattedTime.str();
}

std::string formatTime() {
// Get current time
std::time_t currentTime = std::time(nullptr);

// Convert to local time
std::tm* localTime = std::localtime(&currentTime);

// Create a string stream to format the time
std::ostringstream oss;

// Format time as HH:MM:SS AM/PM
oss << std::put_time(localTime, "%I:%M:%S %p");

// Return the formatted time as a string
return oss.str();
}


bool init();

Expand Down

0 comments on commit 3e98223

Please sign in to comment.