//
// AccountLayer::updatePage from 0x14007e7b0 to 0x14007eb73 (963 bytes)
//
// 5 xrefs:
// > AccountLayer::customSetup @ 0x14007dd57
// > AccountLayer::accountStatusChanged @ 0x14007e7a9
// > AccountLayer::FLAlert_Clicked @ 0x14007f3fa
// > AccountLayer::FLAlert_Clicked @ 0x14007f429
// > ??> @ 0x1406c6900
//
// 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
//
// Hidden C++ exception states: #wind=1
void AccountLayer::updatePage(AccountLayer *a1, bool a2)
{
char v4; // bl
GJAccountManager *v5; // rax
GJAccountManager *v6; // rax
bool v7; // si
GJAccountManager *v8; // rax
const char *v9; // rdx
cocos2d::CCLabelProtocol_vtbl *v10; // rbx
cocos2d::CCString *v11; // rax
const char *CString; // rax
GJAccountManager *v13; // rax
const char *v14; // rdx
cocos2d::CCLabelProtocol_vtbl *v15; // rbx
cocos2d::CCString *v16; // rax
const char *v17; // rax
_BOOL8 v18; // rbx
GJAccountManager *v19; // rax
_BOOL8 v20; // rdx
GJAccountManager *v21; // rax
__int64 m_unkInt1; // rdx
cocos2d::CCNode *v23; // rbx
_DWORD v24[4]; // [rsp+20h] [rbp-40h] BYREF
__int128 v25; // [rsp+30h] [rbp-30h] BYREF
__int64 v26; // [rsp+40h] [rbp-20h]
unsigned __int64 v27; // [rsp+48h] [rbp-18h]
v4 = 0;
v24[0] = 0;
v5 = GJAccountManager::sharedState();
v7 = false;
if ( v5->m_accountID != v5->m_unkInt1 )
{
v6 = GJAccountManager::sharedState();
sub_14003BDB0((__int64)&v25, (__int64)&v6->m_GJP2);
v4 = 3;
if ( v26 )
v7 = true;
}
if ( (v4 & 1) != 0 )
sub_14003A830((__int64)&v25);
LOWORD(v24[0]) = -1;
BYTE2(v24[0]) = -1;
TextArea::colorAllCharactersTo(a1->m_textArea, (cocos2d::ccColor3B *)v24);
v8 = GJAccountManager::sharedState();
if ( v7 )
{
sub_14003BDB0((__int64)&v25, (__int64)&v8->m_username);
v9 = (const char *)&v25;
if ( v27 > 0xF )
v9 = (const char *)v25;
v10 = a1->m_linkedAccountTitle->__vftable;
v11 = cocos2d::CCString::createWithFormat("Linked to account: %s", v9);
CString = cocos2d::CCString::getCString(v11);
v10->setString(&a1->m_linkedAccountTitle->cocos2d::CCLabelProtocol, CString);
sub_14003A830((__int64)&v25);
v25 = 0;
v26 = 0;
v27 = 15;
LOBYTE(v25) = 0;
}
else if ( v8->m_accountID == v8->m_unkInt1 )
{
a1->m_linkedAccountTitle->setString(&a1->m_linkedAccountTitle->cocos2d::CCLabelProtocol, "Not logged in");
v25 = 0;
v26 = 0;
v27 = 15;
*(_QWORD *)&v25 = sub_14003AA10(0x40u);
v26 = 62;
v27 = 63;
strcpy((char *)v25, "Create an account to back up\nand load your data from the cloud");
}
else
{
v13 = GJAccountManager::sharedState();
sub_14003BDB0((__int64)&v25, (__int64)&v13->m_username);
v14 = (const char *)&v25;
if ( v27 > 0xF )
v14 = (const char *)v25;
v15 = a1->m_linkedAccountTitle->__vftable;
v16 = cocos2d::CCString::createWithFormat("Linked to account: %s", v14);
v17 = cocos2d::CCString::getCString(v16);
v15->setString(&a1->m_linkedAccountTitle->cocos2d::CCLabelProtocol, v17);
sub_14003A830((__int64)&v25);
v26 = 14;
v27 = 15;
strcpy((char *)&v25, "Login required");
HIBYTE(v25) = 0;
}
TextArea::setString(a1->m_textArea, (__int64)&v25);
v18 = !v7;
a1->m_loginButton->setVisible(a1->m_loginButton, v18);
v19 = GJAccountManager::sharedState();
LOBYTE(v20) = v19->m_accountID == v19->m_unkInt1;
a1->m_registerButton->setVisible(a1->m_registerButton, v20);
a1->m_backupButton->setVisible(a1->m_backupButton, v7);
a1->m_syncButton->setVisible(a1->m_syncButton, v7);
a1->m_helpButton->setVisible(a1->m_helpButton, v18);
v21 = GJAccountManager::sharedState();
m_unkInt1 = (unsigned int)v21->m_unkInt1;
LOBYTE(m_unkInt1) = v21->m_accountID != (_DWORD)m_unkInt1;
a1->m_moreButton->setVisible(a1->m_moreButton, m_unkInt1);
if ( a2 && !a1->m_isLoggedIn )
{
a1->m_backupButton->setEnabled(a1->m_backupButton, 0);
v23 = a1->m_backupButton->getNormalImage(a1->m_backupButton);
memset(v24, 125, 3);
(**(void (__fastcall ***)(__int64, _DWORD *))(*(_QWORD *)&v23[2].m_uID + 320LL))(
*(_QWORD *)&v23[2].m_uID + 320LL,
v24);
memset(v24, 125, 3);
((void (__fastcall *)(cocos2d::CCDictionary **, _DWORD *))v23[1].m_pComponentContainer[15].m_pComponents->__vftable)(
&v23[1].m_pComponentContainer[15].m_pComponents,
v24);
}
}