@@ -62,6 +62,7 @@ class $modify(MyPlayLayer, PlayLayer) {
6262 }
6363 void setupHasCompleted () {
6464 PlayLayer::setupHasCompleted ();
65+ manager->lastDeathPercent = -10 .f ;
6566 if (!manager->deathAnimationsFromZilko ) return ;
6667 manager->selectedDeathAnimation = Loader::get ()->getLoadedMod (" zilko.death_animations" )->getSavedValue <int64_t >(" selected-animation" );
6768 }
@@ -75,6 +76,7 @@ class $modify(MyPlayLayer, PlayLayer) {
7576 void onQuit () {
7677 PlayLayer::onQuit ();
7778 manager->lastDeathPercent = -10 .f ;
79+ manager->currentDeathPercentForQueueInMainLoader = -1 .f ;
7880 if (!manager->channel ) return ;
7981 STOP_MANAGER_CHANNEL
8082 }
@@ -145,6 +147,8 @@ class $modify(MyPlayLayer, PlayLayer) {
145147 }
146148 }
147149 void findAndModifyTheNewBestNode () {
150+ if (!getModBool (" enabled" ) || !m_level || m_level->isPlatformer () || m_isPlatformer) return ;
151+
148152 CCNode* newBestNodeProbably = nullptr ;
149153 bool hasOrbsLabel = false ;
150154 bool hasKeyLabel = false ;
@@ -184,6 +188,7 @@ class $modify(MyPlayLayer, PlayLayer) {
184188 newBestNodeProbably->setUserObject (" modified-already" _spr, CCBool::create (true ));
185189
186190 if (!isFromZilkoMod) MyPlayLayer::applyNodeTraitsCustomization (newBestNodeProbably, hasDiamondsOrOrbs);
191+ // out of respect for zilko's mod i will not be changing its duration
187192
188193 if (manager->hasNextKeyWhenLoaded && getModBool (" currencyLayer" ) && getModBool (" currencyLayerNextKeyWhenCompat" ) && !manager->addedNextKeyWhenLabel && m_level->m_stars .value () > 1 ) {
189194 if (hasOrbsLabel || isFromZilkoMod) {
@@ -222,7 +227,7 @@ class $modify(MyPlayLayer, PlayLayer) {
222227
223228 if (nodeString.ends_with (" %" ) && fontFile == " bigFont.fnt" ) {
224229 // this is the node displaying where you died as a new best
225- if (isNewBest && getModBool (" accuratePercent" )) return hopefullyALabel->setString (fmt::format (" {:.{}f}%" , getCurrentPercent () , getModInt (" accuracy" )).c_str ());
230+ if (isNewBest && getModBool (" accuratePercent" )) return hopefullyALabel->setString (fmt::format (" {:.{}f}%" , manager-> lastDeathPercent , getModInt (" accuracy" )).c_str ());
226231 // i have to do all of this because robtop's wonderful technology shows percent from previous death if i dont include all of this
227232 if (!std::regex_match (nodeString, match, manager->percentRegex )) continue ;
228233 auto percent = std::regex_replace (nodeString, std::regex (" %" ), " " );
@@ -235,7 +240,7 @@ class $modify(MyPlayLayer, PlayLayer) {
235240 log::info (" getCurrentPercentInt: {}" , currPercent);
236241
237242 if (!getModBool (" accuratePercent" )) hopefullyALabel->setString (fmt::format (" {}%" , currPercent).c_str ());
238- else hopefullyALabel->setString (fmt::format (" {:.{}f}%" , getCurrentPercent () , getModInt (" accuracy" )).c_str ());
243+ else hopefullyALabel->setString (fmt::format (" {:.{}f}%" , manager-> lastDeathPercent , getModInt (" accuracy" )).c_str ());
239244 continue ;
240245 }
241246
@@ -280,6 +285,9 @@ class $modify(MyPlayLayer, PlayLayer) {
280285 }
281286 void showNewBest (bool newReward, int orbs, int diamonds, bool demonKey, bool noRetry, bool noTitle) {
282287 PlayLayer::showNewBest (newReward, orbs, diamonds, demonKey, noRetry, noTitle);
288+ Loader::get ()->queueInMainThread ([this ]() {
289+ MyPlayLayer::findAndModifyTheNewBestNode ();
290+ });
283291 if (!getModBool (" enabled" ) || !m_player1->m_isDead || this ->m_isPracticeMode || this ->m_isTestMode || m_isPlatformer || (m_level && m_level->isPlatformer ())) return ;
284292 if (!manager->hasPRNTSCRN || !getModBool (" screenshotOnDeath" )) return ;
285293 this ->scheduleOnce (schedule_selector (MyPlayLayer::PRNTSCRNOnDeath), .24f );
0 commit comments