Skip to content

Commit 3e98223

Browse files
committed
dddddd
1 parent 4e8cf58 commit 3e98223

File tree

10 files changed

+65
-2
lines changed

10 files changed

+65
-2
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
- Fixed Crash With All Modes Platformer
66
- Fixed Crash when tapping really early on the loading screen with Show Touches enabled
77
- Made Pause Countdown have a minimum countdown of 1 second
8-
- Added A Pause Button to the Pause Countdown menu to repause the game on mobile
8+
- Added The Pause Button to the Pause Countdown menu to repause the game on mobile
9+
- Added **Clock Label**
910

1011
# 1.5.5
1112

src/Client/ClientSetup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ class ClientUtils
383383
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>"));
384384
replay->modules.push_back(new Module("CPS Counter", "status-cps", "Shows your clicks per second. Tints <cg>Green</c> while you are clicking"));
385385
replay->modules.push_back(new Module("Best Run", "best-run", "Shows your best run"));
386+
replay->modules.push_back(new Module("Clock", "status-clock", "Shows your current device time"));
386387
//replay->modules.push_back(new StatusMessage());
387388

388389

src/Hacks/Frame Stepper/FrameStepper.hpp

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*#pragma once
2+
3+
#include <Geode/Geode.hpp>
4+
#include <Geode/modify/PlayLayer.hpp>
5+
#include <Geode/modify/GJBaseGameLayer.hpp>
6+
#include "../../Client/Client.h"
7+
8+
using namespace geode::prelude;*/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*#pragma once
2+
3+
#include <Geode/Geode.hpp>
4+
#include <Geode/modify/CCParticleSystem.hpp>
5+
#include "../../Client/Client.h"
6+
7+
using namespace geode::prelude;
8+
9+
class $modify (SteppedParticleSystem, CCParticleSystem)
10+
{
11+
bool shouldStepFrame();
12+
13+
virtual void update(float dt);
14+
};*/

src/Hacks/StartposSwitcher.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Geode/modify/UILayer.hpp>
44
#include "../Client/Client.h"
55
#include "../Layers/EditPositionLayer.hpp"
6+
#include "../Labels/BestRun.hpp"
67

78
using namespace geode::prelude;
89

@@ -46,9 +47,13 @@ class $modify (StartposPlayLayer, PlayLayer)
4647
if (m_isPracticeMode)
4748
resetLevelFromStart();
4849

50+
base_cast<BestPlayLayer*>(this)->m_fields->ignoreBest = true;
51+
4952
resetLevel();
5053
startMusic();
5154

55+
base_cast<BestPlayLayer*>(this)->m_fields->ignoreBest = false;
56+
5257
updateUI();
5358
}
5459

src/Labels/BestRun.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
void BestPlayLayer::resetLevel()
44
{
5+
if (m_fields->ignoreBest)
6+
return PlayLayer::resetLevel();
7+
58
m_fields->toPercent = getCurrentPercent();
69

710
auto length = m_fields->toPercent - m_fields->fromPercent;

src/Labels/BestRun.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class $modify (BestPlayLayer, PlayLayer)
1616
float bestFrom;
1717
float bestTo;
1818
float bestLength;
19+
20+
bool ignoreBest;
1921
};
2022

2123
void resetLevel();

src/Labels/Labels.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bool StatusNode::init()
3535
bottomRight->setID("bottom-right");
3636
this->addChild(bottomRight);
3737

38-
int count = 10;
38+
int count = 11;
3939

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

235235
if (!bestRun)
236236
bestRun = Client::GetModule("best-run");
237+
238+
if (!clock)
239+
clock = Client::GetModule("status-clock");
237240

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

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

336+
sLabels[10]->setString(formatTime().c_str());
337+
332338
updateVis();
333339
}
334340

src/Labels/Labels.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
#include <Geode/modify/LevelEditorLayer.hpp>
99
#include <Geode/modify/GJBaseGameLayer.hpp>
1010
#include "BestRun.hpp"
11+
#include <chrono>
12+
#include <iostream>
13+
#include <iomanip>
14+
#include <ctime>
15+
#include <sstream>
1116
#include "../Client/Client.h"
1217

1318
using namespace geode::prelude;
@@ -61,6 +66,7 @@ class StatusNode : public CCNode
6166
static inline Module* session = nullptr;
6267
static inline Module* cpsM = nullptr;
6368
static inline Module* bestRun = nullptr;
69+
static inline Module* clock = nullptr;
6470

6571
static inline Module* noclip = nullptr;
6672

@@ -106,6 +112,23 @@ class StatusNode : public CCNode
106112
return formattedTime.str();
107113
}
108114

115+
std::string formatTime() {
116+
// Get current time
117+
std::time_t currentTime = std::time(nullptr);
118+
119+
// Convert to local time
120+
std::tm* localTime = std::localtime(&currentTime);
121+
122+
// Create a string stream to format the time
123+
std::ostringstream oss;
124+
125+
// Format time as HH:MM:SS AM/PM
126+
oss << std::put_time(localTime, "%I:%M:%S %p");
127+
128+
// Return the formatted time as a string
129+
return oss.str();
130+
}
131+
109132

110133
bool init();
111134

0 commit comments

Comments
 (0)