//
// SocialLinksPopup::init from 0x5e26a8 to 0x5e2dec (1860 bytes)
//
// 1 xrefs:
// > SocialLinksPopup::create @ 0x5e2e58
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:54:17 +0000
//
int __fastcall SocialLinksPopup::init(SocialLinksPopup *this, GJAccountSettingsLayer *a2)
{
int v4; // r3
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *v6; // r0
int v7; // r0
int v8; // r3
int v9; // r6
void (__fastcall *v10)(int, _DWORD *); // r9
int v11; // r11
const char *v12; // r2
int v13; // r6
void (__fastcall *v14)(int, _DWORD *); // r7
cocos2d::CCMenu *v15; // r0
int v16; // r0
const char *v17; // r1
int v18; // r6
int v19; // r6
int (__fastcall *v20)(int, _DWORD *); // r7
cocos2d::CCArray *v21; // r0
cocos2d::CCObject *v22; // r0
float v23; // s16
char *v24; // r0
float v25; // s20
float v26; // s18
float v27; // r0
int v28; // r7
_DWORD *v29; // r3
int v30; // r2
_DWORD *v31; // r2
_DWORD *v32; // r6
_DWORD *v33; // r8
_DWORD *v34; // r0
int v35; // r3
int v36; // r3
cocos2d::CCLabelBMFont *v37; // r7
const char *v38; // r2
int v39; // r6
void (__fastcall *v40)(int, _DWORD *); // r8
void (__fastcall *v41)(int, _DWORD *); // r10
size_t v42; // r0
const char *v43; // r7
size_t v44; // r0
int v45; // r7
const cocos2d::CCPoint *v46; // r10
int v47; // r9
float v48; // s18
float v49; // r0
int v50; // r7
void (__fastcall *v51)(int, _DWORD *); // r3
void (__fastcall *v52)(int, _DWORD *); // r8
void (__fastcall *v53)(int, _DWORD *); // r10
int *v54; // r7
int v55; // r3
ButtonSprite *v56; // r0
int v57; // r5
void (__fastcall *v58)(int, _BYTE *); // r4
char *v60; // [sp+8h] [bp-12Ch]
float v61; // [sp+10h] [bp-124h]
char *v62; // [sp+14h] [bp-120h]
int v63; // [sp+18h] [bp-11Ch]
void (__fastcall *v64)(int, _DWORD *); // [sp+1Ch] [bp-118h]
int v65; // [sp+3Ch] [bp-F8h]
float v66[2]; // [sp+40h] [bp-F4h] BYREF
float v67; // [sp+48h] [bp-ECh] BYREF
float v68; // [sp+4Ch] [bp-E8h]
_BYTE v69[8]; // [sp+50h] [bp-E4h] BYREF
_BYTE v70[8]; // [sp+58h] [bp-DCh] BYREF
_BYTE v71[8]; // [sp+60h] [bp-D4h] BYREF
int (__fastcall *v72)(SocialLinksPopup *, cocos2d::CCObject *); // [sp+68h] [bp-CCh]
int v73; // [sp+6Ch] [bp-C8h]
int v74[3]; // [sp+70h] [bp-C4h] BYREF
int v75[3]; // [sp+7Ch] [bp-B8h] BYREF
int v76[3]; // [sp+88h] [bp-ACh] BYREF
int v77[3]; // [sp+94h] [bp-A0h] BYREF
int v78[3]; // [sp+A0h] [bp-94h] BYREF
_DWORD v79[4]; // [sp+ACh] [bp-88h] BYREF
_BYTE v80[112]; // [sp+BCh] [bp-78h] BYREF
v79[0] = -1778384896;
v63 = cocos2d::CCLayerColor::initWithColor(this, v79);
if ( v63 )
{
*((_DWORD *)this + 130) = a2;
FLAlertLayer::incrementForcePrio(this);
v4 = *(_DWORD *)this;
*((_BYTE *)this + 468) = 1;
(*(void (__fastcall **)(SocialLinksPopup *, int))(v4 + 500))(this, 1);
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SocialLinksPopup *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v66);
v6 = (cocos2d::CCLayer *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, v66[0] * 0.5, v66[1] * 0.5);
v7 = cocos2d::CCLayer::create(v6);
v8 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v7;
(*(void (__fastcall **)(SocialLinksPopup *, int))(v8 + 228))(this, v7);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v79, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v79);
v10 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v79, 420.0, 280.0);
v10(v9, v79);
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v9 + 92))(v9, &v67);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v9, -2);
v11 = 0;
v13 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Social Links", "goldFont.fnt", v12);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 80))(v13, 1060320051);
v14 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, v67, (float)(v68 + 140.0) - 18.0);
v14(v13, v79);
v15 = (cocos2d::CCMenu *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
v13);
v16 = cocos2d::CCMenu::create(v15);
*((_DWORD *)this + 111) = v16;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v16, 10);
(*(void (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 111) + 92))(*((_DWORD *)this + 111), &unk_D2C4B8);
*((_DWORD *)this + 125) = -1;
v18 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v17);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 80))(v18, 1061997773);
v72 = SocialLinksPopup::onClose;
v73 = 0;
v19 = CCMenuItemSpriteExtra::create(v18, 0, (int)this, (int)SocialLinksPopup::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v19, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v19);
v20 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v19 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (float)(v67 - 210.0) + 8.0, (float)(v68 + 140.0) - 8.0);
v21 = (cocos2d::CCArray *)v20(v19, v79);
v22 = (cocos2d::CCObject *)cocos2d::CCArray::create(v21);
*((_DWORD *)this + 131) = v22;
cocos2d::CCObject::retain(v22);
v23 = v68 + 58.0;
v24 = (char *)memcpy(v80, off_D1E210, sizeof(v80));
v62 = v24;
do
{
v25 = v67;
v26 = 1.0;
if ( (v11 & 1) == 0 )
v26 = -1.0;
v27 = floorf((float)v11 * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, v25 + (float)(v26 * 95.0), v23 - (float)(v27 * 46.0));
v28 = *((_DWORD *)this + 130);
v29 = *(_DWORD **)(v28 + 552);
if ( v29 )
{
while ( 1 )
{
v30 = v29[4];
if ( v11 >= v30 )
{
if ( v30 >= v11 )
{
v79[0] = v29;
v32 = v79;
goto LABEL_15;
}
v31 = (_DWORD *)v29[1];
if ( !v31 )
{
v79[0] = v29;
v32 = v29 + 1;
goto LABEL_15;
}
}
else
{
v31 = (_DWORD *)*v29;
if ( !*v29 )
{
v79[0] = v29;
v32 = v29;
goto LABEL_15;
}
}
v29 = v31;
}
}
v32 = (_DWORD *)(v28 + 552);
v79[0] = v28 + 552;
LABEL_15:
v33 = (_DWORD *)*v32;
if ( !*v32 )
{
v34 = (_DWORD *)operator new(0x20u);
v34[4] = v11;
v33 = v34;
v34[5] = 0;
v34[6] = 0;
v34[7] = 0;
v35 = v79[0];
*v34 = 0;
v34[1] = 0;
v34[2] = v35;
*v32 = v34;
v36 = **(_DWORD **)(v28 + 548);
if ( v36 )
*(_DWORD *)(v28 + 548) = v36;
std::__tree_balance_after_insert *>(*(_DWORD **)(v28 + 552), (_DWORD *)*v32);
++*(_DWORD *)(v28 + 556);
}
std::string::basic_string(v74, (int)(v33 + 5));
v37 = *(cocos2d::CCLabelBMFont **)v62;
v39 = cocos2d::CCLabelBMFont::create(*(cocos2d::CCLabelBMFont **)v62, "goldFont.fnt", v38);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v39);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v39 + 80))(v39, 1055286886);
v40 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v39 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, 0.5, 0.0);
v40(v39, v79);
v41 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v39 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, 0.0, 12.0);
cocos2d::CCPoint::operator+(v79, v69, v71);
v41(v39, v79);
memset(v75, 0, sizeof(v75));
v42 = strlen((const char *)v37);
std::string::__init(v75, v37, v42);
memset(v76, 0, sizeof(v76));
v43 = *((const char **)v62 + 3);
v44 = strlen(v43);
std::string::__init(v76, v43, v44);
v45 = InfoAlertButton::create(v75, v76, 1056964608);
std::string::~string((int)v76);
std::string::~string((int)v75);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v45);
v46 = *((const cocos2d::CCPoint **)this + 111);
v64 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v45 + 92);
v47 = (*(int (__fastcall **)(int))(*(_DWORD *)v39 + 96))(v39);
v48 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v39 + 164))(v39);
v49 = (*(float (__fastcall **)(int))(*(_DWORD *)v39 + 84))(v39);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v70, (float)((float)(v48 * v49) * 0.5) + 10.0, 5.0);
cocos2d::CCPoint::operator+(v71, v47, v70);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v79, v46);
v64(v45, v79);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v79, 0.0, 0.0, 40.0, 40.0);
v50 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v79);
v51 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 480);
LOWORD(v79[0]) = 13405;
BYTE2(v79[0]) = 31;
v51(v50, v79);
v52 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v79, 160.0, 20.0);
v52(v50, v79);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v50, -1);
v53 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, 0.0, -1.0);
cocos2d::CCPoint::operator+(v79, v69, v71);
v53(v50, v79);
v54 = CCTextInputNode::create(
(CCTextInputNode *)0x43200000,
20.0,
*((char **)v62 + 1),
"Thonburi",
(const char *)&dword_18,
"bigFont.fnt",
v60);
if ( (v74[0] & 1) != 0 )
v55 = v74[1];
else
v55 = (int)LOBYTE(v74[0]) >> 1;
if ( v55 )
{
std::string::basic_string(v77, (int)v74);
CCTextInputNode::setString((int)v54, (int)v77);
std::string::~string((int)v77);
}
(*(void (__fastcall **)(_DWORD, int *, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v54, 20);
v54[105] = (int)this + 440;
(*(void (__fastcall **)(int *, _BYTE *))(*v54 + 92))(v54, v69);
CCTextInputNode::setMaxLabelScale((unsigned int)v54, 0.5);
CCTextInputNode::setMaxLabelWidth((unsigned int)v54, 140.0);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v54[104] + 172))(v54[104], 0);
v54[106] = *((_DWORD *)v62 + 2);
memset(v78, 0, sizeof(v78));
std::string::__init(v78, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'.", 0x43u);
CCTextInputNode::setAllowedChars((int)v54, (unsigned __int8 *)v78);
std::string::~string((int)v78);
LOWORD(v65) = -21896;
BYTE2(v65) = -16;
CCTextInputNode::setLabelPlaceholderColor((unsigned int)v54, v65);
CCTextInputNode::setLabelPlaceholderScale((unsigned int)v54, 0.45);
CCTextInputNode::forceOffset((int)v54);
(*(void (__fastcall **)(int *, int))(*v54 + 36))(v54, v11);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 131), (cocos2d::CCObject *)v54);
++v11;
std::string::~string((int)v74);
v62 += 16;
}
while ( v11 != 7 );
v56 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_32,
0,
0.6,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41E00000,
v61);
v79[0] = SocialLinksPopup::onOK;
v79[1] = 0;
v57 = CCMenuItemSpriteExtra::create((int)v56, 0, (int)this, (int)SocialLinksPopup::onOK, 0);
CCMenuItemSpriteExtra::setSizeMult(v57, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v57);
v58 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v57 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, v67 + 95.0, (float)(v23 - 138.0) - 1.0);
v58(v57, v71);
}
return v63;
}