//
// LevelListLayer::init from 0x590770 to 0x59197e (4622 bytes)
//
// 1 xrefs:
// > LevelListLayer::create @ 0x591b38
//
// 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 LevelListLayer::init(LevelListLayer *a1, GJLevelList *a2)
{
cocos2d::CCArray *v4; // r0
cocos2d::CCArray *v5; // r0
int v6; // r0
_BOOL4 v7; // r6
int v8; // r5
int v9; // r5
GJLevelList *m_levelList; // r5
cocos2d::CCDirector *v11; // r0
const char *v12; // r1
cocos2d::CCNode *v13; // r9
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // r3
cocos2d::CCSprite *v17; // r9
cocos2d::CCDirector *v18; // r0
float v19; // s17
cocos2d::CCDirector *v20; // r0
float v21; // r0
cocos2d::CCSprite *v22; // r9
void (__fastcall *v23)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
void (__fastcall *v24)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v25; // r0
float v26; // s17
cocos2d::CCDirector *v27; // r0
float v28; // r0
cocos2d::CCSprite *v29; // r0
cocos2d::CCMenu *v30; // r0
LevelListLayer_vtbl *v31; // r3
cocos2d::CCMenu *m_buttonMenu; // r10
void (__fastcall *v33)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCDirector *v34; // r0
float v35; // s16
cocos2d::CCDirector *v36; // r0
float v37; // r0
float width; // s16
cocos2d::CCDirector *v39; // r0
float v40; // r0
cocos2d::CCNode *v41; // r9
int (__fastcall *v42)(const cocos2d::CCObject *__hidden); // r3
GJLevelList *v43; // r1
cocos2d::CCLabelBMFont *v44; // r9
float v45; // s16
void (__fastcall *v46)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCDirector *v47; // r0
float v48; // r0
cocos2d::CCLabelBMFont *v49; // r8
int v50; // r11
float v51; // s16
float v52; // s16
float v53; // s19
float v54; // r0
CCMenuItemSpriteExtra *v55; // r11
float v56; // s19
float v57; // s19
float v58; // s16
float v59; // s16
float v60; // s22
float v61; // s21
float v62; // s20
float v63; // r0
float v64; // s16
int v65; // r10
int v66; // r10
cocos2d::CCSprite *m_diffSprite; // r10
int v68; // r11
float v69; // s16
float v70; // r0
cocos2d::CCSprite *m_featureSprite; // r9
void (__fastcall *v72)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v73; // r11
float v74; // r0
cocos2d::CCDirector *v75; // r0
float v76; // s16
cocos2d::CCDirector *v77; // r0
float v78; // r0
cocos2d::CCSprite *v79; // r5
CCMenuItemSpriteExtra *v80; // r0
CCMenuItemSpriteExtra *m_refreshBtn; // r11
void (__fastcall *v82)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCPoint *v83; // r10
int v84; // r2
bool v85; // r3
cocos2d::CCSprite *v86; // r10
CCMenuItemSpriteExtra *v87; // r10
const cocos2d::CCPoint *v88; // r0
cocos2d::CCSprite *v89; // r10
CCMenuItemSpriteExtra *v90; // r0
CCMenuItemSpriteExtra *m_likeButton; // r11
void (__fastcall *v92)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
float v93; // r0
int v94; // r2
bool v95; // r3
cocos2d::CCSprite *v96; // r10
CCMenuItemSpriteExtra *v97; // r11
void (__fastcall *v98)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
float v99; // r0
int v100; // r2
bool v101; // r3
const char *v102; // r0
cocos2d::CCSprite *v103; // r0
CCMenuItemSpriteExtra *v104; // r11
float v105; // r0
int v106; // r2
bool v107; // r3
int m_accountID; // r11
GJAccountManager *v109; // r0
cocos2d::CCSprite *v110; // r11
CCMenuItemSpriteExtra *v111; // r11
void (__fastcall *v112)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r5
int v113; // r1
int v114; // r2
bool v115; // r3
cocos2d::CCPoint *v116; // r0
cocos2d::CCSprite *v117; // r8
CCMenuItemSpriteExtra *v118; // r11
int v119; // r11
int v120; // r2
bool v121; // r3
CCMenuItemSpriteExtra *v122; // r0
const cocos2d::CCPoint *v123; // r0
cocos2d::CCSprite *v124; // r11
CCMenuItemSpriteExtra *v125; // r11
float v126; // r0
int v127; // r2
bool v128; // r3
cocos2d::CCSprite *v129; // r11
CCMenuItemSpriteExtra *v130; // r11
float v131; // r0
int v132; // r2
bool v133; // r3
cocos2d::CCSprite *v134; // r11
float v135; // s16
int v136; // r0
const cocos2d::CCPoint *v137; // r0
CCMenuItemSpriteExtra *v138; // r11
float v139; // r0
int v140; // r2
bool v141; // r3
cocos2d::CCSprite *v142; // r11
CCMenuItemSpriteExtra *v143; // r11
float v144; // r0
int v145; // r2
bool v146; // r3
cocos2d::CCSprite *v147; // r10
void (__fastcall *setScale)(cocos2d::CCSprite *__hidden, float); // r11
float v149; // s16
float v150; // s16
float *v151; // r0
CCMenuItemSpriteExtra *v152; // r5
void (__fastcall *v153)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v154; // r0
CCMenuItemSpriteExtra *v155; // r9
cocos2d::CCMenu *v156; // r11
void (__fastcall *v157)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
LoadingCircle *v158; // r0
LoadingCircle *m_circle; // r0
TextArea *m_noInternet; // r7
void (__fastcall *v161)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
GJLevelList *v162; // r3
cocos2d::CCLabelBMFont *v164; // r9
CCTextInputNode *v165; // r0
LevelListLayer_vtbl *v166; // r3
CCTextInputNode *m_titleInput; // r3
cocos2d::CCArray *m_pTargetArray; // r8
CCTextInputNode *v169; // r8
char *v170; // r2
float v171; // r2
float v172; // r3
GJSearchObject *v173; // [sp+10h] [bp-D4h]
void (__fastcall *v174)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v175)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v176)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v177)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v178)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v179)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v180)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
void (__fastcall *v181)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-D0h]
int v182; // [sp+18h] [bp-CCh]
CCMenuItemSpriteExtra *v183; // [sp+1Ch] [bp-C8h]
void (__fastcall *v184)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
cocos2d::CCSprite *v185; // [sp+20h] [bp-C4h]
void (__fastcall *v186)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
void (__fastcall *v187)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
void (__fastcall *v188)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
void (__fastcall *v189)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
void (__fastcall *v190)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-C4h]
cocos2d::CCSprite *v191; // [sp+28h] [bp-BCh]
cocos2d::CCSprite *v192; // [sp+28h] [bp-BCh]
cocos2d::CCSprite *v193; // [sp+2Ch] [bp-B8h]
cocos2d::ccColor3B v194; // [sp+38h] [bp-ACh]
cocos2d::CCSize v195; // [sp+3Ch] [bp-A8h] BYREF
cocos2d::CCPoint v196; // [sp+44h] [bp-A0h] BYREF
cocos2d::CCPoint v197; // [sp+4Ch] [bp-98h] BYREF
cocos2d::CCPoint v198; // [sp+54h] [bp-90h] BYREF
cocos2d::CCPoint v199; // [sp+5Ch] [bp-88h] BYREF
int v200; // [sp+64h] [bp-80h]
int v201; // [sp+68h] [bp-7Ch]
void (*v202)(LevelListLayer *, cocos2d::CCObject *); // [sp+6Ch] [bp-78h]
int v203; // [sp+70h] [bp-74h]
void (*v204)(LevelListLayer *, cocos2d::CCObject *); // [sp+74h] [bp-70h]
int v205; // [sp+78h] [bp-6Ch]
void (*v206)(LevelListLayer *, cocos2d::CCObject *); // [sp+7Ch] [bp-68h]
int v207; // [sp+80h] [bp-64h]
void (*v208)(LevelListLayer *, cocos2d::CCObject *); // [sp+84h] [bp-60h]
int v209; // [sp+88h] [bp-5Ch]
void (*v210)(LevelListLayer *, cocos2d::CCObject *); // [sp+8Ch] [bp-58h]
int v211; // [sp+90h] [bp-54h]
cocos2d::CCPoint v212; // [sp+94h] [bp-50h] BYREF
cocos2d::CCPoint v213; // [sp+9Ch] [bp-48h] BYREF
void (*v214)(LevelListLayer *, cocos2d::CCObject *); // [sp+A4h] [bp-40h]
int v215; // [sp+A8h] [bp-3Ch]
void (*v216)(LevelBrowserLayer *, cocos2d::CCObject *); // [sp+ACh] [bp-38h]
int v217; // [sp+B0h] [bp-34h]
void (*v218)(LevelListLayer *, cocos2d::CCObject *); // [sp+B4h] [bp-30h]
int v219; // [sp+B8h] [bp-2Ch]
void (*v220)(LevelListLayer *, cocos2d::CCObject *); // [sp+BCh] [bp-28h]
int v221; // [sp+C0h] [bp-24h]
cocos2d::CCLabelBMFont *v222[2]; // [sp+C4h] [bp-20h] BYREF
cocos2d::CCPoint v223; // [sp+CCh] [bp-18h] BYREF
cocos2d::CCRect v224; // [sp+D4h] [bp-10h] BYREF
cocos2d::CCRect v225; // [sp+E4h] [bp+0h] BYREF
cocos2d::CCSize v226; // 0:^0.8
cocos2d::CCRect v227; // 0:kr00_16.16
v225.origin.x = 0.0;
v182 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v225);
if ( !v182 )
return v182;
a1->m_editMode = 0;
GameLevelManager::sharedState();
sub_775C20(&v225);
sub_774794(&a1->m_searchKey1, &v225);
sub_774008(&v225);
a1->m_levelList = a2;
cocos2d::CCObject::retain(a2);
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
a1->m_objects = v5;
cocos2d::CCObject::retain(v5);
v6 = GJSearchObject::create(25);
v7 = a1->m_levelList->m_listType == Editor;
v173 = (GJSearchObject *)v6;
v8 = v6 + 268;
if ( a1->m_levelList->m_listType == Editor )
{
a1->m_listHeight = 200;
a1->m_unkFloat = -9.0;
*(_DWORD *)(v6 + 264) = 26;
*(_DWORD *)(v6 + 308) = 31;
sub_775C20(&v225);
sub_775D40(v8, &v225);
sub_774008(&v225);
sub_775C20(&v225);
v9 = *(_DWORD *)(LODWORD(v225.origin.x) - 12);
sub_774008(&v225);
if ( !v9 )
goto LABEL_7;
m_levelList = a1->m_levelList;
sub_775C20(&v225);
sub_775D40(&m_levelList->m_unkString, &v225);
}
else
{
GameToolbox::intToString((GameToolbox *)&v225, a2->m_listID);
sub_775D40(v8, &v225);
}
sub_774008(&v225);
LABEL_7:
LevelBrowserLayer::setSearchObject(a1, v173);
GameLevelManager::sharedState()->m_searchType = v173->m_searchType;
a1->setKeypadEnabled(a1, 1);
a1->setKeyboardEnabled(a1, 1);
v11 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v195, v11);
v13 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_gradientBG.png", v12);
setAnchorPoint = v13->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v225.origin, 0.0, 0.0);
setAnchorPoint(v13, &v225.origin);
a1->addChild_0(a1, v13, -2);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v13->setScaleX)(v13, (float)(v195.width + 10.0) / v13[1].m_fSkewX);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v13->setScaleY)(v13, (float)(v195.height + 10.0) / v13[1].m_fSkewY);
setPosition = v13->setPosition;
cocos2d::CCPoint::CCPoint(&v225.origin, -5.0, -5.0);
setPosition(v13, &v225.origin);
getTag = v13->__vftable[1].getTag;
LOWORD(v225.origin.x) = 26112;
BYTE2(v225.origin.x) = -1;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))getTag)(v13, &v225);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v174 = v17->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v225.origin, 0.0, 0.0);
v174(v17, &v225.origin);
v175 = v17->setPosition;
v18 = cocos2d::CCDirector::sharedDirector();
v19 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v18));
v20 = cocos2d::CCDirector::sharedDirector();
v21 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v20));
cocos2d::CCPoint::CCPoint(&v225.origin, v19 - 1.0, v21 - 1.0);
v175(v17, &v225.origin);
a1->addChild_0(a1, v17, 1);
v22 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v23 = v22->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v225.origin, 1.0, 0.0);
v23(v22, &v225.origin);
v24 = v22->setPosition;
v25 = cocos2d::CCDirector::sharedDirector();
v26 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v25));
v27 = cocos2d::CCDirector::sharedDirector();
v28 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v27));
cocos2d::CCPoint::CCPoint(&v225.origin, v26 + 1.0, v28 - 1.0);
v24(v22, &v225.origin);
cocos2d::CCSprite::setFlipX(v22, 1);
a1->addChild_0(a1, v22, 1);
v29 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v200 = 656;
v201 = 1;
v183 = CCMenuItemSpriteExtra::create(v29, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29000000000LL));
CCMenuItemSpriteExtra::setSizeMult(v183, 1.6);
v30 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v183, nullptr);
v31 = a1->LevelBrowserLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_buttonMenu = v30;
v31->addChild_0(a1, v30, 1);
m_buttonMenu = a1->m_buttonMenu;
v33 = m_buttonMenu->setPosition;
v34 = cocos2d::CCDirector::sharedDirector();
v35 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v34));
v36 = cocos2d::CCDirector::sharedDirector();
v37 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v36));
cocos2d::CCPoint::CCPoint(&v225.origin, v35 + 24.0, v37 - 23.0);
v33(m_buttonMenu, &v225.origin);
GJLevelList::frameForListDifficulty((int)&v225, (const char *)a1->m_levelList->m_difficulty, 2);
a1->m_diffSprite = cocos2d::CCSprite::createWithSpriteFrameName((const char *)LODWORD(v225.origin.x));
sub_774008(&v225);
a1->m_featureSprite = cocos2d::CCSprite::createWithSpriteFrameName("GJ_featuredCoin_001.png");
if ( v7 )
{
cocos2d::CCRect::CCRect(&v224, 0.0, 0.0, 80.0, 80.0);
width = v195.width;
v39 = cocos2d::CCDirector::sharedDirector();
v40 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v39));
cocos2d::CCPoint::CCPoint(&v223, width * 0.5, v40 - 30.0);
cocos2d::CCRect::CCRect(&v225, &v224);
v227.origin.x = v171;
v227.origin.y = v172;
v227.size = v226;
v41 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02b_001.png",
(const char *)&v225,
v227);
((void (__fastcall *)(cocos2d::CCNode *, int))v41->__vftable[1].~CCNode_0)(v41, 255);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v225, 365.0, 40.0);
v41->setContentSize(v41, (const cocos2d::CCSize *)&v225);
a1->addChild_0(a1, v41, -1);
v41->setPosition(v41, &v223);
v42 = v41->__vftable[1].getTag;
LOWORD(v222[0]) = 14336;
BYTE2(v222[0]) = -115;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont **))v42)(v41, v222);
v43 = a1->m_levelList;
if ( v43->m_listVersion > 1 || v43->m_uploaded )
{
sub_775C20(v222);
v164 = cocos2d::CCLabelBMFont::create();
sub_774008(v222);
a1->addChild_0(a1, v164, 20);
v164->setPosition(v164, &v223);
}
else
{
v165 = CCTextInputNode::create(300.0, 50.0, "List Name", "Thonburi");
v166 = a1->LevelBrowserLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_titleInput = v165;
((void (__fastcall *)(LevelListLayer *, CCTextInputNode *, int, void (__fastcall *)(cocos2d::CCNode *__hidden, cocos2d::CCNode *, int), int *, const char *))v166->addChild_0)(
a1,
v165,
18,
v166->addChild_0,
&dword_18,
"bigFont.fnt");
a1->m_titleInput->m_delegate = &a1->TextInputDelegate;
a1->m_titleInput->setTag(a1->m_titleInput, 1002);
a1->m_titleInput->setPosition(a1->m_titleInput, &v223);
m_titleInput = a1->m_titleInput;
m_titleInput->m_maxLabelLength = 25;
m_titleInput->m_filterSwearWords = 1;
sub_775C20(v222);
m_pTargetArray = v222[0][-1].m_pTargetArray;
sub_774008(v222);
if ( m_pTargetArray )
{
v169 = a1->m_titleInput;
sub_775C20(v222);
CCTextInputNode::setString((int)v169, (char *)v222, v170);
sub_774008(v222);
}
*(_WORD *)&v194.r = -21896;
v194.b = -16;
CCTextInputNode::setLabelPlaceholderColor(a1->m_titleInput, v194);
CCTextInputNode::setLabelPlaceholderScale(a1->m_titleInput, 0.7);
}
}
else
{
sub_775C20(&v225);
v44 = cocos2d::CCLabelBMFont::create();
sub_774008(&v225);
a1->addChild_0(a1, v44, 20);
v45 = v195.width;
v46 = v44->setPosition;
v47 = cocos2d::CCDirector::sharedDirector();
v48 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v47));
cocos2d::CCPoint::CCPoint(&v225.origin, v45 * 0.5, v48 - 20.0);
v46(v44, &v225.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v44, 240.0, 0.8, 0.0);
sub_775C20(&v225);
v49 = cocos2d::CCLabelBMFont::create();
sub_774008(&v225);
cocos2d::CCLabelBMFont::limitLabelWidth(v49, 90.0, 0.8, 0.0);
v50 = (int)v44->getPosition(v44);
v51 = v44->getContentSize(v44)->width;
v52 = (float)(v51 * 0.5) * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v44->getScale)(v44));
v53 = v49->getContentSize(v49)->width;
v54 = v49->getScale(v49);
cocos2d::CCPoint::CCPoint(&v225.origin, (float)(v52 + (float)((float)(v53 * 0.5) * v54)) + 10.0, 0.0);
cocos2d::CCPoint::operator+(&v223, v50, &v225);
v203 = 0;
v202 = LevelListLayer::onViewProfile;
v55 = CCMenuItemSpriteExtra::create(
v49,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onViewProfile, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v55);
v176 = v55->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v225.origin, a1->m_buttonMenu, &v223);
v176(v55, &v225.origin);
((void (__fastcall *)(cocos2d::CCSprite *, int))a1->m_diffSprite->setScale)(a1->m_diffSprite, 1061997773);
((void (__fastcall *)(cocos2d::CCSprite *, int))a1->m_featureSprite->setScale)(a1->m_featureSprite, 1061997773);
v56 = a1->m_diffSprite->getContentSize(a1->m_diffSprite)->width;
v57 = v56 * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCSprite *))a1->m_diffSprite->getScale)(a1->m_diffSprite));
v58 = v44->getContentSize(v44)->width;
v59 = v58 * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v44->getScale)(v44));
v60 = v49->getContentSize(v49)->width;
v61 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v49->getScale)(v49));
v62 = v44->getContentSize(v44)->width;
v63 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v44->getScale)(v44));
v177 = v44->setPosition;
v64 = -(float)((float)((float)((float)((float)((float)(v59 + (float)(v60 * v61)) + 10.0) - v57) - 10.0)
- (float)(v62 * v63))
* 0.5);
v65 = (int)v44->getPosition(v44);
cocos2d::CCPoint::CCPoint(&v224.origin, v64, 0.0);
cocos2d::CCPoint::operator+(&v225, v65, &v224);
v177(v44, &v225.origin);
v178 = v55->setPosition;
v66 = (int)v55->getPosition(v55);
cocos2d::CCPoint::CCPoint(&v224.origin, v64, 0.0);
cocos2d::CCPoint::operator+(&v225, v66, &v224);
v178(v55, &v225.origin);
a1->addChild_0(a1, a1->m_diffSprite, 2);
a1->addChild_0(a1, a1->m_featureSprite, 1);
m_diffSprite = a1->m_diffSprite;
v179 = m_diffSprite->setPosition;
v68 = (int)v44->getPosition(v44);
v69 = v44->getContentSize(v44)->width;
v70 = v44->getScale(v44);
cocos2d::CCPoint::CCPoint(
&v224.origin,
(float)((float)((float)-(float)(v70 * v69) * 0.5) - (float)(v57 * 0.5)) - 10.0,
-1.0);
cocos2d::CCPoint::operator+(&v225, v68, &v224);
v179(m_diffSprite, &v225.origin);
m_featureSprite = a1->m_featureSprite;
v72 = m_featureSprite->setPosition;
v73 = a1->m_diffSprite->getPosition(a1->m_diffSprite);
v74 = a1->m_diffSprite->getScale(a1->m_diffSprite);
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, v74 * -6.0);
cocos2d::CCPoint::operator+(&v225, v73, &v224);
v72(m_featureSprite, &v225.origin);
}
a1->m_unk2 = 1;
v75 = cocos2d::CCDirector::sharedDirector();
v76 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v75));
v77 = cocos2d::CCDirector::sharedDirector();
v78 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v77));
cocos2d::CCPoint::CCPoint(&v196, v76 - 25.0, v78 - 25.0);
cocos2d::CCNode::convertToNodeSpace(&v197, a1->m_buttonMenu, &v196);
if ( v7 )
{
v117 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v117->setScale)(v117, 1061997773);
v215 = 0;
v214 = LevelListLayer::confirmDelete;
v118 = CCMenuItemSpriteExtra::create(
v117,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::confirmDelete, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v118);
v184 = v118->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v225.origin, a1->m_buttonMenu, &v196);
v184(v118, &v225.origin);
v119 = (int)v118->getPosition(v118);
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, v119, &v224);
cocos2d::CCPoint::operator=((PlayerObject *)&v197, COERCE_FLOAT(&v225), v120, v121);
v185 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v185->setScale)(v185, 1061997773);
v193 = v185;
v216 = LevelBrowserLayer::onRefresh;
v217 = 0;
v122 = CCMenuItemSpriteExtra::create(
v185,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelBrowserLayer::onRefresh, (unsigned int)a1));
a1->m_refreshBtn = v122;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v122);
a1->m_refreshBtn->setPosition(a1->m_refreshBtn, &v197);
v123 = a1->m_refreshBtn->getPosition(a1->m_refreshBtn);
cocos2d::CCPoint::CCPoint(&v212, v123);
v124 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_chatBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v124->setScale)(v124, 1061997773);
v219 = 0;
v218 = LevelListLayer::onDescription;
v125 = CCMenuItemSpriteExtra::create(
v124,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onDescription, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v125);
v186 = v125->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v212, &v224);
v186(v125, &v225.origin);
v126 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v125->getPosition)(v125);
cocos2d::CCPoint::operator=((PlayerObject *)&v212, v126, v127, v128);
v129 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_editModeBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v129->setScale)(v129, 1061997773);
v221 = 0;
v220 = LevelListLayer::onToggleEditMode;
v130 = CCMenuItemSpriteExtra::create(
v129,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onToggleEditMode, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v130);
v187 = v130->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v212, &v224);
v187(v130, &v225.origin);
v131 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v130->getPosition)(v130);
cocos2d::CCPoint::operator=((PlayerObject *)&v212, v131, v132, v133);
v134 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_plainBtn_001.png");
v134->addChild_0(v134, a1->m_diffSprite, 3);
v134->addChild_0(v134, a1->m_featureSprite, 2);
v191 = a1->m_diffSprite;
v188 = v191->setPosition;
v135 = v134->getContentSize(v134)->width;
v136 = (int)v134->getContentSize(v134);
cocos2d::CCPoint::CCPoint(&v225.origin, v135 * 0.5, *(float *)(v136 + 4) * 0.5);
v188(v191, &v225.origin);
v192 = a1->m_featureSprite;
v189 = v192->setPosition;
v137 = a1->m_diffSprite->getPosition(a1->m_diffSprite);
v189(v192, v137);
((void (__fastcall *)(cocos2d::CCSprite *, int))v134->setScale)(v134, 1061997773);
v222[1] = nullptr;
v222[0] = (cocos2d::CCLabelBMFont *)LevelListLayer::onSelectIcon;
v138 = CCMenuItemSpriteExtra::create(
v134,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onSelectIcon, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v138);
v190 = v138->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v212, &v224);
v190(v138, &v225.origin);
v139 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v138->getPosition)(v138);
cocos2d::CCPoint::operator=((PlayerObject *)&v212, v139, v140, v141);
v142 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v142->setScale)(v142, 1061997773);
LODWORD(v223.x) = LevelListLayer::confirmClone;
v223.y = 0.0;
v143 = CCMenuItemSpriteExtra::create(
v142,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::confirmClone, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v143);
v181 = v143->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v212, &v224);
v181(v143, &v225.origin);
v144 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v143->getPosition)(v143);
cocos2d::CCPoint::operator=((PlayerObject *)&v212, v144, v145, v146);
v147 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_shareBtn_001.png");
setScale = v147->setScale;
v149 = v193->getContentSize(v193)->width;
v150 = v149 * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCSprite *))v193->getScale)(v193));
v151 = (float *)v147->getContentSize(v147);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))setScale)(v147, v150 / *v151);
v224.origin.y = 0.0;
LODWORD(v224.origin.x) = LevelListLayer::onShare;
v152 = CCMenuItemSpriteExtra::create(
v147,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onShare, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v152);
v153 = v152->setPosition;
cocos2d::CCPoint::CCPoint(&v213, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v212, &v213);
v153(v152, &v225.origin);
v113 = (int)v152->getPosition(v152);
v116 = &v212;
}
else
{
v79 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v79->setScale)(v79, 1061997773);
v205 = 0;
v204 = LevelListLayer::onRefreshLevelList;
v80 = CCMenuItemSpriteExtra::create(
v79,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onRefreshLevelList, (unsigned int)a1));
a1->m_refreshBtn = v80;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v80);
m_refreshBtn = a1->m_refreshBtn;
v82 = m_refreshBtn->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v225.origin, a1->m_buttonMenu, &v196);
v82(m_refreshBtn, &v225.origin);
v83 = a1->m_refreshBtn->getPosition(a1->m_refreshBtn);
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, v83, &v224);
cocos2d::CCPoint::operator=((PlayerObject *)&v197, COERCE_FLOAT(&v225), v84, v85);
v86 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v86->setScale)(v86, 1061997773);
v207 = 0;
v206 = LevelListLayer::onInfo;
v87 = CCMenuItemSpriteExtra::create(
v86,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onInfo, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v87);
v87->setPosition(v87, &v197);
v88 = v87->getPosition(v87);
cocos2d::CCPoint::CCPoint(&v223, v88);
v89 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_like2Btn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v89->setScale)(v89, 1061997773);
v209 = 0;
v208 = LevelListLayer::onLike;
v90 = CCMenuItemSpriteExtra::create(
v89,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onLike, (unsigned int)a1));
a1->m_likeButton = v90;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v90);
m_likeButton = a1->m_likeButton;
v92 = m_likeButton->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v223, &v224);
v92(m_likeButton, &v225.origin);
v93 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_likeButton->getPosition)(a1->m_likeButton);
cocos2d::CCPoint::operator=((PlayerObject *)&v223, v93, v94, v95);
v96 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v96->setScale)(v96, 1061997773);
v210 = LevelListLayer::confirmClone;
v211 = 0;
v97 = CCMenuItemSpriteExtra::create(
v96,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::confirmClone, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v97);
v98 = v97->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v223, &v224);
v98(v97, &v225.origin);
v99 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v97->getPosition)(v97);
cocos2d::CCPoint::operator=((PlayerObject *)&v223, v99, v100, v101);
if ( a1->m_levelList->m_favorite )
v102 = "gj_heartOn_001.png";
else
v102 = "gj_heartOff_001.png";
v103 = cocos2d::CCSprite::createWithSpriteFrameName(v102);
v212.y = 0.0;
LODWORD(v212.x) = LevelListLayer::onFavorite;
v104 = CCMenuItemSpriteExtra::create(
v103,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onFavorite, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v104, 1.1);
a1->m_buttonMenu->addChild_0(a1->m_buttonMenu, v104, 100);
v180 = v104->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v223, &v224);
v180(v104, &v225.origin);
v105 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v104->getPosition)(v104);
cocos2d::CCPoint::operator=((PlayerObject *)&v223, v105, v106, v107);
m_accountID = a1->m_levelList->m_accountID;
v109 = GJAccountManager::sharedState();
if ( m_accountID != v109->m_accountID - v109->m_unkInt1 )
goto LABEL_20;
v110 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteServerBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v110->setScale)(v110, 1061997773);
v213.y = 0.0;
LODWORD(v213.x) = LevelListLayer::confirmOwnerDelete;
v111 = CCMenuItemSpriteExtra::create(
v110,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::confirmOwnerDelete, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v111);
v112 = v111->setPosition;
cocos2d::CCPoint::CCPoint(&v224.origin, 0.0, -41.0);
cocos2d::CCPoint::operator+(&v225, &v223, &v224);
v112(v111, &v225.origin);
v113 = (int)v111->getPosition(v111);
v116 = &v223;
}
cocos2d::CCPoint::operator=((PlayerObject *)v116, *(float *)&v113, v114, v115);
LABEL_20:
v154 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v225.origin.y = 0.0;
LODWORD(v225.origin.x) = LevelListLayer::onListInfo;
v155 = CCMenuItemSpriteExtra::create(
v154,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelListLayer::onListInfo, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v155, 1.2);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v155);
v156 = a1->m_buttonMenu;
v157 = v155->setPosition;
cocos2d::CCPoint::CCPoint(&v198, 30.0, 30.0);
cocos2d::CCNode::convertToNodeSpace(&v199, v156, &v198);
v157(v155, &v199);
v158 = LoadingCircle::create();
a1->m_circle = v158;
v158->m_parentLayer = a1;
m_circle = a1->m_circle;
m_circle->m_fade = 0;
cocos2d::CCObject::retain(m_circle);
LoadingCircle::show(a1->m_circle);
a1->m_circle->setVisible(a1->m_circle, 0);
sub_776584((int)&v198, "No Internet connection!");
cocos2d::CCPoint::CCPoint(&v199, 0.5, 1.0);
a1->m_noInternet = (TextArea *)TextArea::create(
(TextArea *)&v198,
(std::string)"bigFont.fnt",
(const char *)0x3F800000,
1142292480,
&v199,
(cocos2d::CCPoint)1101004800LL);
sub_774008(&v198);
m_noInternet = a1->m_noInternet;
v161 = m_noInternet->setPosition;
cocos2d::CCPoint::CCPoint(&v199, v195.width * 0.5, (float)(v195.height * 0.5) + 10.0);
v161(m_noInternet, &v199);
((void (__fastcall *)(TextArea *, int))a1->m_noInternet->setScale)(a1->m_noInternet, 1058642330);
a1->addChild_0(a1, a1->m_noInternet, 2);
a1->m_noInternet->setVisible(a1->m_noInternet, 0);
if ( PlatformToolbox::isControllerConnected() )
GameToolbox::addBackButton(a1, v183);
LevelListLayer::updateSideButtons(a1);
LevelListLayer::updateStatsArt(a1);
if ( v7 || (v162 = a1->m_levelList, v162->m_onlineLevelsLoaded) )
{
a1->m_cached = 1;
LevelBrowserLayer::setupLevelBrowser(a1, nullptr);
}
else
{
v173->m_folder = 1;
v162->m_onlineLevelsLoaded = 1;
LevelBrowserLayer::loadPage(a1, v173);
}
return v182;
}