MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / addPinButton

Function addPinButton

src/modules/ui/hooks/LevelInfoLayer.cpp:101–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 6

confirmPopupFunction · 0.85
sendUpdatePinnedLevelMethod · 0.80
asU64Method · 0.80
makeSessionIdMethod · 0.80
getFunction · 0.50
idMethod · 0.45

Tested by

no test coverage detected