//
// ProfilePage::loadPage from 0x4c7de0 to 0x4c7ef0 (272 bytes)
//
// 5 xrefs:
// > ProfilePage::onNextPage @ 0x4c7efa
// > ProfilePage::onPrevPage @ 0x4c7f04
// > ProfilePage::commentUploadFinished @ 0x4c7f2c
// > ProfilePage::commentDeleteFailed @ 0x4c7fce
// > ProfilePage::getUserInfoFinished @ 0x4c8042
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void ProfilePage::loadPage(ProfilePage *a1, int a2)
{
GameLevelManager *v4; // r0
char *AccountCommentKey; // r0
GameLevelManager *v6; // r0
cocos2d::CCArray *StoredOnlineLevels; // r1
GameLevelManager *v8; // r0
cocos2d::CCArray *v9; // r8
void (__fastcall *setupPageInfo)(ProfilePage *__hidden, std::string, const unsigned __int8 *); // r9
GameLevelManager *v11; // r0
char *PageInfo; // r0
GameLevelManager *v13; // r0
_BYTE v14[4]; // [sp+8h] [bp-Ch] BYREF
v4 = GameLevelManager::sharedState();
AccountCommentKey = (char *)GameLevelManager::getAccountCommentKey(v4, a1->m_accountID, a2);
sub_7753D4((int)&a1->m_profileKey, AccountCommentKey);
a1->m_circle->setVisible(a1->m_circle, 1);
a1->m_refreshBtn->setVisible(a1->m_refreshBtn, 0);
a1->m_leftArrow->setVisible(a1->m_leftArrow, a2 > 0);
v6 = GameLevelManager::sharedState();
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v6, (const char *)a1->m_profileKey.m_data.m_data);
a1->m_rightArrow->setVisible(a1->m_rightArrow, StoredOnlineLevels != nullptr);
v8 = GameLevelManager::sharedState();
v9 = GameLevelManager::getStoredOnlineLevels(v8, (const char *)a1->m_profileKey.m_data.m_data);
if ( v9 )
{
setupPageInfo = a1->setupPageInfo;
v11 = GameLevelManager::sharedState();
PageInfo = (char *)GameLevelManager::getPageInfo(v11, (const char *)a1->m_profileKey.m_data.m_data);
sub_776584((int)v14, PageInfo);
((void (__fastcall *)(ProfilePage *, _BYTE *, stl::StringData::Internal *))setupPageInfo)(
a1,
v14,
a1->m_profileKey.m_data.m_data);
sub_774008(v14);
a1->loadCommentsFinished(a1, v9, (const unsigned __int8 *)a1->m_profileKey.m_data.m_data);
}
else
{
ProfilePage::setupCommentsBrowser(a1, nullptr);
GameLevelManager::sharedState()->m_levelCommentDelegate = &a1->LevelCommentDelegate;
v13 = GameLevelManager::sharedState();
GameLevelManager::getAccountComments(v13, a1->m_accountID, a2, a1->m_itemCount);
}
a1->m_page = a2;
}