replace usages of getChildOfType
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions

This commit is contained in:
Chloe 2024-10-30 14:04:18 -07:00
parent bd8387df1b
commit 452b09678c
No known key found for this signature in database
GPG key ID: D2D404DD810FE0E3
2 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ namespace geode::node_ids {
return child; return child;
} }
} else { } else {
if (auto child = cocos::getChildOfType<T>(node, index)) { if (auto child = node->getChildByType<T>(index)) {
child->setID(id); child->setID(id);
return child; return child;
} }

View file

@ -48,7 +48,7 @@ $register_ids(MenuLayer) {
setIDSafe<CCLabelBMFont>(this, labelOffset++, "player-username"); setIDSafe<CCLabelBMFont>(this, labelOffset++, "player-username");
// main menu // main menu
if (auto menu = getChildOfType<CCMenu>(this, 0)) { if (auto menu = this->getChildByType<CCMenu>(0)) {
menu->setID("main-menu"); menu->setID("main-menu");
auto playBtn = setIDSafe(menu, 0, "play-button"); auto playBtn = setIDSafe(menu, 0, "play-button");
auto iconBtn = setIDSafe(menu, 1, "icon-kit-button"); auto iconBtn = setIDSafe(menu, 1, "icon-kit-button");
@ -83,7 +83,7 @@ $register_ids(MenuLayer) {
} }
// bottom menu // bottom menu
if (auto menu = getChildOfType<CCMenu>(this, 1)) { if (auto menu = this->getChildByType<CCMenu>(1)) {
menu->setID("bottom-menu"); menu->setID("bottom-menu");
auto ach = setIDSafe(menu, 0, "achievements-button"); auto ach = setIDSafe(menu, 0, "achievements-button");
setIDSafe(menu, 1, "settings-button"); setIDSafe(menu, 1, "settings-button");
@ -110,7 +110,7 @@ $register_ids(MenuLayer) {
} }
// social media menu // social media menu
if (auto menu = getChildOfType<CCMenu>(this, 2)) { if (auto menu = this->getChildByType<CCMenu>(2)) {
menu->setID("social-media-menu"); menu->setID("social-media-menu");
setIDSafe(menu, 0, "robtop-logo-button"); setIDSafe(menu, 0, "robtop-logo-button");
setIDSafe(menu, 1, "facebook-button"); setIDSafe(menu, 1, "facebook-button");
@ -121,7 +121,7 @@ $register_ids(MenuLayer) {
} }
// more games menu // more games menu
if (auto menu = getChildOfType<CCMenu>(this, 3)) { if (auto menu = this->getChildByType<CCMenu>(3)) {
menu->setID("more-games-menu"); menu->setID("more-games-menu");
auto moreGamesBtn = setIDSafe(menu, 0, "more-games-button"); auto moreGamesBtn = setIDSafe(menu, 0, "more-games-button");