| 71 | } |
| 72 | |
| 73 | void addLevelSendButton() { |
| 74 | auto* leftMenu = typeinfo_cast<CCMenu*>(this->getChildByIDRecursive("left-side-menu")); |
| 75 | if (!leftMenu) { |
| 76 | return; |
| 77 | } |
| 78 | |
| 79 | bool plat = m_level->isPlatformer(); |
| 80 | |
| 81 | Build<CCSprite>::create("icon-send-btn.png"_spr) |
| 82 | .with([&](auto spr) { cue::rescaleToMatch(spr, 46.f); }) |
| 83 | .intoMenuItem([this, plat] { |
| 84 | if (plat) { |
| 85 | SendFeaturePopup::create(m_level)->show(); |
| 86 | } else { |
| 87 | PopupManager::get().alert("Error", "Only <cj>Platformer levels</c> are eligible to be <cg>Globed Featured!</c>").showInstant(); |
| 88 | } |
| 89 | }) |
| 90 | .with([&](auto* btn) { |
| 91 | if (!plat) { |
| 92 | btn->setColor({100, 100, 100}); |
| 93 | } |
| 94 | }) |
| 95 | .id("send-btn"_spr) |
| 96 | .parent(leftMenu); |
| 97 | |
| 98 | leftMenu->updateLayout(); |
| 99 | } |
| 100 | |
| 101 | void addPinButton() { |
| 102 | auto rightMenu = this->getChildByIDRecursive("right-side-menu"); |