Skip to content

Commit

Permalink
use standardized profile page menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jan 6, 2024
1 parent 523da70 commit 7424cee
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/hooks/ProfilePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,21 @@ class $modify(BIProfilePage, ProfilePage) {
auto GM = GameManager::sharedState();
auto winSize = CCDirector::sharedDirector()->getWinSize();

auto infoSprite = CCSprite::createWithSpriteFrameName("GJ_infoBtn_001.png");
infoSprite->setScale(0.7f);
auto infoButton = CCMenuItemSpriteExtra::create(
infoSprite,
this,
menu_selector(BIProfilePage::onProfilePageInfo)
);
infoButton->setPosition({16, -135});
infoButton->setID("info-button"_spr);
m_buttonMenu->addChild(infoButton);
if(auto leftMenu = m_mainLayer->getChildByID("left-menu")) {
auto infoSprite = CCSprite::createWithSpriteFrameName("GJ_infoBtn_001.png");
infoSprite->setScale(0.7f);
auto infoButton = CCMenuItemSpriteExtra::create(
infoSprite,
this,
menu_selector(BIProfilePage::onProfilePageInfo)
);
infoButton->setID("info-button"_spr);
leftMenu->addChild(infoButton);
this->m_buttons->addObject(infoButton);

leftMenu->updateLayout();
}

this->m_buttons->addObject(infoButton);

if(auto playerShip = m_mainLayer->getChildByID("player-ship")) {
CCPoint position = m_buttonMenu->convertToNodeSpace(playerShip->getPosition());
Expand Down

0 comments on commit 7424cee

Please sign in to comment.