Skip to content

Commit a04f8b3

Browse files
committed
backup changes
1 parent 2053804 commit a04f8b3

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/Manager.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class Manager {
2525

2626
bool hasPRNTSCRN = false;
2727
bool hasNextKeyWhenLoaded = false;
28+
bool deathAnimationsFromZilko = false;
29+
2830
bool addedNextKeyWhenLabel = false;
31+
int selectedDeathAnimation = -1;
2932

3033
float lastDeathPercent = -10.f;
3134

src/MenuLayer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class $modify(MyMenuLayer, MenuLayer) {
2323
manager->completedJDDNCheck = true;
2424
manager->hasNextKeyWhenLoaded = Loader::get()->isModLoaded("alphalaneous.next_key_when");
2525
manager->hasPRNTSCRN = Loader::get()->isModLoaded("ninxout.prntscrn");
26+
manager->deathAnimationsFromZilko = Loader::get()->isModLoaded("zilko.death_animations");
2627
return true;
2728
}
2829
};

src/PlayLayer.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class $modify(MyPlayLayer, PlayLayer) {
6060

6161
return CCEaseElasticOut::create(action, easingRate);
6262
}
63+
void setupHasCompleted() {
64+
PlayLayer::setupHasCompleted();
65+
if (!manager->deathAnimationsFromZilko) return;
66+
manager->selectedDeathAnimation = Loader::get()->getLoadedMod("zilko.death_animations")->getSavedValue<int64_t>("selected-animation");
67+
}
6368
void resetLevel() {
6469
PlayLayer::resetLevel();
6570
manager->addedNextKeyWhenLabel = false;
@@ -150,11 +155,6 @@ class $modify(MyPlayLayer, PlayLayer) {
150155
bool isFromZilkoMod = false;
151156
const bool isNewBest = MyPlayLayer::didPlayerDieAtNewBest();
152157

153-
if (CCNode* deathAnim = this->getChildByID("zilko.death_animations/death-animation"); deathAnim && deathAnim->getTag() == 23) {
154-
if (CCNode* crl = deathAnim->getChildByID("reward-layer"); crl && getModBool("currencyLayer")) crl->setVisible(false);
155-
newBestNodeProbably = deathAnim->getChildByID("container");
156-
isFromZilkoMod = true;
157-
}
158158
for (int i = static_cast<int>(getChildrenCount() - 1); i >= 0; i--) {
159159
// NEW [good]: int i = getChildrenCount() - 1; i >= 0; i--
160160
// ORIG [bad]: int i = getChildrenCount(); i-- > 0;
@@ -173,9 +173,14 @@ class $modify(MyPlayLayer, PlayLayer) {
173173
if (theLastCCNode->getZOrder() != 100) continue;
174174
if (theLastCCNode->getChildrenCount() < 2) continue;
175175
if (getModBool("noVisibleNewBest")) return theLastCCNode->setVisible(false);
176-
if (!isFromZilkoMod) newBestNodeProbably = theLastCCNode;
176+
if (!manager->deathAnimationsFromZilko) newBestNodeProbably = theLastCCNode;
177177
else theLastCCNode->setVisible(false);
178-
break;
178+
if (newBestNodeProbably) break;
179+
if (manager->deathAnimationsFromZilko && theLastCCNode->getID() == "zilko.death_animations/death-animation" && theLastCCNode->getTag() == 23) {
180+
if (CCNode* crl = theLastCCNode->getChildByID("reward-layer"); crl && getModBool("currencyLayer")) crl->setVisible(false);
181+
newBestNodeProbably = theLastCCNode->getChildByID("container");
182+
isFromZilkoMod = true;
183+
}
179184
}
180185

181186
if (!newBestNodeProbably || newBestNodeProbably->getUserObject("modified-already"_spr)) return;

0 commit comments

Comments
 (0)