//
// LevelInfoLayer::init from 0x3b3bb8 to 0x3b55c4 (6668 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::create @ 0x3b570c
//
// 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 LevelInfoLayer::init(LevelInfoLayer *a1, GJGameLevel *a2, bool a3)
{
cocos2d::CCArray *v5; // r0
cocos2d::CCArray *v6; // r0
GJGameLevel *m_level; // r3
int seed; // r1
LoadingCircle *v9; // r0
LoadingCircle *m_circle; // r0
cocos2d::CCDirector *v11; // r0
cocos2d::CCMenu *v12; // r0
LevelInfoLayer_vtbl *v13; // r3
cocos2d::CCMenu *v14; // r5
GJGameLevel *v15; // r7
int v16; // r10
const char *v17; // r1
cocos2d::CCNode *v18; // r6
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
int v22; // r9
int (__fastcall *v23)(const cocos2d::CCObject *__hidden); // r3
int v24; // r9
const char *v25; // r0
cocos2d::CCSprite *v26; // r6
void (__fastcall *v27)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *v28)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCDirector *v29; // r0
float v30; // s16
cocos2d::CCDirector *v31; // r0
float v32; // r0
const char *v33; // r0
cocos2d::CCSprite *v34; // r6
void (__fastcall *v35)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v36)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCDirector *v37; // r0
float v38; // s16
cocos2d::CCDirector *v39; // r0
float v40; // r0
_BOOL4 v41; // r7
cocos2d::CCLabelBMFont *v42; // r6
float width; // s17
void (__fastcall *v44)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCDirector *v45; // r0
float v46; // r0
float v47; // r1
GJGameLevel *v48; // r3
int random; // r2
int v50; // r3
int v51; // r8
GameLevelManager *v52; // r0
cocos2d::CCString *v53; // r0
cocos2d::CCLabelBMFont *v54; // r0
float v55; // s17
cocos2d::CCLabelBMFont *v56; // r7
int v57; // r0
CCMenuItemSpriteExtra *v58; // r6
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
float x; // s17
float v61; // s19
float v62; // r0
int v63; // r2
bool v64; // r3
cocos2d::CCSprite *v65; // r8
void (__fastcall *v66)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r6
int v67; // r2
bool v68; // r3
cocos2d::CCSprite *v69; // r0
CCMenuItemSpriteExtra *v70; // r9
void (__fastcall *v71)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
GJGameLevel *v72; // r1
cocos2d::CCDirector *v73; // r0
float v74; // s19
cocos2d::CCDirector *v75; // r0
float v76; // r0
cocos2d::CCSprite *v77; // r0
CCMenuItemSpriteExtra *v78; // r6
cocos2d::CCSprite *v79; // r0
CCMenuItemSpriteExtra *v80; // r6
cocos2d::CCSprite *v81; // r0
CCMenuItemSpriteExtra *v82; // r6
cocos2d::CCSprite *v83; // r0
CCMenuItemSpriteExtra *v84; // r9
int v85; // r10
cocos2d::CCSprite *v86; // r0
CCMenuItemSpriteExtra *v87; // r0
cocos2d::CCMenu_vtbl *v88; // r3
CCMenuItemSpriteExtra *m_likeBtn; // r10
int v90; // r9
const cocos2d::CCPoint *v91; // r0
cocos2d::CCSprite *v92; // r0
CCMenuItemSpriteExtra *v93; // r0
cocos2d::CCMenu_vtbl *v94; // r3
CCMenuItemSpriteExtra *m_starRateBtn; // r10
void (__fastcall *v96)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
float v97; // r0
int v98; // r2
bool v99; // r3
float v100; // s20
GameManager *v101; // r0
cocos2d::CCDirector *v102; // r0
float v103; // r0
int v104; // r2
bool v105; // r3
GameManager *v106; // r0
GameManager *v107; // r0
GJAccountManager *v108; // r0
GameManager *v109; // r0
GameManager *v110; // r0
cocos2d::CCSprite *v111; // r0
CCMenuItemSpriteExtra *v112; // r6
void (__fastcall *v113)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v114; // r0
int v115; // r2
bool v116; // r3
cocos2d::CCSprite *v117; // r0
cocos2d::CCNode *v118; // r6
void (__fastcall *v119)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCDirector *v120; // r0
float v121; // s19
cocos2d::CCDirector *v122; // r0
float v123; // r0
cocos2d::CCMenu *v124; // r5
cocos2d::CCSprite *v125; // r0
CCMenuItemSpriteExtra *v126; // r6
void (__fastcall *v127)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCDirector *v128; // r0
float v129; // s19
cocos2d::CCDirector *v130; // r0
float v131; // r0
cocos2d::CCMenu *v132; // r8
void (__fastcall *v133)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v134; // r0
CCMenuItemSpriteExtra *v135; // r7
int v136; // r2
bool v137; // r3
const char *v138; // r0
cocos2d::CCSprite *v139; // r0
void (__fastcall *v140)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v141; // r10
cocos2d::CCSprite *v142; // r10
void (__fastcall *v143)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v144; // r9
void (__fastcall *v145)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v146; // r10
int v147; // r1
GJGameLevel *v148; // r3
int m_songID; // r6
SongInfoObject *SongObject; // r8
CustomSongWidget *v151; // r0
LevelInfoLayer_vtbl *v152; // r3
CustomSongWidget *m_songWidget; // r10
float v154; // s20
void (__fastcall *v155)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCDirector *v156; // r0
float v157; // r0
CustomSongWidget *v158; // r9
cocos2d::CCMenu *v159; // r8
void (__fastcall *v160)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCDirector *v161; // r0
float v162; // s20
cocos2d::CCDirector *v163; // r0
float v164; // r0
cocos2d::CCSprite *v165; // r10
CCMenuItemSpriteExtra *v166; // r10
cocos2d::CCSprite *v167; // r8
cocos2d::CCString *v168; // r0
cocos2d::CCLabelBMFont *v169; // r0
cocos2d::CCSprite_vtbl *v170; // r3
cocos2d::CCLabelBMFont *m_folderLabel; // r10
void (__fastcall *v172)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
float v173; // s17
int v174; // r0
CCMenuItemSpriteExtra *v175; // r9
void (__fastcall *v176)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v177; // r6
CCMenuItemSpriteExtra *v178; // r6
void (__fastcall *v179)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
int v180; // r10
cocos2d::CCSprite *v181; // r5
void (__fastcall *v182)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r6
float v183; // s17
const cocos2d::CCSize *v184; // r0
GJGameLevel *v185; // r3
int (__fastcall *v187)(const cocos2d::CCObject *__hidden); // r2
char *v188; // r1
cocos2d::CCLabelBMFont *v189; // r8
void (__fastcall *v190)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r9
int v191; // r10
float v192; // s17
float v193; // r0
GameManager *v194; // r0
cocos2d::CCSprite *v195; // r8
void (__fastcall *v196)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r6
int v197; // r2
bool v198; // r3
_BOOL4 v199; // r9
GameManager *v200; // r0
cocos2d::CCSprite *v201; // r0
CCMenuItemSpriteExtra *v202; // r0
cocos2d::CCMenu_vtbl *v203; // r3
CCMenuItemSpriteExtra *m_demonRateBtn; // r9
float v205; // r0
int v206; // r2
bool v207; // r3
GJAccountManager *v208; // r0
cocos2d::CCSprite *v209; // r8
void (__fastcall *v210)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r6
float v211; // s17
float v212; // r0
int v213; // r8
cocos2d::CCMenu *m_playBtnMenu; // r0
GJGameLevel *v215; // r3
int m_levelVersion; // r6
GameLevelManager *v217; // r0
cocos2d::CCSprite *v218; // r0
CCMenuItemSpriteExtra *v219; // r9
float v220; // r0
int v221; // r2
bool v222; // r3
int v223; // r10
GameStatsManager *v224; // r0
cocos2d::CCSprite *v225; // r0
CCMenuItemSpriteExtra *v226; // r7
float v227; // r0
int v228; // r2
bool v229; // r3
const char *v230; // r0
cocos2d::CCSprite *v231; // r0
CCMenuItemSpriteExtra *v232; // r0
cocos2d::CCMenu_vtbl *v233; // r3
CCMenuItemSpriteExtra *m_cloneBtn; // r9
void (__fastcall *v235)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v236; // r0
int v237; // r2
bool v238; // r3
CCMenuItemSpriteExtra *v239; // r5
void (__fastcall *setEnabled)(cocos2d::CCMenuItemSprite *__hidden, bool); // r6
int v241; // r0
GameStatsManager *v242; // r0
GameStatsManager *v243; // r0
GameLevelManager *v244; // r0
GameLevelManager *v245; // r0
_BOOL4 v247; // [sp+1Ch] [bp-128h]
void (__fastcall *v248)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
_BOOL4 v249; // [sp+1Ch] [bp-128h]
void (__fastcall *v250)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
void (__fastcall *v251)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
CCMenuItemSpriteExtra *v252; // [sp+1Ch] [bp-128h]
void (__fastcall *v253)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
void (__fastcall *v254)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
void (__fastcall *v255)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
void (__fastcall *v256)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+1Ch] [bp-128h]
_BOOL4 v257; // [sp+20h] [bp-124h]
CCMenuItemSpriteExtra *v258; // [sp+20h] [bp-124h]
_BOOL4 v259; // [sp+24h] [bp-120h]
CCMenuItemSpriteExtra *v260; // [sp+24h] [bp-120h]
_BOOL4 v261; // [sp+28h] [bp-11Ch]
_BOOL4 m_gauntletLevel; // [sp+2Ch] [bp-118h]
CCMenuItemSpriteExtra *v263; // [sp+2Ch] [bp-118h]
void (__fastcall *v264)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-110h]
char v265[4]; // [sp+38h] [bp-10Ch] BYREF
cocos2d::CCSize v266; // [sp+3Ch] [bp-108h] BYREF
cocos2d::CCPoint v267; // [sp+44h] [bp-100h] BYREF
cocos2d::CCPoint v268; // [sp+4Ch] [bp-F8h] BYREF
cocos2d::CCPoint v269; // [sp+54h] [bp-F0h] BYREF
cocos2d::CCPoint v270; // [sp+5Ch] [bp-E8h] BYREF
cocos2d::CCPoint v271; // [sp+64h] [bp-E0h] BYREF
cocos2d::CCPoint v272; // [sp+6Ch] [bp-D8h] BYREF
cocos2d::CCPoint v273; // [sp+74h] [bp-D0h] BYREF
cocos2d::CCPoint v274; // [sp+7Ch] [bp-C8h] BYREF
cocos2d::CCPoint v275; // [sp+84h] [bp-C0h] BYREF
void (*v276)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+8Ch] [bp-B8h]
int v277; // [sp+90h] [bp-B4h]
void (*v278)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+94h] [bp-B0h]
int v279; // [sp+98h] [bp-ACh]
void (*v280)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+9Ch] [bp-A8h]
int v281; // [sp+A0h] [bp-A4h]
void (*v282)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+A4h] [bp-A0h]
int v283; // [sp+A8h] [bp-9Ch]
void (*v284)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+ACh] [bp-98h]
int v285; // [sp+B0h] [bp-94h]
void (*v286)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+B4h] [bp-90h]
int v287; // [sp+B8h] [bp-8Ch]
void (*v288)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+BCh] [bp-88h]
int v289; // [sp+C0h] [bp-84h]
void (*v290)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+C4h] [bp-80h]
int v291; // [sp+C8h] [bp-7Ch]
void (*v292)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+CCh] [bp-78h]
int v293; // [sp+D0h] [bp-74h]
void (*v294)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+D4h] [bp-70h]
int v295; // [sp+D8h] [bp-6Ch]
void (*v296)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+DCh] [bp-68h]
int v297; // [sp+E0h] [bp-64h]
void (*v298)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+E4h] [bp-60h]
int v299; // [sp+E8h] [bp-5Ch]
void (*v300)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+ECh] [bp-58h]
int v301; // [sp+F0h] [bp-54h]
void (*v302)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+F4h] [bp-50h]
int v303; // [sp+F8h] [bp-4Ch]
void (*v304)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+FCh] [bp-48h]
int v305; // [sp+100h] [bp-44h]
void (*v306)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+104h] [bp-40h]
int v307; // [sp+108h] [bp-3Ch]
void (*v308)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+10Ch] [bp-38h]
int v309; // [sp+110h] [bp-34h]
void (*v310)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+114h] [bp-30h]
int v311; // [sp+118h] [bp-2Ch]
void (*v312)(LevelInfoLayer *, cocos2d::CCObject *); // [sp+11Ch] [bp-28h]
int v313; // [sp+120h] [bp-24h]
cocos2d::CCPoint v314; // [sp+124h] [bp-20h] BYREF
cocos2d::CCPoint v315; // [sp+12Ch] [bp-18h] BYREF
cocos2d::CCPoint v316; // [sp+134h] [bp-10h] BYREF
v261 = cocos2d::CCLayer::init(a1);
if ( !v261 )
return v261;
a1->m_level = a2;
cocos2d::CCObject::retain(a2);
a1->m_challenge = a3;
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
a1->m_coins = v6;
cocos2d::CCObject::retain(v6);
m_level = a1->m_level;
m_level->m_levelNotDownloaded = 0;
seed = m_level->m_dailyID.seed;
a1->m_levelType = a2->m_levelType;
if ( m_level->m_dailyID.random - seed <= 0 && !m_level->m_gauntletLevel )
GameManager::sharedState()->m_currentLevelID = a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed;
v9 = LoadingCircle::create();
a1->m_circle = v9;
v9->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);
a1->setKeypadEnabled(a1, 1);
a1->setKeyboardEnabled(a1, 1);
v11 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v266, v11);
v12 = cocos2d::CCMenu::create();
v13 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_playBtnMenu = v12;
v13->addChild_0(a1, v12, 3);
v14 = cocos2d::CCMenu::create();
a1->addChild_0(a1, v14, 2);
v15 = a1->m_level;
v259 = v15->m_dailyID.random - v15->m_dailyID.seed > 0;
v16 = a2->m_dailyID.random - a2->m_dailyID.seed;
v247 = v16 > 200000;
v257 = (unsigned int)(v16 - 100001) <= 0x1869F;
m_gauntletLevel = v15->m_gauntletLevel;
v18 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_gradientBG.png", v17);
setAnchorPoint = v18->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 0.0, 0.0);
setAnchorPoint(v18, &v316);
a1->addChild_0(a1, v18, -2);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v18->setScaleX)(v18, (float)(v266.width + 10.0) / v18[1].m_fSkewX);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v18->setScaleY)(v18, (float)(v266.height + 10.0) / v18[1].m_fSkewY);
setPosition = v18->setPosition;
cocos2d::CCPoint::CCPoint(&v316, -5.0, -5.0);
setPosition(v18, &v316);
getTag = v18->__vftable[1].getTag;
*(_WORD *)((char *)&v316.x + 1) = -154;
LOBYTE(v316.x) = 0;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))getTag)(v18, &v316);
if ( m_gauntletLevel || v257 || a1->m_challenge )
{
if ( !v247 )
{
v187 = v18->__vftable[1].getTag;
memset(&v316, 51, 3);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))v187)(v18, &v316);
goto LABEL_67;
}
v22 = 1;
}
else
{
if ( !v247 )
{
LABEL_11:
v24 = 0;
v25 = "GJ_sideArt_001.png";
goto LABEL_12;
}
v22 = 0;
}
v23 = v18->__vftable[1].getTag;
LOWORD(v316.x) = 6243;
BYTE2(v316.x) = 126;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))v23)(v18, &v316);
if ( !v22 )
goto LABEL_11;
LABEL_67:
v24 = 1;
v25 = "gauntletCorner_001.png";
LABEL_12:
v26 = cocos2d::CCSprite::createWithSpriteFrameName(v25);
v27 = v26->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 0.0, 0.0);
v27(v26, &v316);
v28 = v26->setPosition;
v29 = cocos2d::CCDirector::sharedDirector();
v30 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v29));
v31 = cocos2d::CCDirector::sharedDirector();
v32 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v31));
cocos2d::CCPoint::CCPoint(&v316, v30 - 1.0, v32 - 1.0);
v28(v26, &v316);
a1->addChild_0(a1, v26, 1);
if ( v24 )
v33 = "gauntletCorner_001.png";
else
v33 = "GJ_sideArt_001.png";
v34 = cocos2d::CCSprite::createWithSpriteFrameName(v33);
v35 = v34->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 1.0, 0.0);
v35(v34, &v316);
v36 = v34->setPosition;
v37 = cocos2d::CCDirector::sharedDirector();
v38 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v37));
v39 = cocos2d::CCDirector::sharedDirector();
v40 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v39));
cocos2d::CCPoint::CCPoint(&v316, v38 + 1.0, v40 - 1.0);
v36(v34, &v316);
cocos2d::CCSprite::setFlipX(v34, 1);
a1->addChild_0(a1, v34, 1);
if ( a1->m_challenge )
{
v41 = 0;
}
else
{
sub_775C20(v265, &a1->m_level->m_levelName);
v41 = v261;
}
v42 = cocos2d::CCLabelBMFont::create();
if ( v41 )
sub_774008(v265);
a1->addChild_0(a1, v42, 20);
width = v266.width;
v44 = v42->setPosition;
v45 = cocos2d::CCDirector::sharedDirector();
v46 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v45));
cocos2d::CCPoint::CCPoint(&v316, width * 0.5, v46 - 17.0);
v44(v42, &v316);
if ( v259 )
v47 = 260.0;
else
v47 = 300.0;
cocos2d::CCLabelBMFont::limitLabelWidth(v42, v47, 0.8, 0.0);
if ( v259 )
{
sub_776584((int)&v314, "(Daily)");
if ( v257 )
{
v188 = "(Weekly)";
}
else
{
if ( !v247 )
goto LABEL_73;
v188 = "(Event)";
}
sub_7753D4((int)&v314, v188);
LABEL_73:
v189 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v189->setScale)(v189, 1058642330);
a1->addChild_0(a1, v189, 20);
v190 = v189->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 0.0, 0.5);
v190(v189, &v316);
v253 = v189->setPosition;
v191 = (int)v42->getPosition(v42);
v192 = v42->getContentSize(v42)->width * 0.5;
v193 = v42->getScale(v42);
cocos2d::CCPoint::CCPoint(&v315, (float)(v192 * v193) + 3.0, -0.5);
cocos2d::CCPoint::operator+(&v316, v191, &v315);
v253(v189, &v316);
sub_774008(&v314);
}
v48 = a1->m_level;
random = v48->m_accountID.random;
v50 = v48->m_accountID.seed;
v51 = random - v50;
if ( random == v50 )
{
v52 = GameLevelManager::sharedState();
v51 = GameLevelManager::accountIDForUserID(v52, a1->m_level->m_userID.random - a1->m_level->m_userID.seed);
}
sub_775C20(&v316, &a1->m_level->m_creatorName);
v53 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"By %s",
(const char *)LODWORD(v316.x));
cocos2d::CCString::getCString(v53);
sub_774008(&v316);
v54 = cocos2d::CCLabelBMFont::create();
v55 = v266.width * 0.5;
v56 = v54;
v57 = (int)v42->getPosition(v42);
cocos2d::CCPoint::CCPoint(&v267, v55, *(float *)(v57 + 4) - 26.0);
cocos2d::CCLabelBMFont::limitLabelWidth(v56, 300.0, 0.8, 0.0);
v277 = 0;
v276 = LevelInfoLayer::onViewProfile;
v58 = CCMenuItemSpriteExtra::create(
v56,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onViewProfile, (unsigned int)a1));
v14->addChild(v14, v58);
v248 = v58->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v316, v14, &v267);
v248(v58, &v316);
if ( !v51 )
{
setColor = v56->setColor;
LOWORD(v316.x) = -166;
BYTE2(v316.x) = -1;
setColor(v56, (const cocos2d::ccColor3B *)&v316);
v58->setEnabled(v58, 0);
}
x = v267.x;
v61 = v56->getContentSize(v56)->width;
v62 = v56->getScale(v56);
cocos2d::CCPoint::CCPoint(&v268, (float)(x + (float)((float)(v61 * v62) * 0.5)) + 6.0, v267.y - 1.0);
if ( a1->m_challenge )
{
v56->setVisible(v56, 0);
cocos2d::CCPoint::operator=((PlayerObject *)&v268, COERCE_FLOAT(&v267), v63, v64);
}
if ( a2->m_originalLevel.random != a2->m_originalLevel.seed )
{
v249 = a1->m_level->m_objectCount.random - a1->m_level->m_objectCount.seed > 40000;
v65 = cocos2d::CCSprite::createWithSpriteFrameName("collaborationIcon_001.png");
v66 = v65->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 0.0, 0.5);
v66(v65, &v316);
a1->addChild(a1, v65);
v65->setPosition(v65, &v268);
cocos2d::CCPoint::CCPoint(&v315, 18.0, 0.0);
cocos2d::CCPoint::operator+(&v316, &v268, &v315);
cocos2d::CCPoint::operator=((PlayerObject *)&v268, COERCE_FLOAT(&v316), v67, v68);
if ( !v249 )
goto LABEL_30;
LABEL_81:
v195 = cocos2d::CCSprite::createWithSpriteFrameName("highObjectIcon_001.png");
v196 = v195->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v316, 0.0, 0.5);
v196(v195, &v316);
a1->addChild_0(a1, v195, 10);
v195->setPosition(v195, &v268);
cocos2d::CCPoint::CCPoint(&v315, 18.0, 0.0);
cocos2d::CCPoint::operator+(&v316, &v268, &v315);
cocos2d::CCPoint::operator=((PlayerObject *)&v268, COERCE_FLOAT(&v316), v197, v198);
goto LABEL_30;
}
if ( a1->m_level->m_objectCount.random - a1->m_level->m_objectCount.seed > 40000 )
goto LABEL_81;
if ( v51 > 0 )
{
v194 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v194, "0047") && !a1->m_challenge )
{
v209 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_viewProfileTxt_001.png");
a1->addChild_0(a1, v209, 2);
v210 = v209->setPosition;
v211 = v56->getContentSize(v56)->width;
v212 = v56->getScale(v56);
cocos2d::CCPoint::CCPoint(&v315, (float)((float)(v211 * 0.5) * v212) + 48.0, -1.0);
cocos2d::CCPoint::operator+(&v316, &v267, &v315);
v210(v209, &v316);
}
}
LABEL_30:
v69 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playBtn2_001.png");
a1->m_playSprite = v69;
v279 = 0;
v278 = LevelInfoLayer::onPlay;
v70 = CCMenuItemSpriteExtra::create(
v69,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onPlay, (unsigned int)a1));
a1->m_playBtnMenu->addChild(a1->m_playBtnMenu, v70);
cocos2d::CCPoint::CCPoint(&v269, v266.width * 0.5, (float)(v266.height * 0.5) + 51.0);
v71 = v70->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v316, a1->m_playBtnMenu, &v269);
v71(v70, &v316);
a1->m_circle->m_sprite->setPosition(a1->m_circle->m_sprite, &v269);
v72 = a1->m_level;
if ( v72->m_levelType == SearchResult
|| ((sub_775C20(&v315, &v72->m_levelString), sub_776584((int)&v316, (char *)&unk_939830), sub_774DBC(&v315, &v316))
|| GameLevelManager::sharedState()->m_searchType == SavedLevels
? (v199 = 0)
: (v199 = GameLevelManager::sharedState()->m_searchType != FavouriteLevels),
sub_774008(&v316),
sub_774008(&v315),
v199) )
{
LevelInfoLayer::downloadLevel(a1);
}
else
{
sub_775C20(&v315, &a1->m_level->m_levelString);
sub_776584((int)&v316, (char *)&unk_939830);
v213 = sub_774DBC(&v315, &v316);
sub_774008(&v316);
sub_774008(&v315);
if ( !v213 )
{
m_playBtnMenu = a1->m_playBtnMenu;
a1->m_noUpdateAlert = 1;
m_playBtnMenu->setVisible(m_playBtnMenu, 0);
a1->m_circle->setVisible(a1->m_circle, 1);
GameLevelManager::sharedState()->m_levelUpdateDelegate = &a1->LevelUpdateDelegate;
v215 = a1->m_level;
m_levelVersion = v215->m_levelVersion;
v215->m_levelVersion = -1;
v217 = GameLevelManager::sharedState();
GameLevelManager::updateLevel(v217, a1->m_level);
a2->m_levelVersion = m_levelVersion;
}
}
LevelInfoLayer::setupLevelInfo(a1);
if ( !a1->m_challenge )
{
if ( GJGameLevel::isPlatformer(a1->m_level) )
LevelInfoLayer::setupPlatformerStats(a1);
else
LevelInfoLayer::setupProgressBars(a1);
}
v73 = cocos2d::CCDirector::sharedDirector();
v74 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v73));
v75 = cocos2d::CCDirector::sharedDirector();
v76 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v75));
cocos2d::CCPoint::CCPoint(&v270, v74 - 30.0, v76 - 30.0);
cocos2d::CCNode::convertToNodeSpace(&v271, v14, &v270);
if ( a1->m_level->m_dailyID.random - a1->m_level->m_dailyID.seed <= 0 )
{
v77 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v281 = 0;
v280 = LevelInfoLayer::confirmDelete;
v78 = CCMenuItemSpriteExtra::create(
v77,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::confirmDelete, (unsigned int)a1));
v14->addChild(v14, v78);
v78->setPosition(v78, &v271);
v271.y = v271.y - 50.0;
}
v79 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v283 = 0;
v282 = LevelInfoLayer::onUpdate;
v80 = CCMenuItemSpriteExtra::create(
v79,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onUpdate, (unsigned int)a1));
v14->addChild(v14, v80);
v80->setPosition(v80, &v271);
v271.y = v271.y - 50.0;
v81 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoBtn_001.png");
v285 = 0;
v284 = LevelInfoLayer::onInfo;
v82 = CCMenuItemSpriteExtra::create(
v81,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onInfo, (unsigned int)a1));
v14->addChild(v14, v82);
v82->setPosition(v82, &v271);
v83 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_levelLeaderboardBtn_001.png");
v287 = 0;
v286 = LevelInfoLayer::onLevelLeaderboard;
v84 = CCMenuItemSpriteExtra::create(
v83,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onLevelLeaderboard, (unsigned int)a1));
v14->addChild(v14, v84);
v250 = v84->setPosition;
v85 = (int)v82->getPosition(v82);
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, v85, &v315);
v250(v84, &v316);
v86 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_like2Btn_001.png");
v289 = 0;
v288 = LevelInfoLayer::onLike;
v87 = CCMenuItemSpriteExtra::create(
v86,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onLike, (unsigned int)a1));
v88 = v14->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_likeBtn = v87;
v88->addChild(v14, v87);
m_likeBtn = a1->m_likeBtn;
v251 = m_likeBtn->setPosition;
v90 = (int)v84->getPosition(v84);
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, v90, &v315);
v251(m_likeBtn, &v316);
v91 = a1->m_likeBtn->getPosition(a1->m_likeBtn);
cocos2d::CCPoint::CCPoint(&v272, v91);
if ( a1->m_level->m_stars.random == a1->m_level->m_stars.seed )
{
v92 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_starBtn_001.png");
v291 = 0;
v290 = LevelInfoLayer::onRateStars;
v93 = CCMenuItemSpriteExtra::create(
v92,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onRateStars, (unsigned int)a1));
v94 = v14->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_starRateBtn = v93;
v94->addChild(v14, v93);
m_starRateBtn = a1->m_starRateBtn;
v96 = m_starRateBtn->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v96(m_starRateBtn, &v316);
v97 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_starRateBtn->getPosition)(a1->m_starRateBtn);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v97, v98, v99);
}
if ( a1->m_level->m_demon.random - a1->m_level->m_demon.seed == 1 )
{
sub_776584((int)&v314, "GJ_rateDiffBtn_001.png");
v200 = GameManager::sharedState();
if ( (unsigned int)(v200->m_hasRP.random - v200->m_hasRP.seed - 1) <= 1 || GameManager::sharedState()->m_hasDRP )
sub_7753D4((int)&v314, "GJ_rateDiffBtnMod_001.png");
v201 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)LODWORD(v314.x));
v293 = 0;
v292 = LevelInfoLayer::onRateDemon;
v202 = CCMenuItemSpriteExtra::create(
v201,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onRateDemon, (unsigned int)a1));
v203 = v14->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_demonRateBtn = v202;
v203->addChild(v14, v202);
m_demonRateBtn = a1->m_demonRateBtn;
v254 = m_demonRateBtn->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v254(m_demonRateBtn, &v316);
v205 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_demonRateBtn->getPosition)(a1->m_demonRateBtn);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v205, v206, v207);
sub_774008(&v314);
}
if ( a1->m_challenge )
v14->setVisible(v14, 0);
LevelInfoLayer::updateSideButtons(a1);
v100 = 50.0;
v101 = GameManager::sharedState();
if ( (unsigned int)(v101->m_hasRP.random - v101->m_hasRP.seed - 1) >= 2 )
v100 = 25.0;
v102 = cocos2d::CCDirector::sharedDirector();
v103 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v102));
cocos2d::CCPoint::CCPoint(&v273, (float)(v103 + 30.0) + 0.0, (float)((float)(v266.height * 0.5) + 50.0) + v100);
cocos2d::CCNode::convertToNodeSpace(&v316, v14, &v273);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, COERCE_FLOAT(&v316), v104, v105);
v106 = GameManager::sharedState();
if ( (unsigned int)(v106->m_hasRP.random - v106->m_hasRP.seed - 1) <= 1 )
{
v218 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_starBtnMod_001.png");
v295 = 0;
v294 = LevelInfoLayer::onRateStarsMod;
v219 = CCMenuItemSpriteExtra::create(
v218,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onRateStarsMod, (unsigned int)a1));
v14->addChild(v14, v219);
v255 = v219->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v255(v219, &v316);
v220 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v219->getPosition)(v219);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v220, v221, v222);
}
v107 = GameManager::sharedState();
if ( v107->m_playerUserID.random - v107->m_playerUserID.seed == a1->m_level->m_userID.random
- a1->m_level->m_userID.seed
|| (v108 = GJAccountManager::sharedState(), v108->m_accountID != v108->m_unkInt1)
&& (v208 = GJAccountManager::sharedState(),
v208->m_accountID - v208->m_unkInt1 == a1->m_level->m_accountID.random - a1->m_level->m_accountID.seed) )
{
v223 = 1;
goto LABEL_111;
}
v109 = GameManager::sharedState();
if ( v109->m_hasRP.random - v109->m_hasRP.seed > 1 )
{
v223 = 0;
LABEL_111:
v225 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteServerBtn_001.png");
v297 = 0;
v296 = LevelInfoLayer::confirmOwnerDelete;
v226 = CCMenuItemSpriteExtra::create(
v225,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::confirmOwnerDelete, (unsigned int)a1));
v14->addChild(v14, v226);
v256 = v226->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v256(v226, &v316);
v227 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v226->getPosition)(v226);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v227, v228, v229);
if ( v223 )
goto LABEL_48;
}
v110 = GameManager::sharedState();
if ( v110->m_hasRP.random - v110->m_hasRP.seed <= 0 )
{
if ( a2->m_password.random - a2->m_password.seed == 1 )
v230 = "GJ_duplicateBtn_001.png";
else
v230 = "GJ_duplicateLockedBtn_001.png";
v231 = cocos2d::CCSprite::createWithSpriteFrameName(v230);
v301 = 0;
v300 = LevelInfoLayer::tryCloneLevel;
v232 = CCMenuItemSpriteExtra::create(
v231,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::tryCloneLevel, (unsigned int)a1));
v233 = v14->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_cloneBtn = v232;
v233->addChild(v14, v232);
m_cloneBtn = a1->m_cloneBtn;
v235 = m_cloneBtn->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v235(m_cloneBtn, &v316);
v236 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_cloneBtn->getPosition)(a1->m_cloneBtn);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v236, v237, v238);
a1->m_cloneBtn->setVisible(a1->m_cloneBtn, a1->m_level->m_password.random != a1->m_level->m_password.seed);
v239 = a1->m_cloneBtn;
setEnabled = v239->setEnabled;
v241 = ((int (__fastcall *)(CCMenuItemSpriteExtra *))v239->isVisible)(v239);
setEnabled(v239, v241);
goto LABEL_49;
}
LABEL_48:
v111 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png");
v299 = 0;
v298 = LevelInfoLayer::confirmClone;
v112 = CCMenuItemSpriteExtra::create(
v111,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::confirmClone, (unsigned int)a1));
v14->addChild(v14, v112);
v113 = v112->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v316, &v272, &v315);
v113(v112, &v316);
v114 = ((float (__fastcall *)(CCMenuItemSpriteExtra *))v112->getPosition)(v112);
cocos2d::CCPoint::operator=((PlayerObject *)&v272, v114, v115, v116);
LABEL_49:
v117 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v303 = 0;
v302 = LevelInfoLayer::onBack;
v263 = CCMenuItemSpriteExtra::create(
v117,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onBack, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v263, 1.6);
v118 = (cocos2d::CCNode *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v263, nullptr);
a1->addChild_0(a1, v118, 1);
v119 = v118->setPosition;
v120 = cocos2d::CCDirector::sharedDirector();
v121 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v120));
v122 = cocos2d::CCDirector::sharedDirector();
v123 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v122));
cocos2d::CCPoint::CCPoint(&v316, v121 + 24.0, v123 - 23.0);
v119(v118, &v316);
if ( a1->m_level->m_dailyID.random - a1->m_level->m_dailyID.seed <= 0 )
{
v224 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v224, a1->m_level) )
{
if ( a1->m_level->m_demon.random - a1->m_level->m_demon.seed == 1 )
{
v242 = GameStatsManager::sharedState();
GameStatsManager::completedDemonLevel(v242, a1->m_level);
}
if ( a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0 )
{
v243 = GameStatsManager::sharedState();
GameStatsManager::completedStarLevel(v243, a1->m_level);
}
}
}
v124 = cocos2d::CCMenu::create();
v125 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v305 = 0;
v304 = LevelInfoLayer::onLevelInfo;
v126 = CCMenuItemSpriteExtra::create(
v125,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onLevelInfo, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v126, 1.2);
v124->addChild(v124, v126);
v127 = v124->setPosition;
v128 = cocos2d::CCDirector::sharedDirector();
v129 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v128));
v130 = cocos2d::CCDirector::sharedDirector();
v131 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v130));
cocos2d::CCPoint::CCPoint(&v316, v129 + 30.0, v131 + 30.0);
v127(v124, &v316);
a1->addChild_0(a1, v124, 2);
v132 = cocos2d::CCMenu::create();
a1->addChild_0(a1, v132, 21);
v133 = v132->setPosition;
cocos2d::CCPoint::CCPoint(&v316, v266.width - 85.0, v266.height - 25.0);
v133(v132, &v316);
v134 = cocos2d::CCSprite::createWithSpriteFrameName("garageRope_001.png");
v307 = 0;
v306 = LevelInfoLayer::onGarage;
v135 = CCMenuItemSpriteExtra::create(
v134,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onGarage, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v135, 1.2);
CCMenuItemSpriteExtra::useAnimationType(v135, Move);
cocos2d::CCPoint::CCPoint(&v316, 0.0, -8.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v135->m_offset, COERCE_FLOAT(&v316), v136, v137);
v135->m_duration = 0.2;
v135->m_unselectedDuration = 0.2;
v132->addChild(v132, v135);
if ( a1->m_level->m_levelFavorited )
v138 = "gj_heartOn_001.png";
else
v138 = "gj_heartOff_001.png";
v139 = cocos2d::CCSprite::createWithSpriteFrameName(v138);
v309 = 0;
v308 = LevelInfoLayer::onFavorite;
v258 = CCMenuItemSpriteExtra::create(
v139,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onFavorite, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v258, 1.1);
v124->addChild_0(v124, v258, 100);
v140 = v258->setPosition;
v141 = (int)v124->getPosition(v124);
cocos2d::CCPoint::CCPoint(&v314, 38.0, 0.0);
cocos2d::CCPoint::operator+(&v315, v141, &v314);
cocos2d::CCNode::convertToNodeSpace(&v316, v124, &v315);
v140(v258, &v316);
v142 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v142->setScale)(v142, 1063675494);
((void (__fastcall *)(cocos2d::CCSprite *, int))v142->setRotation)(v142, 1119092736);
v311 = 0;
v310 = LevelInfoLayer::confirmMoveToTop;
v252 = CCMenuItemSpriteExtra::create(
v142,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::confirmMoveToTop, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v252, 1.1);
v124->addChild_0(v124, v252, 100);
v143 = v252->setPosition;
cocos2d::CCPoint::CCPoint(&v315, v266.width - 73.0, 55.0);
cocos2d::CCNode::convertToNodeSpace(&v316, v124, &v315);
v143(v252, &v316);
v144 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v144->setScale)(v144, 1063675494);
cocos2d::CCSprite::setFlipY(v144, 1);
((void (__fastcall *)(cocos2d::CCSprite *, int))v144->setRotation)(v144, -1028390912);
v313 = 0;
v312 = LevelInfoLayer::confirmMoveToBottom;
v260 = CCMenuItemSpriteExtra::create(
v144,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::confirmMoveToBottom, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v260, 1.1);
v124->addChild_0(v124, v260, 100);
v145 = v260->setPosition;
v146 = (int)v252->getPosition(v252);
cocos2d::CCPoint::CCPoint(&v315, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v316, v146, &v315);
v145(v260, &v316);
if ( a1->m_challenge )
v124->setVisible(v124, 0);
v148 = a1->m_level;
m_songID = v148->m_songID;
if ( m_songID )
{
LOBYTE(m_songID) = 1;
SongObject = (SongInfoObject *)SongInfoObject::create((SongInfoObject *)v148->m_songID, v147);
}
else
{
SongObject = LevelTools::getSongObject(v148->m_audioTrack);
}
v151 = CustomSongWidget::create(SongObject, nullptr, 0, 0, 1, (unsigned __int8)m_songID != 1, 0, 0, 0);
v152 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_songWidget = v151;
v152->addChild(a1, v151);
m_songWidget = a1->m_songWidget;
v154 = v266.width * 0.5;
v155 = m_songWidget->setPosition;
v156 = cocos2d::CCDirector::sharedDirector();
v157 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v156));
cocos2d::CCPoint::CCPoint(&v316, v154, v157 + 45.0);
v155(m_songWidget, &v316);
if ( SongObject->m_unloaded )
CustomSongWidget::onGetSongInfo(a1->m_songWidget, nullptr);
v158 = a1->m_songWidget;
sub_775C20(&v315, &a1->m_level->m_songIDs);
sub_775C20(&v316, &a1->m_level->m_sfxIDs);
CustomSongWidget::updateWithMultiAssets(v158, (std::string)&v315, (std::string)&v316, a1->m_level->m_songSize);
sub_774008(&v316);
sub_774008(&v315);
v159 = cocos2d::CCMenu::create();
v160 = v159->setPosition;
v161 = cocos2d::CCDirector::sharedDirector();
v162 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v161));
v163 = cocos2d::CCDirector::sharedDirector();
v164 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v163));
cocos2d::CCPoint::CCPoint(&v316, v162 + 30.0, v164 + 30.0);
v160(v159, &v316);
a1->addChild_0(a1, v159, 2);
v165 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_optionsBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v165->setScale)(v165, 1058642330);
v314.y = 0.0;
LODWORD(v314.x) = LevelInfoLayer::onLevelOptions;
v166 = CCMenuItemSpriteExtra::create(
v165,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onLevelOptions, (unsigned int)a1));
v159->addChild(v159, v166);
v264 = v166->setPosition;
cocos2d::CCPoint::CCPoint(&v315, 30.0, 70.0);
cocos2d::CCNode::convertToNodeSpace(&v316, v159, &v315);
v264(v166, &v316);
v167 = cocos2d::CCSprite::createWithSpriteFrameName("gj_folderBtn_001.png");
v168 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)a2->m_levelFolder);
cocos2d::CCString::getCString(v168);
v169 = cocos2d::CCLabelBMFont::create();
v170 = v167->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_folderLabel = v169;
v170->addChild_0(v167, v169, 1);
m_folderLabel = a1->m_folderLabel;
v172 = m_folderLabel->setPosition;
v173 = v167->getContentSize(v167)->width;
v174 = (int)v167->getContentSize(v167);
cocos2d::CCPoint::CCPoint(&v316, v173 * 0.5, (float)(*(float *)(v174 + 4) * 0.5) + 1.0);
v172(m_folderLabel, &v316);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_folderLabel, 24.0, 0.55, 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, int))v167->setScale)(v167, 1061997773);
v315.y = 0.0;
LODWORD(v315.x) = LevelInfoLayer::onSetFolder;
v175 = CCMenuItemSpriteExtra::create(
v167,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onSetFolder, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v175, 1.2);
v124->addChild(v124, v175);
v176 = v175->setPosition;
cocos2d::CCPoint::CCPoint(&v275, v266.width - 73.0, 80.0);
cocos2d::CCNode::convertToNodeSpace(&v316, v124, &v275);
v176(v175, &v316);
v177 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_listAddBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v177->setScale)(v177, 1063675494);
v316.y = 0.0;
LODWORD(v316.x) = LevelInfoLayer::onAddToList;
v178 = CCMenuItemSpriteExtra::create(
v177,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(LevelInfoLayer::onAddToList, (unsigned int)a1));
v124->addChild(v124, v178);
v179 = v178->setPosition;
v180 = (int)v175->getPosition(v175);
cocos2d::CCPoint::CCPoint(&v274, 0.0, 35.0);
cocos2d::CCPoint::operator+(&v275, v180, &v274);
v179(v178, &v275);
if ( a2->m_dailyID.random - a2->m_dailyID.seed > 0 || a2->m_gauntletLevel )
{
v175->setVisible(v175, 0);
v175->setEnabled(v175, 0);
v252->setVisible(v252, 0);
v252->setEnabled(v252, 0);
v260->setVisible(v260, 0);
v260->setEnabled(v260, 0);
v258->setVisible(v258, 0);
v258->setEnabled(v258, 0);
v178->setVisible(v178, 0);
v178->setEnabled(v178, 0);
}
if ( PlatformToolbox::isControllerConnected() )
{
GameToolbox::addBackButton(a1, v263);
v181 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_Start_001.png");
a1->m_playSprite->addChild(a1->m_playSprite, v181);
v182 = v181->setPosition;
v183 = a1->m_playSprite->getContentSize(a1->m_playSprite)->width;
v184 = a1->m_playSprite->getContentSize(a1->m_playSprite);
cocos2d::CCPoint::CCPoint(&v275, v183 * 0.5, (float)(v184->height * 0.5) - 40.0);
v182(v181, &v275);
}
v185 = a1->m_level;
if ( (v185->m_savedTime || v185->m_savedPoints)
&& v185->m_levelType != Editor
&& v185->m_demon.random - v185->m_demon.seed == 1
&& PlatformToolbox::isNetworkAvailable() )
{
if ( a1->m_level->m_savedTime )
{
v244 = GameLevelManager::sharedState();
GameLevelManager::getLevelLeaderboard(v244, a1->m_level, (LevelLeaderboardType)4, Time);
}
if ( a1->m_level->m_savedPoints )
{
v245 = GameLevelManager::sharedState();
GameLevelManager::getLevelLeaderboard(v245, a1->m_level, (LevelLeaderboardType)4, Points);
}
}
GameManager::sharedState()->m_somethingInMenuLayer = 0;
return v261;
}