| 99 | } |
| 100 | |
| 101 | void addPinButton() { |
| 102 | auto rightMenu = this->getChildByIDRecursive("right-side-menu"); |
| 103 | if (!rightMenu) return; |
| 104 | |
| 105 | Build<CCSprite>::create("button-pin-level.png"_spr) |
| 106 | .intoMenuItem([this] { |
| 107 | globed::confirmPopup("Globed", "Are you sure you want to <cy>pin</c> this level to the <cg>current room</c>?", "Cancel", "Yes", [this](auto*) { |
| 108 | NetworkManagerImpl::get().sendUpdatePinnedLevel( |
| 109 | RoomManager::get().makeSessionId(m_level->m_levelID).asU64() |
| 110 | ); |
| 111 | }); |
| 112 | }) |
| 113 | .id("pin-level-btn"_spr) |
| 114 | .parent(rightMenu); |
| 115 | |
| 116 | rightMenu->updateLayout(); |
| 117 | } |
| 118 | |
| 119 | $override |
| 120 | void onPlay(CCObject* s) { |
nothing calls this directly
no test coverage detected