//
// AccountHelpLayer::customSetup from 0x84d170 to 0x84d5b8 (1096 bytes)
//
// 2 xrefs:
// > ??> @ 0x5bfe0
// > ??> @ 0x118e4f8
//
// 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::customSetup(AccountHelpLayer *a1)
{
cocos2d::CCDirector *v2; // x0
cocos2d::CCLabelBMFont *v3; // x0
cocos2d::CCLabelBMFont_vtbl *v4; // x1
cocos2d::CCLabelBMFont *m_loginStatusLabel; // x24
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
TextArea *m_textArea; // x0
void *v8; // x3
TextArea *v9; // x24
void (__fastcall *v10)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
const cocos2d::CCPoint *v11; // x26
bool v12; // w4
__int64 v13; // x5
const char *v14; // x6
cocos2d::CCNode *v15; // x0
CCMenuItemSpriteExtra *v16; // x0
cocos2d::CCMenu *m_buttonMenu; // x2
bool v18; // w4
__int64 v19; // x5
const char *v20; // x6
cocos2d::CCNode *v21; // x0
CCMenuItemSpriteExtra *v22; // x24
bool v23; // w4
__int64 v24; // x5
const char *v25; // x6
cocos2d::CCNode *v26; // x0
CCMenuItemSpriteExtra *v27; // x0
cocos2d::CCMenu *v28; // x2
cocos2d::CCLayer *m_mainLayer; // x26
cocos2d::CCMenu *v30; // x25
CCMenuItemSpriteExtra *m_refreshLoginButton; // x25
void (__fastcall *v32)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
void (__fastcall *v33)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
CCMenuItemSpriteExtra *m_unlinkAccountButton; // x24
void (__fastcall *v35)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
unsigned int *v36; // x2
int v37; // w0
float v38; // [xsp+68h] [xbp+68h]
float v39; // [xsp+6Ch] [xbp+6Ch]
_BYTE v40[8]; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v41; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v42; // [xsp+80h] [xbp+80h] BYREF
cocos2d::SEL_MenuHandler v43; // 0:x2.16
cocos2d::SEL_MenuHandler v44; // 0:x2.16
cocos2d::SEL_MenuHandler v45; // 0:x2.16
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
v3 = cocos2d::CCLabelBMFont::create();
v4 = v3->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_loginStatusLabel = v3;
((void (__fastcall *)(float))v4->setScale)(0.8);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_loginStatusLabel);
m_loginStatusLabel = a1->m_loginStatusLabel;
setPosition = m_loginStatusLabel->setPosition;
cocos2d::CCPoint::CCPoint(&v42, v38 * 0.5, (float)(v39 * 0.5) + 90.0);
setPosition(m_loginStatusLabel, &v42);
sub_D153B8((int)&v42, " ");
cocos2d::CCPoint::CCPoint(&v41, 0.5, 1.0);
m_textArea = (TextArea *)TextArea::create((__int64)&v42, "bigFont.fnt", &v41, 0, 1.0, 1000.0, 35.0);
a1->m_textArea = m_textArea;
v8 = (void *)(*(_QWORD *)&v42 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v42 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(*(_QWORD *)&v42 - 8LL);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *(_DWORD *)(*(_QWORD *)&v42 - 8LL);
*(_DWORD *)(*(_QWORD *)&v42 - 8LL) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v8);
m_textArea = a1->m_textArea;
}
m_textArea->setScale(m_textArea, 0.4);
a1->m_mainLayer->addChild(a1->m_mainLayer, a1->m_textArea);
v9 = a1->m_textArea;
v10 = v9->setPosition;
v11 = a1->m_loginStatusLabel->getPosition(a1->m_loginStatusLabel);
cocos2d::CCPoint::CCPoint(&v41, 0.0, -18.0);
cocos2d::CCPoint::operator+(&v42, v11, &v41);
v10(v9, &v42);
v15 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Refresh Login",
(const char *)&qword_A0,
0,
1,
1.0,
v12,
v13,
v14);
v43.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v43.adj = (size_t)AccountHelpLayer::onReLogin;
v16 = CCMenuItemSpriteExtra::create(v15, nullptr, v43);
m_buttonMenu = a1->m_buttonMenu;
a1->m_refreshLoginButton = v16;
m_buttonMenu->addChild(m_buttonMenu, v16);
v21 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Manage Account",
(const char *)&qword_A0,
0,
1,
1.0,
v18,
v19,
v20);
v44.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v44.adj = (size_t)AccountHelpLayer::onAccountManagement;
v22 = CCMenuItemSpriteExtra::create(v21, nullptr, v44);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22);
v26 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"Unlink Account",
(const char *)&qword_A0,
0,
1,
1.0,
v23,
v24,
v25);
v45.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v45.adj = (size_t)AccountHelpLayer::onUnlink;
v27 = CCMenuItemSpriteExtra::create(v26, nullptr, v45);
v28 = a1->m_buttonMenu;
a1->m_unlinkAccountButton = v27;
v28->addChild(v28, v27);
m_mainLayer = a1->m_mainLayer;
v30 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v41, v38 * 0.5, (float)(v39 * 0.5) + 30.0);
cocos2d::CCNode::convertToWorldSpace(m_mainLayer, &v41);
cocos2d::CCNode::convertToNodeSpace(v30, &v42);
m_refreshLoginButton = a1->m_refreshLoginButton;
v32 = m_refreshLoginButton->setPosition;
cocos2d::CCPoint::CCPoint(&v41, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v42, v40, &v41);
v32(m_refreshLoginButton, &v42);
v33 = v22->setPosition;
cocos2d::CCPoint::CCPoint(&v41, 0.0, -45.0);
cocos2d::CCPoint::operator+(&v42, v40, &v41);
v33(v22, &v42);
m_unlinkAccountButton = a1->m_unlinkAccountButton;
v35 = m_unlinkAccountButton->setPosition;
cocos2d::CCPoint::CCPoint(&v41, 0.0, -90.0);
cocos2d::CCPoint::operator+(&v42, v40, &v41);
v35(m_unlinkAccountButton, &v42);
AccountHelpLayer::updatePage(a1);
GJAccountManager::sharedState()->m_accountDelegate = &a1->GJAccountDelegate;
a1->m_unk290 = 1;
}