//
// LevelPickerPopup::init from 0xc69f54 to 0xc6a858 (2308 bytes)
//
// 2 xrefs:
// > LevelPickerPopup::create @ 0xc6ab30
// > ??> @ 0x94bb8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:05:27 +0000
//
__int64 __fastcall LevelPickerPopup::init(LevelPickerPopup *this, LevelPickerDelegate *a2)
{
unsigned int inited; // w20
__int64 v6; // x1
float v7; // s1
__int64 v8; // x23
void (__fastcall *v9)(__int64, char *); // x25
__int64 v10; // x0
void (__fastcall *v11)(__int64, char *); // x2
__int64 v12; // x23
void (__fastcall *v13)(__int64, char *); // x25
float v14; // s2
float v15; // s0
float v16; // s8
__int64 v17; // x23
void (__fastcall *v18)(__int64, char *); // x26
void (__fastcall *v19)(__int64, char *); // x2
void (__fastcall *v20)(__int64, char *); // x26
int v21; // w2
__int64 v22; // x3
const char *v23; // x4
__int64 InputNode; // x23
float v25; // s0
void (__fastcall *v26)(__int64, char *); // x26
const char *v27; // x6
__int64 v28; // x0
__int64 v29; // x23
void (__fastcall *v30)(__int64, char *); // x28
const char *v31; // x2
__int64 v32; // x0
__int64 v33; // x23
void (__fastcall *v34)(__int64, char *); // x28
const char *v35; // x1
__int64 v36; // x23
__int64 v37; // x0
__int64 v38; // x23
void (__fastcall *v39)(__int64, char *); // x28
const char *v40; // x6
__int64 v41; // x0
__int64 v42; // x0
__int64 v43; // x23
void (__fastcall *v44)(__int64, char *); // x26
__int64 v45; // x22
void (__fastcall *v46)(__int64, char *); // x23
const char *v47; // x1
__int64 v48; // x0
__int64 v49; // x22
void (__fastcall *v50)(__int64, char *); // x23
const char *v51; // x1
__int64 v52; // x22
const char *v53; // x1
__int64 v54; // x23
__int64 v55; // x0
__int64 v56; // x22
void (__fastcall *v57)(__int64, char *); // x23
char v58; // [xsp+98h] [xbp+98h] BYREF
char v59; // [xsp+99h] [xbp+99h]
char v60; // [xsp+9Ah] [xbp+9Ah]
__int64 v61[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v62; // [xsp+B8h] [xbp+B8h]
__int64 v63; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v64; // [xsp+C8h] [xbp+C8h]
void *v65; // [xsp+D0h] [xbp+D0h]
v63 = 0;
v64 = 0;
v65 = nullptr;
std::string::__init(&v63, &byte_11B8890, 0);
inited = (unsigned __int8)PagedListPopup::initPaged(
(__int64)this,
(cocos2d::CCLabelBMFont *)"Share Level",
(unsigned __int8 *)&v63,
410.0,
290.0);
if ( (v63 & 1) != 0 )
{
operator delete(v65);
if ( !inited )
return inited;
LABEL_5:
v6 = *((_QWORD *)this + 90);
v7 = *((float *)this + 165);
*((_QWORD *)this + 99) = a2;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v6 + 216LL))(
v6,
(float)(v7 - (float)(*((float *)this + 167) * 0.5)) - 19.0);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 91) + 216LL))(
*((_QWORD *)this + 91),
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) + 19.0);
v8 = *((_QWORD *)this + 92);
if ( v8 )
{
v9 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v8 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 1.0, 0.5);
v9(v8, &v58);
v10 = *((_QWORD *)this + 92);
v11 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v10 + 1072LL);
v58 = 0;
v59 = 0;
v60 = 0;
v11(v10, &v58);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 92) + 1024LL))(
*((_QWORD *)this + 92),
4294967190LL);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 92) + 160LL))(*((_QWORD *)this + 92), 0.48);
v12 = *((_QWORD *)this + 92);
v13 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) - 9.0,
(float)(*((float *)this + 166) + (float)(*((float *)this + 168) * 0.5)) - 13.0);
v13(v12, &v58);
}
v14 = *((float *)this + 166) + (float)(*((float *)this + 168) * 0.5);
v15 = *((float *)this + 165);
*((_DWORD *)this + 177) = 1128792064;
*((_DWORD *)this + 176) = 1135214592;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, v15, (float)(v14 - 76.0) - 100.0);
cocos2d::CCPoint::operator=((char *)this + 712, &v58);
v16 = (float)(*((float *)this + 166) + (float)(*((float *)this + 168) * 0.5)) - 48.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v58, 0.0, 0.0, 40.0, 40.0);
v17 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", &v58);
v18 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v17 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v58, 200.0, 24.0);
v18(v17, &v58);
v19 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v17 + 960LL);
v58 = 93;
v59 = 52;
v60 = 31;
v19(v17, &v58);
v20 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, *((float *)this + 165) - 20.0, v16);
v20(v17, &v58);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**((_QWORD **)this + 73) + 464LL))(*((_QWORD *)this + 73), v17, 0);
InputNode = GameToolbox::createInputNode(
(GameToolbox *)"Search saved",
188.0,
24.0,
(const char *)&off_18,
v21,
v22,
v23);
v25 = *((float *)this + 165);
*((_QWORD *)this + 112) = InputNode;
v26 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)InputNode + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, v25 - 20.0, v16);
v26(InputNode, &v58);
CCTextInputNode::setLabelPlaceholderScale(*((CCTextInputNode **)this + 112), 0.6);
*(_QWORD *)(*((_QWORD *)this + 112) + 584LL) = (char *)this + 544;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 112),
5);
v28 = ButtonSprite::create(
(ButtonSprite *)"Online",
(const char *)&qword_28 + 4,
0,
1,
0.4,
"bigFont.fnt",
"GJ_button_01.png",
v27,
24.0);
*((_QWORD *)this + 115) = v28;
v29 = CCMenuItemSpriteExtra::create(v28, 0, (__int64)this, (__int64)LevelPickerPopup::onOnlineMode, 0);
CCMenuItemSpriteExtra::setSizeMult(v29, 1.2);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v29);
v30 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, *((float *)this + 165) + 122.0, v16);
v30(v29, &v58);
v32 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Showing your online levels", "chatFont.fnt", v31);
*((_QWORD *)this + 113) = v32;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v32 + 160LL))(v32, 0.35);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 113) + 1024LL))(
*((_QWORD *)this + 113),
4294967180LL);
v33 = *((_QWORD *)this + 113);
v34 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v33 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
*((float *)this + 165),
(float)(*((float *)this + 166) + (float)(*((float *)this + 168) * 0.5)) - 70.0);
v34(v33, &v58);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 113),
5);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 113) + 344LL))(*((_QWORD *)this + 113), 0);
v36 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_updateBtn_001.png", v35);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v36 + 160LL))(v36, 0.54);
v37 = CCMenuItemSpriteExtra::create(v36, 0, (__int64)this, (__int64)LevelPickerPopup::onRefreshOnline, 0);
*((_QWORD *)this + 114) = v37;
CCMenuItemSpriteExtra::setSizeMult(v37, 1.2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
*((_QWORD *)this + 114));
v38 = *((_QWORD *)this + 114);
v39 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v38 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, *((float *)this + 165) + 175.0, v16);
v39(v38, &v58);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 114) + 344LL))(*((_QWORD *)this + 114), 0);
v41 = ButtonSprite::create(
(ButtonSprite *)"Use ID",
(const char *)&qword_68 + 6,
0,
1,
0.4,
"bigFont.fnt",
"GJ_button_01.png",
v40,
24.0);
*((_QWORD *)this + 117) = v41;
v42 = CCMenuItemSpriteExtra::create(v41, 0, (__int64)this, (__int64)LevelPickerPopup::onUseID, 0);
*((_QWORD *)this + 116) = v42;
CCMenuItemSpriteExtra::setSizeMult(v42, 1.2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
*((_QWORD *)this + 116));
v43 = *((_QWORD *)this + 116);
v44 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v43 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
*((float *)this + 165),
(float)(*((float *)this + 166) - (float)(*((float *)this + 168) * 0.5)) + 20.0);
v44(v43, &v58);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 116) + 344LL))(*((_QWORD *)this + 116), 0);
v61[0] = 0;
v61[1] = 0;
v62 = nullptr;
std::string::__init(v61, "Share", 5u);
v63 = 0;
v64 = 0;
v65 = nullptr;
std::string::__init(
&v63,
"Pick a level or type an ID.\n"
"You can also type links directly: l_123 for a level, li_123 for a list.",
0x7Bu);
v45 = InfoAlertButton::create((char *)v61, (char *)&v63, 0.6);
if ( (v63 & 1) != 0 )
{
operator delete(v65);
if ( (v61[0] & 1) == 0 )
goto LABEL_9;
}
else if ( (v61[0] & 1) == 0 )
{
LABEL_9:
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v45);
v46 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v45 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) - 17.0,
(float)(*((float *)this + 166) - (float)(*((float *)this + 168) * 0.5)) + 16.0);
v46(v45, &v58);
v48 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_viewListsBtn_001.png", v47);
*((_QWORD *)this + 103) = v48;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v48 + 160LL))(v48, 0.6);
v49 = CCMenuItemSpriteExtra::create(
*((_QWORD *)this + 103),
0,
(__int64)this,
(__int64)LevelPickerPopup::onToggleKind,
0);
CCMenuItemSpriteExtra::setSizeMult(v49, 1.2);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v49);
v50 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v49 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, *((float *)this + 165) - 145.0, v16);
v50(v49, &v58);
v52 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"gj_heartOn_001.png", v51);
v54 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"gj_heartOff_001.png", v53);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v52 + 160LL))(v52, 0.72);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v54 + 160LL))(v54, 0.72);
v55 = CCMenuItemToggler::create(v52, v54, (__int64)this, (__int64)LevelPickerPopup::onToggleFavorites, 0);
*((_QWORD *)this + 102) = v55;
*(_BYTE *)(v55 + 393) = 1;
CCMenuItemToggler::setSizeMult(*((CCMenuItemToggler **)this + 102), 1.2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
*((_QWORD *)this + 102));
v56 = *((_QWORD *)this + 102);
v57 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v56 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
(float)(*((float *)this + 165) - (float)(*((float *)this + 167) * 0.5)) + 18.0,
(float)(*((float *)this + 166) - (float)(*((float *)this + 168) * 0.5)) + 18.0);
v57(v56, &v58);
PagedListPopup::loadPage(this, 0);
return inited;
}
operator delete(v62);
goto LABEL_9;
}
if ( inited )
goto LABEL_5;
return inited;
}