//
// AccountLoginLayer::init from 0x100083168 to 0x100083868 (1792 bytes)
//
// 1 xrefs:
// > AccountLoginLayer::create @ 0x1000830ec
//
// 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
//
bool __fastcall AccountLoginLayer::init(AccountLoginLayer *a1, __int64 *a2)
{
_BOOL8 v4; // x19
cocos2d::CCDirector *v5; // x0
cocos2d::CCLayer *v6; // x0
cocos2d::extension::CCScale9Sprite *v7; // x21
__n128 v8; // q0
__n128 v9; // q1
cocos2d::CCLabelBMFont *v10; // x21
__n128 v11; // q0
__n128 v12; // q1
cocos2d::CCMenu *v13; // x0
__int64 v14; // x0
cocos2d::CCArray *v15; // x21
ButtonSprite *v16; // x0
CCMenuItemSpriteExtra *v17; // x24
ButtonSprite *v18; // x0
CCMenuItemSpriteExtra *v19; // x23
cocos2d::CCNode *m_buttonMenu; // x23
unsigned __int32 v21; // s10
float v22; // s11
__n128 v23; // q1
__n128 v24; // q0
__n128 v25; // q0
__n128 v26; // q1
double v27; // d0
double v28; // d0
double v29; // d0
CCTextInputNode *TextInput; // x23
__n128 v31; // q0
__n128 v32; // q1
CCTextInputNode *m_usernameInput; // x23
double v34; // d0
double v35; // d0
double v36; // d0
CCTextInputNode *v37; // x22
CCTextInputNode *m_passwordInput; // x0
ButtonSprite *v39; // x0
CCMenuItemSpriteExtra *v40; // x24
ButtonSprite *v41; // x0
CCMenuItemSpriteExtra *v42; // x22
cocos2d::CCNode *v43; // x22
unsigned __int32 v44; // s8
float v45; // s9
__n128 v46; // q1
__n128 v47; // q0
LoadingCircle *v48; // x0
__n128 v49; // q0
cocos2d::CCSprite *m_sprite; // x20
__n128 v51; // q1
float v53; // s1
float v54; // s1
float v55; // s1
float v56; // s1
float v57; // s1
float v58; // s1
void *v59[2]; // [xsp+8h] [xbp-E8h] BYREF
char v60; // [xsp+1Fh] [xbp-D1h]
cocos2d::CCPoint v61; // [xsp+20h] [xbp-D0h] BYREF
void *v62[2]; // [xsp+28h] [xbp-C8h] BYREF
char v63; // [xsp+3Fh] [xbp-B1h]
void *__p[2]; // [xsp+40h] [xbp-B0h] BYREF
char v65; // [xsp+57h] [xbp-99h]
float32x2_t v66; // [xsp+58h] [xbp-98h] BYREF
float32x2_t v67; // [xsp+60h] [xbp-90h] BYREF
float32x2_t v68; // [xsp+68h] [xbp-88h] BYREF
double v69; // [xsp+70h] [xbp-80h] BYREF
unsigned __int32 v70; // [xsp+78h] [xbp-78h] BYREF
float v71; // [xsp+7Ch] [xbp-74h]
float v72; // [xsp+88h] [xbp-68h]
float v73; // [xsp+8Ch] [xbp-64h]
cocos2d::CCPoint v74; // 0:kr18_8.8
cocos2d::CCPoint v75; // 0:kr20_8.8
cocos2d::CCPoint v76; // 0:kr28_8.8
cocos2d::CCPoint v77; // 0:kr30_8.8
cocos2d::CCPoint v78; // 0:kr38_8.8
cocos2d::CCPoint v79; // 0:kr40_8.8
cocos2d::SEL_MenuHandler v80; // 0:x3.16
cocos2d::SEL_MenuHandler v81; // 0:x3.16
cocos2d::SEL_MenuHandler v82; // 0:x3.16
cocos2d::SEL_MenuHandler v83; // 0:x3.16
cocos2d::CCPoint v84; // 0:s1.4,4:s2.4
cocos2d::CCPoint v85; // 0:s1.4,4:s2.4
cocos2d::CCSize v86; // 0:s2.4,4:s3.4
cocos2d::CCSize v87; // 0:s2.4,4:s3.4
cocos2d::CCSize v88; // 0:s2.4,4:s3.4
cocos2d::CCSize v89; // 0:s2.4,4:s3.4
cocos2d::CCSize v90; // 0:s2.4,4:s3.4
cocos2d::CCSize v91; // 0:s2.4,4:s3.4
cocos2d::CCRect v92; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v70 = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::ccColor4B *)&v70);
if ( !v4 )
return v4;
FLAlertLayer::incrementForcePrio(a1);
((void (__fastcall *)(AccountLoginLayer *, __int64))a1->setTouchEnabled)(a1, 1);
((void (__fastcall *)(AccountLoginLayer *, __int64))a1->setKeypadEnabled)(a1, 1);
a1->m_noElasticity = 1;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6 = cocos2d::CCLayer::create();
a1->m_mainLayer = v6;
((void (__fastcall *)(AccountLoginLayer *, cocos2d::CCLayer *))a1->addChild)(a1, v6);
sub_100022990((float *)&v70, 0.0, 0.0, 80.0, 80.0);
v7 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v92);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v7->setOpacity)(v7, 255);
sub_100022988((float *)&v70, 400.0, 300.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int32 *))v7->setContentSize)(v7, &v70);
v8 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v7,
0xFFFFFFFFLL);
v8.n128_f32[0] = v72 * 0.5;
v9.n128_f32[0] = v73 * 0.5;
sub_100022980(v8, v9, &v70);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int32 *))v7->setPosition)(v7, &v70);
v10 = cocos2d::CCLabelBMFont::create_1("Login", "bigFont.fnt");
v11.n128_u32[0] = v70;
v12.n128_f32[0] = (float)(v71 + 150.0) + -16.0;
sub_100022980(v11, v12, &v69);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v10->setPosition)(v10, &v69);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v10);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v10->setScale)(v10, 0.6);
a1->m_joystickConnected = -1;
v13 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v13;
v14 = ((__int64 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v13,
10);
v15 = (cocos2d::CCArray *)sub_10024A15C(v14);
v16 = sub_10005F294("Cancel");
v80.ptr = (void (__cdecl *)(cocos2d::CCObject *))AccountLoginLayer::onClose;
v80.adj = 0;
v17 = CCMenuItemSpriteExtra::create(v16, nullptr, a1, v80);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v17);
sub_10024A2D0(v15, v17);
v18 = sub_10005F294("Login");
v81.ptr = (void (__cdecl *)(cocos2d::CCObject *))AccountLoginLayer::onSubmit;
v81.adj = 0;
v19 = CCMenuItemSpriteExtra::create(v18, nullptr, a1, v81);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v19);
sub_10024A2D0(v15, v19);
m_buttonMenu = a1->m_buttonMenu;
v21 = v70;
v22 = (float)(v71 + -150.0) + 22.0;
v23.n128_f32[0] = v22
+ *(float *)(((__int64 (__fastcall *)(cocos2d::CCLayer *))a1->m_mainLayer->getPosition)(a1->m_mainLayer)
+ 4);
v24.n128_u32[0] = v21;
sub_100022980(v24, v23, &v68);
LODWORD(v84.x) = COERCE_UNSIGNED_INT(cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v68).y);
GameToolbox::alignItemsHorisontally(v15, 15.0, v84, (bool)&v69);
sub_100022988((float *)&v69, 300.0, 30.0);
v25.n128_u32[0] = v70;
v26.n128_f32[0] = v71 + 80.0;
sub_100022980(v25, v26, &v68);
sub_1000229B8((__int64 *)&v67, (__int64 *)&v68);
v27 = sub_100022AFC(&v66, &v69);
v74.x = *(float *)&v27;
v74.y = v53;
AccountLoginLayer::createTextBackground(a1, v74, (const char *)&v67, v86);
sub_1000229B8((__int64 *)&v67, (__int64 *)&v68);
v28 = sub_100022AFC(&v66, &v69);
v75.x = *(float *)&v28;
v75.y = v54;
a1->m_usernameLabel = AccountLoginLayer::createTextLabel(a1, v75, (const char *)&v67, v87);
sub_1000229B8((__int64 *)&v67, (__int64 *)&v68);
v29 = sub_100022AFC(&v66, &v69);
v76.x = *(float *)&v29;
v76.y = v55;
TextInput = AccountLoginLayer::createTextInput(a1, v76, v88, (const char *)&v67, (int)&v66);
a1->m_usernameInput = TextInput;
sub_100009900(__p, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
CCTextInputNode::setAllowedChars(TextInput, __p);
if ( v65 < 0 )
operator delete(__p[0]);
m_usernameInput = a1->m_usernameInput;
m_usernameInput->m_maxLabelLength = 16;
if ( (*((char *)a2 + 23) & 0x80000000) == 0 )
{
if ( !*((_BYTE *)a2 + 23) )
goto LABEL_11;
LABEL_9:
sub_100009900(v62, (char *)a2);
CCTextInputNode::setString(m_usernameInput, v62);
if ( v63 < 0 )
operator delete(v62[0]);
goto LABEL_11;
}
if ( a2[1] )
{
a2 = (__int64 *)*a2;
goto LABEL_9;
}
LABEL_11:
v32.n128_u32[0] = -1035468800;
v31.n128_u32[0] = 0;
sub_100022980(v31, v32, &v66);
sub_1000229DC(&v68, &v66, &v67);
sub_1000229B8((__int64 *)&v66, (__int64 *)&v67);
v34 = sub_100022AFC(&v61, &v69);
v77.x = *(float *)&v34;
v77.y = v56;
AccountLoginLayer::createTextBackground(a1, v77, (const char *)&v66, v89);
sub_1000229B8((__int64 *)&v66, (__int64 *)&v67);
v35 = sub_100022AFC(&v61, &v69);
v78.x = *(float *)&v35;
v78.y = v57;
a1->m_passwordLabel = AccountLoginLayer::createTextLabel(a1, v78, (const char *)&v66, v90);
sub_1000229B8((__int64 *)&v66, (__int64 *)&v67);
v36 = sub_100022AFC(&v61, &v69);
v79.x = *(float *)&v36;
v79.y = v58;
v37 = AccountLoginLayer::createTextInput(a1, v79, v91, (const char *)&v66, (int)&v61);
a1->m_passwordInput = v37;
sub_100009900(v59, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*'();:@+$,/?#[]&");
CCTextInputNode::setAllowedChars(v37, v59);
if ( v60 < 0 )
operator delete(v59[0]);
m_passwordInput = a1->m_passwordInput;
m_passwordInput->m_maxLabelLength = 20;
m_passwordInput->m_usePasswordChar = 1;
CCTextInputNode::setMaxLabelScale(m_passwordInput, 1.0);
sub_10024A45C(v15);
v39 = ButtonSprite::create_1("Forgot Username", 120, 0, 0.8, 1, "goldFont.fnt", "GJ_button_05.png", 25.0);
v82.ptr = (void (__cdecl *)(cocos2d::CCObject *))AccountLoginLayer::onForgotUser;
v82.adj = 0;
v40 = CCMenuItemSpriteExtra::create(v39, nullptr, a1, v82);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v40);
v41 = ButtonSprite::create_1("Forgot Password", 120, 0, 0.8, 1, "goldFont.fnt", "GJ_button_05.png", 25.0);
v83.ptr = (void (__cdecl *)(cocos2d::CCObject *))AccountLoginLayer::onForgotPassword;
v83.adj = 0;
v42 = CCMenuItemSpriteExtra::create(v41, nullptr, a1, v83);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v42);
sub_10024A2D0(v15, v42);
sub_10024A2D0(v15, v40);
v43 = a1->m_buttonMenu;
v44 = v70;
v45 = v71 + -45.0;
v46.n128_f32[0] = v45
+ *(float *)(((__int64 (__fastcall *)(cocos2d::CCLayer *))a1->m_mainLayer->getPosition)(a1->m_mainLayer)
+ 4);
v47.n128_u32[0] = v44;
sub_100022980(v47, v46, &v61);
LODWORD(v85.x) = COERCE_UNSIGNED_INT(cocos2d::CCNode::convertToNodeSpace(v43, &v61).y);
GameToolbox::alignItemsVertically(v15, 15.0, v85);
v48 = LoadingCircle::create();
a1->m_loadingCircle = v48;
v48->m_parentLayer = a1->m_mainLayer;
v48->m_fade = 1;
cocos2d::CCObject::retain(v48);
LoadingCircle::show(a1->m_loadingCircle);
v49 = ((__n128 (__fastcall *)(LoadingCircle *, _QWORD))a1->m_loadingCircle->setVisible)(a1->m_loadingCircle, 0);
m_sprite = a1->m_loadingCircle->m_sprite;
v49.n128_f32[0] = v72 * 0.5;
v51.n128_f32[0] = v73 * 0.5;
sub_100022980(v49, v51, &v66);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))m_sprite->setPosition)(m_sprite, &v66);
return v4;
}