Skip to content

Commit

Permalink
ProfilePage: spawn username label asap
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jan 4, 2024
1 parent d5fc440 commit 24d883f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/hooks/ProfilePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ class $modify(BIProfilePage, ProfilePage) {
m_buttons->addObject(shipBtn);
}

if(auto usernameLabel = m_mainLayer->getChildByID("username-label")) {
usernameLabel->setVisible(false);
}

auto usernameNode = CCLabelBMFont::create(a2->m_userName.c_str(), "bigFont.fnt");
usernameNode->limitLabelWidth(a2->m_modBadge > 0 ? 140.f : 185.0f, 0.9f, 0.0f);
auto usernameBtn = CCMenuItemSpriteExtra::create(
Expand All @@ -165,7 +169,6 @@ class $modify(BIProfilePage, ProfilePage) {

if(a2->m_userID != GameManager::sharedState()->m_playerUserID){
if(auto rankIcon = m_mainLayer->getChildByID("global-rank-icon")) {
log::debug("hiding rank");
rankIcon->setVisible(false);
}

Expand Down Expand Up @@ -252,11 +255,6 @@ class $modify(BIProfilePage, ProfilePage) {
followHint->setVisible(false);
}

if(auto usernameLabel = m_mainLayer->getChildByID("username-label")) {
log::debug("hiding username");
usernameLabel->setVisible(false);
}

return true;
}

Expand Down

0 comments on commit 24d883f

Please sign in to comment.