Skip to content

Commit

Permalink
fix PauseLayer on 2.200
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Feb 11, 2024
1 parent 87cdd7e commit b335565
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions src/PauseLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,43 @@ CCNode* getChildBySpriteFrameName(CCNode* parent, const char* name) {
++idx;
}

setIDs(menu, idx, "practice-button", "play-button", "exit-button", "retry-button", "options-button");
if (auto* node = getChildBySpriteFrameName(menu, "GJ_menuBtn_001.png")) {
node->setID("exit-button");
++idx;
}

if (auto* node = getChildBySpriteFrameName(menu, "GJ_menuBtn_001.png")) {
node->setID("exit-button");
++idx;
}

auto options = menu->getChildByID("options-button");
options->removeFromParentAndCleanup(false);
rightMenu->addChild(options);
rightMenu->updateLayout();
if (auto* node = getChildBySpriteFrameName(menu, "GJ_normalBtn_001.png")) {
node->setID("practice-button");
++idx;
}

if (auto* node = getChildBySpriteFrameName(menu, "GJ_practiceBtn_001.png")) {
node->setID("practice-button");
++idx;
}

if (auto* node = getChildBySpriteFrameName(menu, "GJ_playBtn2_001.png")) {
node->setID("play-button");
++idx;
}

if (auto* node = getChildBySpriteFrameName(menu, "GJ_replayBtn_001.png")) {
node->setID("retry-button");
++idx;
}

if (auto* node = getChildBySpriteFrameName(menu, "GJ_optionsBtn_001.png")) {
node->setID("options-button");
node->removeFromParentAndCleanup(false);
rightMenu->addChild(node);
rightMenu->updateLayout();
++idx;
}
}
}

Expand Down

0 comments on commit b335565

Please sign in to comment.