//
// CreatorLayer::init from 0x14009c140 to 0x14009d308 (4552 bytes)
//
// 5 xrefs:
// > CreatorLayer::scene @ 0x14009c0bf
// > CreatorLayer::scene @ 0x14009c0c6
// > CreatorLayer::scene @ 0x14009c0b0
// > ??> @ 0x1405433e8
// > ??> @ 0x1406c756c
//
// 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=12
bool CreatorLayer::init(CreatorLayer *a1)
{
bool result; // al
_BOOL8 v3; // rdx
__int64 v4; // rax
_BOOL8 v5; // rdx
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
struct cocos2d::CCSprite *v8; // rdi
cocos2d::CCSprite_vtbl *v9; // rbx
const cocos2d::CCPoint *v10; // rax
cocos2d::CCSprite_vtbl *v11; // rbx
const cocos2d::CCPoint *v12; // rax
__int64 v13; // rcx
cocos2d::CCNode *v14; // r15
struct cocos2d::CCSprite *v15; // rax
float v16; // xmm6_4
float v17; // xmm6_4
int i; // edi
char v19; // r13
char v20; // r12
char *v21; // rdx
void (*v22)(CreatorLayer *, cocos2d::CCObject *); // rbx
char *v23; // r8
struct cocos2d::CCPoint *v24; // rdx
size_t v25; // r8
CCSpriteWithHue *v26; // r14
void *v27; // rcx
const char *v28; // rcx
CCMenuItemSpriteExtra *v29; // rbx
float v30; // xmm0_4
GameManager *v31; // rcx
void *v32; // rcx
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
float v39; // xmm6_4
__int64 v40; // rcx
cocos2d::CCDirector *v41; // rax
float v42; // xmm0_4
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
float v50; // xmm6_4
__int64 v51; // rcx
cocos2d::CCDirector *v52; // rax
float v53; // xmm0_4
const cocos2d::CCPoint *v54; // rax
struct cocos2d::CCSprite *v55; // rdi
cocos2d::CCSprite_vtbl *v56; // rbx
const cocos2d::CCPoint *v57; // rax
cocos2d::CCSprite_vtbl *v58; // rbx
__int64 v59; // rcx
cocos2d::CCDirector *v60; // rax
float v61; // xmm6_4
__int64 v62; // rcx
cocos2d::CCDirector *v63; // rax
float v64; // xmm0_4
const cocos2d::CCPoint *v65; // rax
struct cocos2d::CCSprite *v66; // rdi
cocos2d::CCSprite_vtbl *v67; // rbx
const cocos2d::CCPoint *v68; // rax
cocos2d::CCSprite_vtbl *v69; // rbx
__int64 v70; // rcx
cocos2d::CCDirector *v71; // rax
float v72; // xmm6_4
__int64 v73; // rcx
cocos2d::CCDirector *v74; // rax
float v75; // xmm0_4
const cocos2d::CCPoint *v76; // rax
GameStatsManager *v77; // rcx
int Stat; // r12d
const char *v79; // rcx
struct cocos2d::CCSprite *v80; // r14
CCMenuItemSpriteExtra *v81; // rdi
CCMenuItemSpriteExtra_vtbl *v82; // rbx
struct cocos2d::CCPoint v83; // rax
float height; // xmm6_4
float *v85; // rax
struct cocos2d::CCSprite *v86; // rbx
cocos2d::CCString *v87; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v89; // rbx
GameManager *v90; // rcx
bool UGV; // al
const char *v92; // rcx
cocos2d::CCSprite *v93; // rbx
CCMenuItemSpriteExtra *v94; // rdi
CCMenuItemSpriteExtra_vtbl *v95; // rbx
struct cocos2d::CCPoint v96; // rax
struct cocos2d::CCSprite *v97; // rbx
CCMenuItemSpriteExtra *v98; // r14
struct cocos2d::CCMenu *v99; // rdi
cocos2d::CCMenu_vtbl *v100; // rbx
__int64 v101; // rcx
cocos2d::CCDirector *v102; // rax
float v103; // xmm6_4
__int64 v104; // rcx
cocos2d::CCDirector *v105; // rax
float v106; // xmm0_4
const cocos2d::CCPoint *v107; // rax
__int64 v108; // rdx
__int64 v109; // rcx
__int64 v110; // rax
__int64 v111; // rdx
GameLevelManager *v112; // rcx
__int16 v113; // [rsp+38h] [rbp-D0h] BYREF
char v114; // [rsp+3Ah] [rbp-CEh]
CCMenuItemSpriteExtra *v115; // [rsp+40h] [rbp-C8h] BYREF
cocos2d::CCPoint v116; // [rsp+48h] [rbp-C0h] BYREF
CCMenuItemSpriteExtra *v117; // [rsp+50h] [rbp-B8h] BYREF
float v118; // [rsp+58h] [rbp-B0h]
float v119; // [rsp+5Ch] [rbp-ACh]
cocos2d::CCPoint v120; // [rsp+60h] [rbp-A8h] BYREF
struct cocos2d::CCPoint v121; // [rsp+68h] [rbp-A0h] BYREF
struct cocos2d::CCPoint v122[3]; // [rsp+70h] [rbp-98h] BYREF
__int64 v123; // [rsp+88h] [rbp-80h]
unsigned __int64 v124; // [rsp+90h] [rbp-78h]
__int128 v125; // [rsp+98h] [rbp-70h] BYREF
__int64 v126; // [rsp+A8h] [rbp-60h]
unsigned __int64 v127; // [rsp+B0h] [rbp-58h]
result = cocos2d::CCLayer::init(a1);
if ( !result )
return result;
v4 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v116 = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = ((__int64 (__fastcall *)(_QWORD))sub_14017AB00)(v116);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = qword_1406C2ED8;
}
*(_DWORD *)(v4 + 948) = -1;
LOBYTE(v3) = 1;
a1->setKeypadEnabled(a1, v3);
LOBYTE(v5) = 1;
a1->setKeyboardEnabled(a1, v5);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7);
v8 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v9 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v116, 0.0, 0.0);
v9->setAnchorPoint(v8, v10);
a1->addChild_0(a1, v8, -2);
((void (__fastcall *)(struct cocos2d::CCSprite *))v8->setScaleX)(v8);
((void (__fastcall *)(struct cocos2d::CCSprite *))v8->setScaleY)(v8);
v11 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v116, -5.0, -5.0);
v11->setPosition_0(v8, v12);
v113 = 26112;
v114 = -1;
v8->setColor(&v8->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v113);
v14 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v13);
a1->addChild_1(a1, v14);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_searchBtn_001.png");
v16 = fmaxf(0.89999998, (float)(v118 - 100.0) / (float)((float)(v15->m_obRect.size.width * 0.80000001) + 360.0));
if ( v16 > 1.0 )
v16 = 1.0;
v17 = v16 * 90.0;
cocos2d::CCPoint::CCPoint(&v116, v118 * 0.5, v119 * 0.5);
cocos2d::CCNode::convertToNodeSpace(v14, &v121);
for ( i = 0; i < 15; ++i )
{
*(_OWORD *)&v122[1].x = 0;
v123 = 0;
v124 = 15;
LOBYTE(v122[1].x) = 0;
v19 = 0;
v20 = 0;
if ( (unsigned int)(i - 1) > 0xD )
{
v21 = (char *)sub_14003AA10(0x20u);
v123 = 20;
v124 = 31;
*(_OWORD *)v21 = xmmword_140542D38;
v22 = CreatorLayer::onMyLevels;
LABEL_33:
strcpy(v21 + 16, ".png");
LABEL_34:
v122[1] = (struct cocos2d::CCPoint)v21;
LABEL_35:
v28 = (const char *)&v122[1];
if ( v124 > 0xF )
v28 = v21;
v26 = (CCSpriteWithHue *)cocos2d::CCSprite::createWithSpriteFrameName(v28);
}
else
{
switch ( i )
{
case 1:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 19;
v124 = 31;
strcpy(v21, "GJ_savedBtn_001.png");
v122[1] = (struct cocos2d::CCPoint)v21;
v22 = CreatorLayer::onSavedLevels;
goto LABEL_35;
case 2:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 23;
v124 = 31;
strcpy(v21, "GJ_highscoreBtn_001.png");
v22 = CreatorLayer::onLeaderboards;
goto LABEL_34;
case 3:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 23;
v124 = 31;
strcpy(v21, "GJ_challengeBtn_001.png");
v22 = CreatorLayer::onChallenge;
v19 = 1;
goto LABEL_34;
case 4:
v23 = (char *)sub_14003AA10(0x20u);
v123 = 20;
v124 = 31;
strcpy(v23, "GJ_versusBtn_001.png");
v122[1] = (struct cocos2d::CCPoint)v23;
v22 = CreatorLayer::onMultiplayer;
break;
case 5:
v23 = (char *)sub_14003AA10(0x20u);
v123 = 17;
v124 = 31;
strcpy(v23, "GJ_mapBtn_001.png");
v122[1] = (struct cocos2d::CCPoint)v23;
v22 = CreatorLayer::onAdventureMap;
break;
case 6:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 19;
v124 = 31;
strcpy(v21, "GJ_dailyBtn_001.png");
v22 = CreatorLayer::onDailyLevel;
goto LABEL_34;
case 7:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 20;
v124 = 31;
*(_OWORD *)v21 = xmmword_140542C78;
v22 = CreatorLayer::onWeeklyLevel;
goto LABEL_33;
case 8:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 19;
v124 = 31;
strcpy(v21, "GJ_eventBtn_001.png");
v22 = CreatorLayer::onEventLevel;
goto LABEL_34;
case 9:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 23;
v124 = 31;
strcpy(v21, "GJ_gauntletsBtn_001.png");
v22 = CreatorLayer::onGauntlets;
goto LABEL_34;
case 10:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 22;
v124 = 31;
strcpy(v21, "GJ_featuredBtn_001.png");
v22 = CreatorLayer::onFeaturedLevels;
goto LABEL_34;
case 11:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 19;
v124 = 31;
strcpy(v21, "GJ_listsBtn_001.png");
v22 = CreatorLayer::onTopLists;
goto LABEL_34;
case 12:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 19;
v124 = 31;
strcpy(v21, "GJ_pathsBtn_001.png");
v22 = CreatorLayer::onPaths;
goto LABEL_34;
case 13:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 22;
v124 = 31;
strcpy(v21, "GJ_mapPacksBtn_001.png");
v22 = CreatorLayer::onMapPacks;
goto LABEL_34;
case 14:
v21 = (char *)sub_14003AA10(0x20u);
v123 = 20;
v124 = 31;
strcpy(v21, "GJ_searchBtn_001.png");
v22 = CreatorLayer::onOnlineLevels;
v20 = 1;
goto LABEL_34;
}
v24 = &v122[1];
if ( v124 > 0xF )
v24 = (struct cocos2d::CCPoint *)v23;
v125 = 0;
v126 = 0;
v127 = 0;
v25 = -1;
do
++v25;
while ( *((_BYTE *)&v24->x + v25) );
sub_14003A930(&v125, v24, v25);
v26 = CCSpriteGrayscale::createWithSpriteFrameName((__int64)&v125);
if ( v127 > 0xF )
{
v27 = (void *)v125;
if ( v127 + 1 >= 0x1000 )
{
v27 = *(void **)(v125 - 8);
if ( (unsigned __int64)(v125 - (_QWORD)v27 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v27);
}
v126 = 0;
v127 = 15;
LOBYTE(v125) = 0;
v26->m_luminance._Elems[0] = 0.33000001;
v26->m_luminance._Elems[1] = 0.33000001;
v26->m_luminance._Elems[2] = 0.33000001;
v113 = -20561;
LOWORD(v120.x) = -20561;
BYTE2(v120.x) = -81;
v26->setColor(&v26->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v120);
}
((void (__fastcall *)(CCSpriteWithHue *))v26->setScale_0)(v26);
v29 = CCMenuItemSpriteExtra::create(v26, nullptr, a1, (cocos2d::SEL_MenuHandler *)v22);
v14->addChild_1(v14, v29);
v30 = floorf((float)i / 5.0);
cocos2d::CCPoint::CCPoint(
v122,
(float)((float)((float)(i % 5) - 1.5) * v17) - (float)(v17 * 0.5),
(float)-(float)(v30 - 1.0) * v17);
cocos2d::CCPoint::operator+(&v121, &v116);
v29->setPosition_0(v29, &v116);
if ( v19 )
{
a1->m_questsSprite = v26;
CreatorLayer::checkQuestsStatus(a1);
}
if ( v20 )
{
v31 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v115 = (CCMenuItemSpriteExtra *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v115);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v31, "0077") )
{
v29->setEnabled(v29, 0);
v29->setVisible(v29, 0);
}
}
if ( v124 > 0xF )
{
v32 = (void *)v122[1];
if ( v124 + 1 >= 0x1000 )
{
v32 = *(void **)(*(_QWORD *)&v122[1] - 8LL);
if ( (unsigned __int64)(*(_QWORD *)&v122[1] - (_QWORD)v32 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v32);
}
}
v33 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v34 = v33->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, 0.0, 0.0);
v34->setAnchorPoint(v33, v35);
v36 = v33->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v38 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v37);
v39 = cocos2d::CCDirector::getScreenBottom(v38) - 1.0;
v41 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v40);
v42 = cocos2d::CCDirector::getScreenLeft(v41) - 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, v42, v39);
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((cocos2d::CCPoint *)&v115, 1.0, 0.0);
v45->setAnchorPoint(v44, v46);
v47 = v44->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v48);
v50 = cocos2d::CCDirector::getScreenBottom(v49) - 1.0;
v52 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v51);
v53 = cocos2d::CCDirector::getScreenRight(v52) + 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, v53, v50);
v47->setPosition_0(v44, v54);
cocos2d::CCSprite::setFlipX(v44, 1);
v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v56 = v55->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, 0.0, 1.0);
v56->setAnchorPoint(v55, v57);
v58 = v55->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v60 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v59);
v61 = cocos2d::CCDirector::getScreenTop(v60) + 1.0;
v63 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v62);
v64 = cocos2d::CCDirector::getScreenLeft(v63) - 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, v64, v61);
v58->setPosition_0(v55, v65);
cocos2d::CCSprite::setFlipY(v55, 1);
a1->addChild_0(a1, v55, -1);
v66 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v67 = v66->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, 1.0, 1.0);
v67->setAnchorPoint(v66, v68);
v69 = v66->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v71 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v70);
v72 = cocos2d::CCDirector::getScreenTop(v71) + 1.0;
v74 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v73);
v75 = cocos2d::CCDirector::getScreenRight(v74) + 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, v75, v72);
v69->setPosition_0(v66, v76);
cocos2d::CCSprite::setFlipY(v66, 1);
cocos2d::CCSprite::setFlipX(v66, 1);
v77 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v115 = (CCMenuItemSpriteExtra *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v115);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v77 = (GameStatsManager *)qword_1406C2EE8;
}
Stat = GameStatsManager::getStat(v77, "13");
v79 = (const char *)&xmmword_14053DE08;
if ( Stat >= 50 )
v79 = "GJ_lock_open_001.png";
v80 = cocos2d::CCSprite::createWithSpriteFrameName(v79);
v115 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v81 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v115);
if ( v81 )
{
if ( CCMenuItemSpriteExtra::init(v81, v80, nullptr, a1, (cocos2d::SEL_MenuHandler *)CreatorLayer::onSecretVault) )
{
cocos2d::CCObject::autorelease(v81);
goto LABEL_62;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v81->~CCMenuItemSpriteExtra)(v81, 1);
}
v81 = nullptr;
LABEL_62:
v14->addChild_1(v14, v81);
v82 = v81->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v115, v118 - 22.0, v119 - 18.0);
v83 = cocos2d::CCNode::convertToNodeSpace(v14, v122);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v82->setPosition_0)(v81, v83);
if ( Stat < 50 )
{
height = v81->getContentSize(v81)->height;
v85 = (float *)v81->getContentSize(v81);
cocos2d::CCPoint::CCPoint(&v120, *v85 * 0.5, (float)(height * 0.5) - 22.0);
v86 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_diamondsIcon_001.png");
v80->addChild_1(v80, v86);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v117, 9.0, -1.0);
cocos2d::CCPoint::operator+(&v120, &v116);
v86->setPosition_0(v86, &v116);
((void (__fastcall *)(struct cocos2d::CCSprite *))v86->setScale_0)(v86);
v87 = cocos2d::CCString::createWithFormat("%i", 50);
CString = cocos2d::CCString::getCString(v87);
v89 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_14052A4D8);
v80->addChild_1(v80, v89);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v117, -8.5, 0.0);
cocos2d::CCPoint::operator+(&v120, &v116);
v89->setPosition_0(v89, &v116);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v89->setScale_0)(v89);
}
HIDWORD(v81->m_pfnSelector.adj) = 0x40000000;
v90 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v117 = (CCMenuItemSpriteExtra *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v90 = (GameManager *)qword_1406C2ED8;
}
UGV = GameManager::getUGV(v90, (const char *)&word_140531E90);
v92 = "secretDoorBtn_closed_001.png";
if ( UGV )
v92 = "secretDoorBtn_open_001.png";
v93 = cocos2d::CCSprite::createWithSpriteFrameName(v92);
a1->m_secretDoorSprite = v93;
v117 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v94 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v117);
if ( v94 )
{
if ( CCMenuItemSpriteExtra::init(v94, v93, nullptr, a1, (cocos2d::SEL_MenuHandler *)CreatorLayer::onTreasureRoom) )
{
cocos2d::CCObject::autorelease(v94);
goto LABEL_73;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v94->~CCMenuItemSpriteExtra)(v94, 1);
}
v94 = nullptr;
LABEL_73:
LOWORD(v94->m_scaleMultiplier) = 256;
v14->addChild_1(v14, v94);
v95 = v94->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v117, v118 - 22.0, 24.0);
v96 = cocos2d::CCNode::convertToNodeSpace(v14, (const struct cocos2d::CCPoint *)&v115);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v95->setPosition_0)(v94, v96);
HIDWORD(v94->m_pfnSelector.adj) = 1067030938;
v97 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v117 = (CCMenuItemSpriteExtra *)operator new(0x208u);
v98 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v117);
if ( !v98 )
{
LABEL_77:
v98 = nullptr;
goto LABEL_78;
}
if ( !CCMenuItemSpriteExtra::init(v98, v97, nullptr, a1, (cocos2d::SEL_MenuHandler *)CreatorLayer::onBack) )
{
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v98->~CCMenuItemSpriteExtra)(v98, 1);
goto LABEL_77;
}
cocos2d::CCObject::autorelease(v98);
LABEL_78:
HIDWORD(v98->m_pfnSelector.adj) = 1070386381;
v99 = cocos2d::CCMenu::create(v98, 0);
a1->addChild_0(a1, v99, 1);
v100 = v99->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v102 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v101);
v103 = cocos2d::CCDirector::getScreenTop(v102) - 23.0;
v105 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v104);
v106 = cocos2d::CCDirector::getScreenLeft(v105) + 24.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v117, v106, v103);
v100->setPosition_0(v99, v107);
v110 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v117 = (CCMenuItemSpriteExtra *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v110 = qword_1406C2ED8;
}
*(_DWORD *)(v110 + 948) = 0;
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v109, v108) + 197) )
GameToolbox::addBackButton(a1, v98);
v111 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v117 = (CCMenuItemSpriteExtra *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v111 = qword_1406C2ED8;
}
if ( *(_DWORD *)(v111 + 652) == *(_DWORD *)(v111 + 656) )
{
v112 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v117 = (CCMenuItemSpriteExtra *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(v117);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v112 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::updateUserScore(v112);
}
return 1;
}