//
// LevelListLayer::init from 0x140303640 to 0x1403050bc (6780 bytes)
//
// 2 xrefs:
// > LevelListLayer::scene @ 0x1403035ed
// > ??> @ 0x1406d4460
//
// 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=6
bool LevelListLayer::init(LevelListLayer *a1, GJLevelList *a2)
{
float v2; // xmm0_4
bool result; // al
__int64 v6; // rdx
__int64 v7; // rcx
cocos2d::CCArray *v8; // rax
GJSearchObject *v9; // rax
GJSearchObject *v10; // r13
GJLevelType m_listType; // r12d
void **v12; // rdx
bool v13; // bl
_BOOL8 v14; // rdx
std::string *p_m_unkString; // rcx
void **v16; // rdx
void **v17; // rcx
void **v18; // rax
void **v19; // rbx
void *v20; // rdx
GJSearchObject *m_searchObject; // rcx
__int64 v22; // rcx
_BOOL8 v23; // rdx
__int64 v24; // rcx
cocos2d::CCDirector *v25; // rax
struct cocos2d::CCSprite *v26; // rdi
cocos2d::CCSprite_vtbl *v27; // rbx
const cocos2d::CCPoint *v28; // rax
float v29; // xmm0_4
cocos2d::CCSprite_vtbl *v30; // rbx
double v31; // xmm0_8
const cocos2d::CCPoint *v32; // rax
struct cocos2d::CCSprite *v33; // rdi
cocos2d::CCSprite_vtbl *v34; // rbx
const cocos2d::CCPoint *v35; // rax
cocos2d::CCSprite_vtbl *v36; // rbx
__int64 v37; // rcx
cocos2d::CCDirector *v38; // rax
__int64 v39; // rcx
cocos2d::CCDirector *v40; // rax
float v41; // xmm0_4
double v42; // xmm0_8
const cocos2d::CCPoint *v43; // rax
struct cocos2d::CCSprite *v44; // rdi
cocos2d::CCSprite_vtbl *v45; // rbx
const cocos2d::CCPoint *v46; // rax
cocos2d::CCSprite_vtbl *v47; // rbx
__int64 v48; // rcx
cocos2d::CCDirector *v49; // rax
__int64 v50; // rcx
cocos2d::CCDirector *v51; // rax
float v52; // xmm0_4
const cocos2d::CCPoint *v53; // rax
struct cocos2d::CCSprite *v54; // rax
CCMenuItemSpriteExtra *v55; // r14
cocos2d::CCMenu *v56; // rax
cocos2d::CCMenu *m_buttonMenu; // rcx
cocos2d::CCMenu_vtbl *v58; // rbx
cocos2d::CCDirector *v59; // rax
__int64 v60; // rcx
cocos2d::CCDirector *v61; // rax
float v62; // xmm0_4
const cocos2d::CCPoint *v63; // rax
unsigned int m_difficulty; // edx
cocos2d::CCString *v65; // rax
const char *CString; // rax
size_t v67; // r8
void **v68; // rcx
void *v69; // rcx
__int64 v70; // rcx
cocos2d::CCDirector *v71; // rax
float v72; // xmm0_4
struct cocos2d::CCRect *v73; // rax
struct cocos2d::extension::CCScale9Sprite *v74; // rbx
__int64 v75; // rdx
const char *v76; // r9
GJLevelList *m_levelList; // rdx
CCTextInputNode *v78; // rax
bool v79; // bl
CCTextInputNode *m_titleInput; // rcx
CCTextInputNode *v81; // rcx
__int64 v82; // rcx
void **v83; // rcx
struct cocos2d::CCLabelBMFont *v84; // rbx
void **v85; // rcx
struct cocos2d::CCLabelBMFont *v86; // r14
cocos2d::CCLabelBMFont_vtbl *v87; // rbx
__int64 v88; // rcx
cocos2d::CCDirector *v89; // rax
float v90; // xmm0_4
const cocos2d::CCPoint *v91; // rax
const char *origin; // rcx
cocos2d::CCLabelBMFont *v93; // rdi
float width; // xmm6_4
double v95; // xmm0_8
float v96; // xmm7_4
float v97; // xmm6_4
double v98; // xmm0_8
__int64 v99; // rax
CCMenuItemSpriteExtra *v100; // rsi
CCMenuItemSpriteExtra_vtbl *v101; // rbx
struct cocos2d::CCPoint v102; // rax
const cocos2d::CCSize *v103; // rbx
double v104; // xmm0_8
float v105; // xmm8_4
float v106; // xmm6_4
double v107; // xmm0_8
float v108; // xmm7_4
float *v109; // rbx
double v110; // xmm0_8
float v111; // xmm6_4
float *v112; // rbx
float v113; // xmm6_4
__int64 v114; // rax
float v115; // xmm0_4
__int64 v116; // rax
float *v117; // rbx
double v118; // xmm0_8
__int64 v119; // rax
double v120; // xmm0_8
const cocos2d::CCPoint *v121; // rax
cocos2d::CCDirector *v122; // rax
__int64 v123; // rcx
cocos2d::CCDirector *v124; // rax
float ScreenRight; // xmm0_4
struct cocos2d::CCSprite *v126; // rbx
CCMenuItemSpriteExtra *v127; // rax
CCMenuItemSpriteExtra_vtbl *v128; // rbx
struct cocos2d::CCPoint v129; // rax
float v130; // xmm0_4
const cocos2d::CCPoint *v131; // rax
struct cocos2d::CCSprite *v132; // rbx
CCMenuItemSpriteExtra *v133; // rbx
struct cocos2d::CCSprite *v134; // rbx
CCMenuItemSpriteExtra *v135; // rax
float v136; // xmm0_4
const cocos2d::CCPoint *v137; // rax
struct cocos2d::CCSprite *v138; // rbx
CCMenuItemSpriteExtra *v139; // rbx
float v140; // xmm0_4
__int64 v141; // rax
const char *v142; // rcx
struct cocos2d::CCSprite *v143; // rax
CCMenuItemSpriteExtra *v144; // rbx
float v145; // xmm0_4
__int64 v146; // rax
double v147; // xmm0_8
GJAccountManager *v148; // rax
struct cocos2d::CCSprite *v149; // rbx
CCMenuItemSpriteExtra *v150; // rbx
struct cocos2d::CCSprite *v151; // rbx
CCMenuItemSpriteExtra *v152; // rdi
CCMenuItemSpriteExtra_vtbl *v153; // rbx
struct cocos2d::CCPoint v154; // rax
float v155; // xmm0_4
__int64 v156; // rax
struct cocos2d::CCSprite *v157; // rsi
CCMenuItemSpriteExtra *v158; // rax
struct cocos2d::CCSprite *v159; // rbx
CCMenuItemSpriteExtra *v160; // rbx
float v161; // xmm0_4
__int64 v162; // rax
struct cocos2d::CCSprite *v163; // rbx
CCMenuItemSpriteExtra *v164; // rbx
float v165; // xmm0_4
__int64 v166; // rax
double v167; // xmm0_8
struct cocos2d::CCSprite *v168; // rdi
cocos2d::CCSprite_vtbl *v169; // rbx
float *v170; // rax
const cocos2d::CCPoint *v171; // rax
cocos2d::CCSprite_vtbl *v172; // rbx
const cocos2d::CCPoint *v173; // rax
CCMenuItemSpriteExtra *v174; // rbx
float v175; // xmm0_4
__int64 v176; // rax
struct cocos2d::CCSprite *v177; // rbx
CCMenuItemSpriteExtra *v178; // rbx
float v179; // xmm0_4
__int64 v180; // rax
struct cocos2d::CCSprite *v181; // rdi
cocos2d::CCSprite_vtbl *v182; // rbx
__int64 v183; // rax
struct cocos2d::CCSprite *v184; // rax
CCMenuItemSpriteExtra *v185; // rdi
float v186; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v187; // rbx
struct cocos2d::CCPoint v188; // rax
LoadingCircle *v189; // rax
double v190; // xmm0_8
const struct cocos2d::CCPoint *v191; // rax
char *v192; // rax
__int64 v193; // rbx
__int64 v194; // rax
__int64 v195; // rdx
__int64 v196; // rcx
int v197; // [rsp+28h] [rbp-E0h]
CCMenuItemSpriteExtra *v198; // [rsp+48h] [rbp-C0h] BYREF
void **v199; // [rsp+50h] [rbp-B8h] BYREF
struct cocos2d::CCPoint v200; // [rsp+58h] [rbp-B0h] BYREF
float v201; // [rsp+60h] [rbp-A8h]
struct cocos2d::CCPoint v202; // [rsp+68h] [rbp-A0h] BYREF
void *Src[4]; // [rsp+78h] [rbp-90h] BYREF
void *v204[4]; // [rsp+98h] [rbp-70h] BYREF
void *Block[2]; // [rsp+B8h] [rbp-50h] BYREF
__int64 v206; // [rsp+C8h] [rbp-40h]
unsigned __int64 v207; // [rsp+D0h] [rbp-38h]
cocos2d::CCRect v208; // [rsp+D8h] [rbp-30h] BYREF
unsigned __int64 v209; // [rsp+F0h] [rbp-18h]
LODWORD(v198) = 0;
result = cocos2d::CCLayerColor::initWithColor(a1, (const struct cocos2d::_ccColor4B *)&v198);
if ( !result )
return result;
a1->m_editMode = 0;
v6 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v199 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v199);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v6 = qword_1406C2EC0;
}
sub_14003BDB0((__int64)Block, v6 + 640);
sub_140051590((__int64)&a1->m_searchKey1, (__int64)Block);
sub_14003A830((__int64)Block);
a1->m_levelList = a2;
cocos2d::CCObject::retain(a2);
v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);
a1->m_objects = v8;
cocos2d::CCObject::retain(v8);
v9 = GJSearchObject::create_2(LevelListsOnClick);
v10 = v9;
m_listType = a1->m_levelList->m_listType;
if ( m_listType != Editor )
{
v18 = (void **)GameToolbox::intToString(Block, a2->m_listID);
v19 = v18;
v199 = v18;
if ( &v10->m_searchQuery != (std::string *)v18 )
{
v20 = v18;
if ( (unsigned __int64)v18[3] > 0xF )
v20 = *v18;
sub_14003CCE0((void **)&v10->m_searchQuery, v20, (size_t)v18[2]);
}
v17 = v19;
goto LABEL_20;
}
a1->m_listHeight = 200;
a1->m_unkFloat = -9.0;
v9->m_searchType = Type26;
v9->m_folder = 31;
sub_14003BDB0((__int64)Src, (__int64)&a2->m_levelsString);
v199 = Src;
if ( &v10->m_searchQuery != (std::string *)Src )
{
v12 = Src;
if ( Src[3] > (void *)0xF )
v12 = (void **)Src[0];
sub_14003CCE0((void **)&v10->m_searchQuery, v12, (size_t)Src[2]);
}
sub_14003A830((__int64)Src);
sub_14003BDB0((__int64)Block, (__int64)&a1->m_levelList->m_listName);
v13 = v206 != 0;
sub_14003A830((__int64)Block);
if ( v13 )
{
sub_14003BDB0((__int64)v204, (__int64)&a1->m_levelList->m_listName);
v199 = v204;
p_m_unkString = &a1->m_levelList->m_unkString;
if ( p_m_unkString != (std::string *)v204 )
{
v16 = v204;
if ( v204[3] > (void *)0xF )
v16 = (void **)v204[0];
sub_14003CCE0((void **)p_m_unkString, v16, (size_t)v204[2]);
}
v17 = v204;
LABEL_20:
sub_14003A830((__int64)v17);
}
if ( a1->m_searchObject != v10 )
{
if ( v10 )
cocos2d::CCObject::retain(v10);
m_searchObject = a1->m_searchObject;
if ( m_searchObject )
cocos2d::CCObject::release(m_searchObject);
a1->m_searchObject = v10;
}
v22 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v199 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v199);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v22 = qword_1406C2EC0;
}
*(_DWORD *)(v22 + 904) = v10->m_searchType;
LOBYTE(v14) = 1;
a1->setKeypadEnabled(a1, v14);
LOBYTE(v23) = 1;
a1->setKeyboardEnabled(a1, v23);
v25 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
cocos2d::CCDirector::getWinSize(v25);
v26 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v27 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v2, 0.0);
v27->setAnchorPoint(v26, v28);
a1->addChild_0(a1, v26, -2);
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleX)(v26);
v29 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleY)(v26);
v30 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v31 = cocos2d::CCPoint::CCPoint(v29, -5.0);
v30->setPosition_0(v26, v32);
LOWORD(v198) = 26112;
BYTE2(v198) = -1;
v26->setColor(&v26->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v198);
v33 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v34 = v33->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v31, 0.0);
v34->setAnchorPoint(v33, v35);
v36 = v33->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v38 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v37);
cocos2d::CCDirector::getScreenBottom(v38);
v40 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v39);
v41 = cocos2d::CCDirector::getScreenLeft(v40) - 1.0;
v42 = cocos2d::CCPoint::CCPoint(v41, v41);
v36->setPosition_0(v33, v43);
a1->addChild_0(a1, v33, 1);
v44 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v45 = v44->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v42, 1.0);
v45->setAnchorPoint(v44, v46);
v47 = v44->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v48);
cocos2d::CCDirector::getScreenBottom(v49);
v51 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v50);
v52 = cocos2d::CCDirector::getScreenRight(v51) + 1.0;
cocos2d::CCPoint::CCPoint(v52, v52);
v47->setPosition_0(v44, v53);
cocos2d::CCSprite::setFlipX(v44, 1);
a1->addChild_0(a1, v44, 1);
v54 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v55 = CCMenuItemSpriteExtra::create(v54, nullptr, a1, (cocos2d::SEL_MenuHandler *)sub_1402CFECC);
v198 = v55;
HIDWORD(v55->m_pfnSelector.adj) = 1070386381;
v56 = cocos2d::CCMenu::create(v55, 0);
a1->m_buttonMenu = v56;
a1->addChild_0(a1, v56, 1);
m_buttonMenu = a1->m_buttonMenu;
v58 = m_buttonMenu->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v59 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(m_buttonMenu);
cocos2d::CCDirector::getScreenTop(v59);
v61 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v60);
v62 = cocos2d::CCDirector::getScreenLeft(v61) + 24.0;
cocos2d::CCPoint::CCPoint(v62, v62);
v58->setPosition_0(a1->m_buttonMenu, v63);
m_difficulty = a1->m_levelList->m_difficulty;
if ( m_difficulty )
{
if ( m_difficulty <= 0xA )
{
if ( m_difficulty == 6 || m_difficulty == 7 )
{
++m_difficulty;
}
else if ( m_difficulty == 8 )
{
m_difficulty = 6;
}
}
else
{
m_difficulty = 0;
}
v65 = cocos2d::CCString::createWithFormat("diffIcon_%02d_btn_001.png", m_difficulty);
CString = cocos2d::CCString::getCString(v65);
*(_OWORD *)Block = 0;
v206 = 0;
v207 = 0;
v67 = -1;
do
++v67;
while ( CString[v67] );
sub_14003A930(Block, CString, v67);
}
else
{
*(_OWORD *)Block = 0;
v206 = 0;
v207 = 15;
Block[0] = sub_14003AA10(0x20u);
v206 = 25;
v207 = 31;
strcpy((char *)Block[0], "diffIcon_auto_btn_001.png");
}
v68 = Block;
if ( v207 > 0xF )
v68 = (void **)Block[0];
a1->m_diffSprite = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v68);
if ( v207 > 0xF )
{
v69 = Block[0];
if ( v207 + 1 >= 0x1000 )
{
v69 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v69 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v69);
}
a1->m_featureSprite = cocos2d::CCSprite::createWithSpriteFrameName("GJ_featuredCoin_001.png");
if ( m_listType == Editor )
{
cocos2d::CCRect::CCRect(&v208, 0.0, 0.0, 80.0, 80.0);
v71 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v70);
v72 = cocos2d::CCDirector::getScreenTop(v71) - 30.0;
cocos2d::CCPoint::CCPoint(v72, v201 * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, &v208);
v74 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v73);
LOBYTE(v75) = -1;
v74->setOpacity(&v74->cocos2d::CCRGBAProtocol, v75);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v199, 365.0, 40.0);
v74->setContentSize(v74, (const cocos2d::CCSize *)&v199);
a1->addChild_0(a1, v74, -1);
v74->setPosition_0(v74, &v200);
LOWORD(v198) = 14336;
BYTE2(v198) = -115;
v74->setColor(&v74->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v198);
m_levelList = a1->m_levelList;
if ( m_levelList->m_listVersion > 1 || m_levelList->m_uploaded )
{
sub_14003BDB0((__int64)Block, (__int64)&m_levelList->m_listName);
v83 = Block;
if ( v207 > 0xF )
v83 = (void **)Block[0];
v84 = cocos2d::CCLabelBMFont::create((const char *)v83, "goldFont.fnt");
sub_14003A830((__int64)Block);
a1->addChild_0(a1, v84, 20);
v84->setPosition_0(v84, &v200);
}
else
{
v78 = CCTextInputNode::create(
300.0,
50.0,
(const char *)&qword_140584770,
v76,
v197,
(const char *)&qword_14052A4D8);
a1->m_titleInput = v78;
a1->addChild_0(a1, v78, 18);
a1->m_titleInput->m_delegate = &a1->TextInputDelegate;
a1->m_titleInput->setTag(a1->m_titleInput, 1002);
a1->m_titleInput->setPosition_0(a1->m_titleInput, &v200);
a1->m_titleInput->m_maxLabelLength = 25;
a1->m_titleInput->m_filterSwearWords = 1;
sub_14003BDB0((__int64)Block, (__int64)&a1->m_levelList->m_listName);
v79 = v206 != 0;
sub_14003A830((__int64)Block);
if ( v79 )
{
sub_14003BDB0((__int64)Block, (__int64)&a1->m_levelList->m_listName);
CCTextInputNode::setString((__int64)a1->m_titleInput, Block);
}
LOWORD(v198) = -21896;
m_titleInput = a1->m_titleInput;
*(_WORD *)&m_titleInput->m_placeholderColor.r = -21896;
m_titleInput->m_placeholderColor.b = -16;
CCTextInputNode::refreshLabel(m_titleInput);
v81 = a1->m_titleInput;
v81->m_placeholderScale = 0.69999999;
CCTextInputNode::refreshLabel(v81);
}
}
else
{
sub_14003BDB0((__int64)Block, (__int64)&a2->m_listName);
v85 = Block;
if ( v207 > 0xF )
v85 = (void **)Block[0];
v86 = cocos2d::CCLabelBMFont::create((const char *)v85, (const char *)&qword_14052A4D8);
sub_14003A830((__int64)Block);
a1->addChild_0(a1, v86, 20);
v87 = v86->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v89 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v88);
v90 = cocos2d::CCDirector::getScreenTop(v89) - 20.0;
cocos2d::CCPoint::CCPoint(v90, v201 * 0.5);
v87->setPosition_0(v86, v91);
cocos2d::CCLabelBMFont::limitLabelWidth(v86, 240.0, 0.80000001, 0.0);
sub_14003BDB0((__int64)&v208, (__int64)&a2->m_creatorName);
origin = (const char *)&v208;
if ( v209 > 0xF )
origin = (const char *)v208.origin;
v93 = cocos2d::CCLabelBMFont::create(origin, "goldFont.fnt");
sub_14003A830((__int64)&v208);
cocos2d::CCLabelBMFont::limitLabelWidth(v93, 90.0, 0.80000001, 0.0);
width = v93->getContentSize(v93)->width;
v95 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v93->getScale)(v93);
v96 = *(float *)&v95 * (float)(width * 0.5);
v97 = v86->getContentSize(v86)->width * 0.5;
v98 = ((double (__fastcall *)(struct cocos2d::CCLabelBMFont *))v86->getScale)(v86);
cocos2d::CCPoint::CCPoint(
(float)((float)(*(float *)&v98 * v97) + v96) + 10.0,
(float)((float)(*(float *)&v98 * v97) + v96) + 10.0);
v99 = (__int64)v86->getPosition_0(v86);
cocos2d::CCPoint::operator+(v99, &v199);
v100 = CCMenuItemSpriteExtra::create(v93, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onViewProfile);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v100);
v101 = v100->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v102 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v200);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v101->setPosition_0)(v100, v102);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_diffSprite->setScale_0)(a1->m_diffSprite);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_featureSprite->setScale_0)(a1->m_featureSprite);
v103 = a1->m_diffSprite->getContentSize(a1->m_diffSprite);
v104 = ((double (__fastcall *)(cocos2d::CCSprite *))a1->m_diffSprite->getScale)(a1->m_diffSprite);
v105 = *(float *)&v104 * v103->width;
v106 = v93->getContentSize(v93)->width;
v107 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v93->getScale)(v93);
v108 = *(float *)&v107 * v106;
v109 = (float *)v86->getContentSize(v86);
v110 = ((double (__fastcall *)(struct cocos2d::CCLabelBMFont *))v86->getScale)(v86);
v111 = (float)((float)((float)((float)(*(float *)&v110 * *v109) + v108) + 10.0) - v105) - 10.0;
v112 = (float *)v86->getContentSize(v86);
*(float *)&v110 = v86->getScale(v86) * *v112;
v113 = (float)-(float)(v111 - *(float *)&v110) * 0.5;
cocos2d::CCPoint::CCPoint(*(float *)&v110, v113);
v114 = (__int64)v86->getPosition_0(v86);
cocos2d::CCPoint::operator+(v114, &v200);
v115 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, struct cocos2d::CCPoint *))v86->setPosition_0)(
v86,
&v200);
cocos2d::CCPoint::CCPoint(v115, v113);
v116 = (__int64)v100->getPosition_0(v100);
cocos2d::CCPoint::operator+(v116, &v200);
v100->setPosition_0(v100, &v200);
a1->addChild_0(a1, a1->m_diffSprite, 2);
a1->addChild_0(a1, a1->m_featureSprite, 1);
v117 = (float *)v86->getContentSize(v86);
v118 = ((double (__fastcall *)(struct cocos2d::CCLabelBMFont *))v86->getScale)(v86);
cocos2d::CCPoint::CCPoint(
(float)((float)((float)-(float)(*(float *)&v118 * *v117) * 0.5) - (float)(v105 * 0.5)) - 10.0,
(float)((float)((float)-(float)(*(float *)&v118 * *v117) * 0.5) - (float)(v105 * 0.5)) - 10.0);
v119 = (__int64)v86->getPosition_0(v86);
cocos2d::CCPoint::operator+(v119, &v200);
a1->m_diffSprite->setPosition_0(a1->m_diffSprite, &v200);
v120 = ((double (__fastcall *)(cocos2d::CCSprite *))a1->m_diffSprite->getScale)(a1->m_diffSprite);
cocos2d::CCPoint::CCPoint(*(float *)&v120 * -6.0, 0.0);
v121 = a1->m_diffSprite->getPosition_0(a1->m_diffSprite);
cocos2d::CCPoint::operator+(v121, &v200);
a1->m_featureSprite->setPosition_0(a1->m_featureSprite, &v200);
v55 = v198;
}
a1->m_unk2 = 1;
v122 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v82);
cocos2d::CCDirector::getScreenTop(v122);
v124 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v123);
ScreenRight = cocos2d::CCDirector::getScreenRight(v124);
cocos2d::CCPoint::CCPoint((float)(ScreenRight - 25.0) - 0.0, (float)(ScreenRight - 25.0) - 0.0);
cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v202);
if ( m_listType == Editor )
{
v151 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v151->setScale_0)(v151);
v152 = CCMenuItemSpriteExtra::create(v151, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::confirmDelete);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v152);
v153 = v152->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v154 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v208.origin);
v155 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v153->setPosition_0)(v152, v154);
cocos2d::CCPoint::CCPoint(v155, 0.0);
v156 = (__int64)v152->getPosition_0(v152);
cocos2d::CCPoint::operator+(v156, &v199);
cocos2d::CCPoint::operator=(&v202, &v199);
v157 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v157->setScale_0)(v157);
v158 = CCMenuItemSpriteExtra::create(v157, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelBrowserLayer::onRefresh);
a1->m_refreshBtn = v158;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v158);
a1->m_refreshBtn->setPosition_0(a1->m_refreshBtn, &v202);
a1->m_refreshBtn->getPosition_0(a1->m_refreshBtn);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v198);
v159 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_chatBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v159->setScale_0)(v159);
v160 = CCMenuItemSpriteExtra::create(v159, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onDescription);
v161 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v160);
cocos2d::CCPoint::CCPoint(v161, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v160->setPosition_0(v160, (const cocos2d::CCPoint *)&v199);
v162 = (__int64)v160->getPosition_0(v160);
cocos2d::CCPoint::operator=(&v198, v162);
v163 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_editModeBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v163->setScale_0)(v163);
v164 = CCMenuItemSpriteExtra::create(
v163,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)LevelListLayer::onToggleEditMode);
v165 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v164);
cocos2d::CCPoint::CCPoint(v165, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v164->setPosition_0(v164, (const cocos2d::CCPoint *)&v199);
v166 = (__int64)v164->getPosition_0(v164);
v167 = cocos2d::CCPoint::operator=(&v198, v166);
v168 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plainBtn_001.png");
v168->addChild_0(v168, a1->m_diffSprite, 3);
v168->addChild_0(v168, a1->m_featureSprite, 2);
v169 = a1->m_diffSprite->__vftable;
v168->getContentSize(v168);
v170 = (float *)v168->getContentSize(v168);
cocos2d::CCPoint::CCPoint(*(float *)&v167, *v170 * 0.5);
v169->setPosition_0(a1->m_diffSprite, v171);
v172 = a1->m_featureSprite->__vftable;
v173 = a1->m_diffSprite->getPosition_0(a1->m_diffSprite);
v172->setPosition_0(a1->m_featureSprite, v173);
((void (__fastcall *)(struct cocos2d::CCSprite *))v168->setScale_0)(v168);
v174 = CCMenuItemSpriteExtra::create(v168, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onSelectIcon);
v175 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v174);
cocos2d::CCPoint::CCPoint(v175, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v174->setPosition_0(v174, (const cocos2d::CCPoint *)&v199);
v176 = (__int64)v174->getPosition_0(v174);
cocos2d::CCPoint::operator=(&v198, v176);
v177 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v177->setScale_0)(v177);
v178 = CCMenuItemSpriteExtra::create(v177, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::confirmClone);
v179 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v178);
cocos2d::CCPoint::CCPoint(v179, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v178->setPosition_0(v178, (const cocos2d::CCPoint *)&v199);
v180 = (__int64)v178->getPosition_0(v178);
cocos2d::CCPoint::operator=(&v198, v180);
v181 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_shareBtn_001.png");
v182 = v181->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v157->getContentSize(v157);
v147 = ((double (__fastcall *)(struct cocos2d::CCSprite *))v157->getScale)(v157);
v181->getContentSize(v181);
((void (__fastcall *)(struct cocos2d::CCSprite *))v182->setScale_0)(v181);
v150 = CCMenuItemSpriteExtra::create(v181, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onShare);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v150);
}
else
{
v126 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v126->setScale_0)(v126);
v127 = CCMenuItemSpriteExtra::create(
v126,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)LevelListLayer::onRefreshLevelList);
a1->m_refreshBtn = v127;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v127);
v128 = a1->m_refreshBtn->LevelBrowserLayer::__vftable;
v129 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v208.origin);
v130 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v128->setPosition_0)(
a1->m_refreshBtn,
v129);
cocos2d::CCPoint::CCPoint(v130, 0.0);
v131 = a1->m_refreshBtn->getPosition_0(a1->m_refreshBtn);
cocos2d::CCPoint::operator+(v131, &v199);
cocos2d::CCPoint::operator=(&v202, &v199);
v132 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v132->setScale_0)(v132);
v133 = CCMenuItemSpriteExtra::create(v132, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onInfo);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v133);
v133->setPosition_0(v133, &v202);
v133->getPosition_0(v133);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v198);
v134 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_like2Btn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v134->setScale_0)(v134);
v135 = CCMenuItemSpriteExtra::create(v134, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onLike);
a1->m_likeButton = v135;
v136 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v135);
cocos2d::CCPoint::CCPoint(v136, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
a1->m_likeButton->setPosition_0(a1->m_likeButton, (const cocos2d::CCPoint *)&v199);
v137 = a1->m_likeButton->getPosition_0(a1->m_likeButton);
cocos2d::CCPoint::operator=(&v198, v137);
v138 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v138->setScale_0)(v138);
v139 = CCMenuItemSpriteExtra::create(v138, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::confirmClone);
v140 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v139);
cocos2d::CCPoint::CCPoint(v140, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v139->setPosition_0(v139, (const cocos2d::CCPoint *)&v199);
v141 = (__int64)v139->getPosition_0(v139);
cocos2d::CCPoint::operator=(&v198, v141);
v142 = "gj_heartOff_001.png";
if ( a1->m_levelList->m_favorite )
v142 = "gj_heartOn_001.png";
v143 = cocos2d::CCSprite::createWithSpriteFrameName(v142);
v144 = CCMenuItemSpriteExtra::create(v143, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onFavorite);
HIDWORD(v144->m_pfnSelector.adj) = 1066192077;
v145 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *, __int64))a1->m_buttonMenu->addChild_0)(
a1->m_buttonMenu,
v144,
100);
cocos2d::CCPoint::CCPoint(v145, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v144->setPosition_0(v144, (const cocos2d::CCPoint *)&v199);
v146 = (__int64)v144->getPosition_0(v144);
v147 = cocos2d::CCPoint::operator=(&v198, v146);
v148 = GJAccountManager::sharedState();
if ( a1->m_levelList->m_accountID != v148->m_accountID - v148->m_unkInt1 )
goto LABEL_69;
v149 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteServerBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v149->setScale_0)(v149);
v150 = CCMenuItemSpriteExtra::create(
v149,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)LevelListLayer::confirmOwnerDelete);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v150);
}
cocos2d::CCPoint::CCPoint(*(float *)&v147, 0.0);
cocos2d::CCPoint::operator+(&v198, &v199);
v150->setPosition_0(v150, (const cocos2d::CCPoint *)&v199);
v183 = (__int64)v150->getPosition_0(v150);
cocos2d::CCPoint::operator=(&v198, v183);
LABEL_69:
v184 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v185 = CCMenuItemSpriteExtra::create(v184, nullptr, a1, (cocos2d::SEL_MenuHandler *)LevelListLayer::onListInfo);
HIDWORD(v185->m_pfnSelector.adj) = 1067030938;
v186 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v185);
v187 = v185->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v186, 30.0);
v188 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v199);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v187->setPosition_0)(v185, v188);
v189 = LoadingCircle::create();
a1->m_circle = v189;
v189->m_parentLayer = a1;
a1->m_circle->m_fade = 0;
cocos2d::CCObject::retain(a1->m_circle);
LoadingCircle::show(a1->m_circle);
a1->m_circle->setVisible(a1->m_circle, 0);
v208.origin = (cocos2d::CCPoint)Block;
*(_OWORD *)Block = 0;
v206 = 0;
v207 = 15;
Block[0] = sub_14003AA10(0x20u);
v206 = 31;
v207 = 31;
strcpy((char *)Block[0], "No Internet connection!");
v190 = cocos2d::CCPoint::CCPoint(1.6126443e-19, 0.5);
v192 = TextArea::create((__int64)Block, &qword_14052A4D8, 1.0, 600.0, v191, 1101004800, 0);
a1->m_noInternet = (TextArea *)v192;
v193 = *(_QWORD *)v192;
cocos2d::CCPoint::CCPoint(*(float *)&v190, v201 * 0.5);
(*(void (__fastcall **)(TextArea *, __int64))(v193 + 184))(a1->m_noInternet, v194);
((void (__fastcall *)(TextArea *))a1->m_noInternet->setScale_0)(a1->m_noInternet);
a1->addChild_0(a1, a1->m_noInternet, 2);
a1->m_noInternet->setVisible(a1->m_noInternet, 0);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v196, v195) + 197) )
GameToolbox::addBackButton(a1, v55);
LevelListLayer::updateSideButtons(a1);
LevelListLayer::updateStatsArt(a1);
if ( m_listType == Editor || a1->m_levelList->m_onlineLevelsLoaded )
{
a1->m_cached = 1;
LevelBrowserLayer::setupLevelBrowser(a1, nullptr);
}
else
{
v10->m_folder = 1;
a1->m_levelList->m_onlineLevelsLoaded = 1;
LevelBrowserLayer::loadPage(a1, v10);
}
return 1;
}