//
// AccountHelpLayer::updatePage from 0x46775c to 0x4678da (382 bytes)
//
// 2 xrefs:
// > AccountHelpLayer::customSetup @ 0x467b76
// > AccountHelpLayer::accountStatusChanged @ 0x467bf8
//
// 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 AccountHelpLayer::updatePage(AccountHelpLayer *a1)
{
GJAccountManager *v2; // r0
_BOOL4 v3; // r6
cocos2d::CCLabelBMFont *m_loginStatusLabel; // r6
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r9
cocos2d::CCString *v6; // r0
const char *CString; // r0
TextArea *m_textArea; // r6
GJAccountManager *v9; // r0
cocos2d::CCLabelBMFont *v10; // r6
cocos2d::CCLabelBMFont_vtbl *v11; // r3
void (__fastcall *v12)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r9
cocos2d::CCString *v13; // r0
const char *v14; // r0
TextArea *v15; // r6
CCMenuItemSpriteExtra *m_unlinkAccountButton; // r4
void (__fastcall *setVisible)(cocos2d::CCNode *__hidden, bool); // r5
GJAccountManager *v18; // r0
char *v19; // [sp+8h] [bp-Ch] BYREF
v2 = GJAccountManager::sharedState();
if ( v2->m_accountID == v2->m_unkInt1 )
{
v3 = 0;
}
else
{
GJAccountManager::sharedState();
sub_775C20(&v19);
v3 = *((_DWORD *)v19 - 3) != 0;
sub_774008(&v19);
}
TextArea::colorAllCharactersTo(a1->m_textArea, (cocos2d::ccColor3B)-1);
if ( v3 )
{
m_loginStatusLabel = a1->m_loginStatusLabel;
setString = m_loginStatusLabel->setString;
GJAccountManager::sharedState();
sub_775C20(&v19);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Linked to account: %s", v19);
CString = cocos2d::CCString::getCString(v6);
setString(m_loginStatusLabel, (const unsigned __int8 *)CString);
sub_774008(&v19);
m_textArea = a1->m_textArea;
sub_776584((int)&v19, (char *)&unk_939830);
TextArea::setString((int)m_textArea, &v19);
}
else
{
v9 = GJAccountManager::sharedState();
v10 = a1->m_loginStatusLabel;
v11 = v10->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v9->m_accountID == v9->m_unkInt1 )
{
v11->setString(a1->m_loginStatusLabel, "Not logged in");
v15 = a1->m_textArea;
sub_776584((int)&v19, "Create an account to backup\nand sync your data");
}
else
{
v12 = v11->setString;
GJAccountManager::sharedState();
sub_775C20(&v19);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Linked to account: %s", v19);
v14 = cocos2d::CCString::getCString(v13);
v12(v10, (const unsigned __int8 *)v14);
sub_774008(&v19);
v15 = a1->m_textArea;
sub_776584((int)&v19, "Login required");
}
TextArea::setString((int)v15, &v19);
}
sub_774008(&v19);
m_unlinkAccountButton = a1->m_unlinkAccountButton;
setVisible = m_unlinkAccountButton->setVisible;
v18 = GJAccountManager::sharedState();
setVisible(m_unlinkAccountButton, v18->m_accountID != v18->m_unkInt1);
}