From beaee533fa135ef3d6bd7cd5d58aa9660d75ac55 Mon Sep 17 00:00:00 2001 From: Explodingbill Date: Fri, 30 Aug 2024 18:38:35 +1000 Subject: [PATCH] percentage --- changelog.md | 1 + src/Client/ClientSetup.h | 1 + src/Labels/Labels.cpp | 9 ++++++++- src/Labels/Labels.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index bafb27f..c512d71 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # 1.6.3 - Fixed Custom Message Label text being cut off to 12 characters +- Added **Percentage Label** - Ported **Show Trajectory** to 2.206 - This is a COMPLETE REWRITE of Show Trajectory, Fixing many issues such as portals activating early and the trail disappearing sometimes diff --git a/src/Client/ClientSetup.h b/src/Client/ClientSetup.h index de7fbb0..12bbcd3 100644 --- a/src/Client/ClientSetup.h +++ b/src/Client/ClientSetup.h @@ -406,6 +406,7 @@ class ClientUtils replay->modules.push_back(new Module("CPS Counter", "status-cps", "Shows your clicks per second. Tints Green 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 Module("Percentage", "status-percentage", "Copies the text from the percentage label")); //replay->modules.push_back(new StatusMessage()); diff --git a/src/Labels/Labels.cpp b/src/Labels/Labels.cpp index d5de291..1ffd614 100644 --- a/src/Labels/Labels.cpp +++ b/src/Labels/Labels.cpp @@ -35,7 +35,7 @@ bool StatusNode::init() bottomRight->setID("bottom-right"); this->addChild(bottomRight); - int count = 11; + int count = 12; for (size_t i = 0; i < count; i++) { @@ -237,6 +237,9 @@ void StatusNode::update(float dt) if (!clock) clock = Client::GetModule("status-clock"); + + if (!percentage) + percentage = Client::GetModule("status-percentage"); if (!attPL) attPL = static_cast(GJBaseGameLayer::get()); @@ -262,6 +265,7 @@ void StatusNode::update(float dt) sLabels[8]->setVisible(cpsM->enabled); sLabels[9]->setVisible(bestRun->enabled); sLabels[10]->setVisible(clock->enabled); + sLabels[11]->setVisible(percentage->enabled); if (PlayLayer::get()) { @@ -335,6 +339,9 @@ void StatusNode::update(float dt) sLabels[10]->setString(formatTime().c_str()); + if (bestRunPlayLayer && bestRunPlayLayer->m_percentageLabel) + sLabels[11]->setString(bestRunPlayLayer->m_percentageLabel->getString()); + updateVis(); } diff --git a/src/Labels/Labels.h b/src/Labels/Labels.h index 542b2e6..a203794 100644 --- a/src/Labels/Labels.h +++ b/src/Labels/Labels.h @@ -67,6 +67,7 @@ class StatusNode : public CCNode static inline Module* cpsM = nullptr; static inline Module* bestRun = nullptr; static inline Module* clock = nullptr; + static inline Module* percentage = nullptr; static inline Module* noclip = nullptr;