//
// SecretLayer2::init from 0x140577e20 to 0x140579353 (5427 bytes)
//
// 5 xrefs:
// > SecretLayer2::scene @ 0x140577dcf
// > SecretLayer2::scene @ 0x140577dd6
// > SecretLayer2::scene @ 0x140577dc0
// > ??> @ 0x1407df0b8
// > ??> @ 0x14092c834
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:34:23 +0000
//
// Hidden C++ exception states: #wind=9
bool __fastcall SecretLayer2::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCTextureCache *v4; // rax
__int64 v5; // rdx
__int64 v6; // rcx
cocos2d::CCSpriteFrameCache *v7; // rax
unsigned int v8; // r15d
__int64 v9; // rcx
__int64 v10; // rdx
__int64 v11; // rdx
__int64 v12; // rcx
__int64 v13; // rax
__int64 v14; // rcx
cocos2d::CCObject *v15; // rax
__int64 v16; // rdx
__int64 v17; // rcx
__int64 v18; // r8
__int64 v19; // rbx
cocos2d::CCString *v20; // rax
__int64 v21; // rcx
int v22; // ebx
__int64 v23; // r8
unsigned __int64 v24; // rdx
void *v25; // r8
struct cocos2d::CCObject *v26; // rbx
__int64 v27; // rbx
cocos2d::CCString *v28; // rax
__int64 v29; // rcx
int v30; // ebx
__int64 v31; // r8
unsigned __int64 v32; // rdx
void *v33; // r8
__int64 v34; // rbx
cocos2d::CCString *v35; // rax
int v36; // ebx
void *v37; // r8
struct cocos2d::CCObject *v38; // rbx
__int64 v39; // rbx
cocos2d::CCString *v40; // rax
__int64 v41; // rcx
int v42; // ebx
__int64 v43; // r8
unsigned __int64 v44; // rdx
void *v45; // r8
struct cocos2d::CCObject *v46; // rbx
__int64 v47; // rbx
cocos2d::CCString *v48; // rax
__int64 v49; // rcx
int v50; // ebx
__int64 v51; // r8
unsigned __int64 v52; // rdx
void *v53; // r8
struct cocos2d::CCObject *v54; // rbx
__int64 v55; // rbx
cocos2d::CCString *v56; // rax
__int64 v57; // rcx
int v58; // ebx
__int64 v59; // r8
unsigned __int64 v60; // rdx
void *v61; // r8
struct cocos2d::CCObject *v62; // rbx
__int64 v63; // rbx
cocos2d::CCString *v64; // rax
__int64 v65; // rcx
int v66; // ebx
__int64 v67; // r8
unsigned __int64 v68; // rdx
void *v69; // r8
struct cocos2d::CCObject *v70; // rbx
__int64 v71; // rbx
cocos2d::CCString *v72; // rax
__int64 v73; // rcx
int v74; // ebx
unsigned __int64 v75; // rdx
void *v76; // r8
struct cocos2d::CCObject *v77; // rbx
__int64 v78; // rcx
__int64 v79; // rdx
__int64 v80; // rcx
struct cocos2d::CCObject *v81; // rbx
struct cocos2d::CCSprite *v82; // rdi
__int64 v83; // rbx
__int64 v84; // rax
__int64 v85; // rbx
__int64 v86; // rax
struct cocos2d::CCLabelBMFont *v87; // rdi
__int64 v88; // rbx
__int64 v89; // rax
struct cocos2d::CCLabelBMFont *v90; // rax
__int64 v91; // rax
__int64 Message; // rax
__int64 v93; // rax
_QWORD *v94; // rbx
__int64 v95; // rdx
__int64 v96; // rdx
__int64 v97; // rcx
char *v98; // rax
__int64 v99; // rcx
__int64 v100; // rcx
int v101; // eax
cocos2d::CCObject *v102; // rdi
struct cocos2d::CCMenu *v103; // r12
__int64 v104; // rbx
__int64 v105; // rcx
cocos2d::CCDirector *v106; // rax
float v107; // xmm6_4
__int64 v108; // rcx
cocos2d::CCDirector *v109; // rax
float v110; // xmm0_4
__int64 v111; // rax
__int64 v112; // rcx
struct cocos2d::CCSprite *v113; // rsi
struct cocos2d::CCSprite *v114; // rdi
__int64 v115; // rbx
__int64 v116; // rax
cocos2d::CCObject *v117; // rax
__int64 v118; // rdi
__int64 v119; // rbx
__int64 v120; // rax
__int64 v121; // rax
__int64 v122; // rcx
bool UGV; // al
const char *v124; // rcx
int v125; // eax
cocos2d::CCObject *v126; // rax
__int64 v127; // rdi
__int64 v128; // rbx
__int64 v129; // rax
__int64 v130; // rax
__int64 v131; // rcx
cocos2d::CCObject *v132; // rax
struct cocos2d::CCSprite *v133; // rax
cocos2d::CCObject *v134; // rax
__int64 v135; // rdi
__int64 v136; // rbx
__int64 v137; // rax
struct cocos2d::CCObject *v138; // rsi
__int64 v139; // rax
struct cocos2d::CCObject *v140; // rdi
__int64 v141; // rax
__int64 v142; // rbx
__int64 v143; // rax
__int64 v144; // rcx
__int64 v145; // rax
struct cocos2d::CCObject *v146; // rbx
__int64 v147; // rax
cocos2d::CCString *v148; // rax
const char *CString; // rax
struct cocos2d::CCObject *v150; // rbx
__int64 v151; // rax
__int64 v152; // rcx
struct cocos2d::CCObject *v153; // rax
__int64 v154; // rcx
__int64 v155; // rcx
__int64 MainLevel; // rax
__int64 v157; // rbx
struct cocos2d::CCFiniteTimeAction *v158; // rax
struct cocos2d::CCAction *v159; // rax
__int16 v160; // [rsp+38h] [rbp-79h] BYREF
char v161; // [rsp+3Ah] [rbp-77h]
void **v162; // [rsp+40h] [rbp-71h] BYREF
float v163; // [rsp+48h] [rbp-69h] BYREF
float v164; // [rsp+4Ch] [rbp-65h]
void *v165; // [rsp+50h] [rbp-61h] BYREF
_BYTE v166[8]; // [rsp+58h] [rbp-59h] BYREF
_BYTE v167[8]; // [rsp+60h] [rbp-51h] BYREF
_BYTE v168[8]; // [rsp+68h] [rbp-49h] BYREF
_BYTE v169[16]; // [rsp+70h] [rbp-41h] BYREF
void *Block[2]; // [rsp+80h] [rbp-31h] BYREF
__int64 v171; // [rsp+90h] [rbp-21h]
unsigned __int64 v172; // [rsp+98h] [rbp-19h]
result = cocos2d::CCLayer::init((cocos2d::CCLayer *)a1);
if ( result )
{
v4 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v3);
cocos2d::CCTextureCache::addImage(v4, "SecretSheet.png", 0);
v7 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v6, v5);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v7, "SecretSheet.plist");
v162 = Block;
*(_OWORD *)Block = 0;
v8 = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 16;
v172 = 31;
strcpy((char *)Block[0], "secretLoop02.mp3");
if ( !qword_14090BFD0 )
{
v165 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v165);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
GameManager::fadeInMusic(v9, (__int64)Block);
LOBYTE(v10) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v10);
LOBYTE(v11) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1008LL))(a1, v11);
v13 = cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(v13, &v163);
v15 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v14);
*(_QWORD *)(a1 + 480) = v15;
cocos2d::CCObject::retain(v15);
v19 = AchievementManager::sharedState(v17, v16, v18);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret01");
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v19 + 352), Block);
v22 = cocos2d::CCString::intValue(v20);
v24 = v172;
if ( v172 > 0xF )
{
v25 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v25);
}
if ( v22 < 100 )
{
v26 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v21, v24);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v26 + 64LL))(v26, 1);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v26, 1);
}
v27 = AchievementManager::sharedState(v21, v24, v23);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 21;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.secret06");
v28 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v27 + 352), Block);
v30 = cocos2d::CCString::intValue(v28);
v32 = v172;
if ( v172 > 0xF )
{
v33 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v33 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v33 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v33);
}
if ( v30 >= 100 )
{
v34 = AchievementManager::sharedState(v29, v32, v31);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret03");
v35 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v34 + 352), Block);
v36 = cocos2d::CCString::intValue(v35);
v32 = v172;
if ( v172 > 0xF )
{
v37 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v37 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v37 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v37);
}
if ( v36 < 100 )
{
v38 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v29, v32);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v38 + 64LL))(v38, 3);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v38, 3);
}
}
v39 = AchievementManager::sharedState(v29, v32, v31);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret05");
v40 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v39 + 352), Block);
v42 = cocos2d::CCString::intValue(v40);
v44 = v172;
if ( v172 > 0xF )
{
v45 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v45 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v45 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v45);
}
if ( v42 < 100 )
{
v46 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v41, v44);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v46 + 64LL))(v46, 5);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v46, 5);
}
v47 = AchievementManager::sharedState(v41, v44, v43);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret06");
v48 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v47 + 352), Block);
v50 = cocos2d::CCString::intValue(v48);
v52 = v172;
if ( v172 > 0xF )
{
v53 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v53 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v53 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v53);
}
if ( v50 < 100 )
{
v54 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v49, v52);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v54 + 64LL))(v54, 6);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v54, 6);
}
v55 = AchievementManager::sharedState(v49, v52, v51);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret08");
v56 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v55 + 352), Block);
v58 = cocos2d::CCString::intValue(v56);
v60 = v172;
if ( v172 > 0xF )
{
v61 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v61 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v61 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v61);
}
if ( v58 < 100 )
{
v62 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v57, v60);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v62 + 64LL))(v62, 8);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v62, 8);
}
v63 = AchievementManager::sharedState(v57, v60, v59);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret09");
v64 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v63 + 352), Block);
v66 = cocos2d::CCString::intValue(v64);
v68 = v172;
if ( v172 > 0xF )
{
v69 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v69 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v69 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v69);
}
if ( v66 < 100 )
{
v70 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v65, v68);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v70 + 64LL))(v70, 9);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v70, 9);
}
v71 = AchievementManager::sharedState(v65, v68, v67);
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x20u);
v171 = 24;
v172 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret10");
v72 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v71 + 352), Block);
v74 = cocos2d::CCString::intValue(v72);
v75 = v172;
if ( v172 > 0xF )
{
v76 = Block[0];
if ( v172 + 1 >= 0x1000 )
{
v76 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v76 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v76);
}
v171 = 0;
v172 = 15;
LOBYTE(Block[0]) = 0;
if ( v74 < 100 )
{
v77 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v73, v75);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v77 + 64LL))(v77, 10);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v77, 10);
}
v78 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v162 = (void **)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v162);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v78 = qword_14090BFD0;
}
if ( !GameManager::getUGV(v78, &word_14070D060) )
{
v81 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v80, v79);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v81 + 64LL))(v81, 20);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 480), v81, 20);
}
v82 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v83 = *(_QWORD *)v82;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, 0.0, 0.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v83 + 288))(v82, v84);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(
a1,
v82,
4294967293LL);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v82 + 120LL))(v82);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v82 + 136LL))(v82);
v85 = *(_QWORD *)v82;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, -5.0, -5.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v85 + 184))(v82, v86);
v160 = 75;
v161 = 100;
(**((void (__fastcall ***)(__int64, __int16 *))v82 + 40))((__int64)v82 + 320, &v160);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v169, 0.0, 0.0, 40.0, 40.0);
v87 = cocos2d::CCLabelBMFont::create("Vault of Secrets", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v87 + 160LL))(v87);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *))(*(_QWORD *)a1 + 464LL))(a1, v87);
v88 = *(_QWORD *)v87;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, v163 * 0.5, v164 - 24.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v88 + 184))(v87, v89);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v166, v163 * 0.5, (float)(v164 * 0.5) + 50.0);
v90 = cocos2d::CCLabelBMFont::create(" ", (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 464) = v90;
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *))(*(_QWORD *)a1 + 464LL))(a1, v90);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, 0.0, 43.0);
cocos2d::CCPoint::operator+(v166, &v165, v91);
(*(void (__fastcall **)(_QWORD, void **))(**(_QWORD **)(a1 + 464) + 184LL))(*(_QWORD *)(a1 + 464), &v165);
Message = SecretLayer2::getMessage(a1, Block);
SecretLayer2::updateMessageLabel(a1, Message);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, (const struct cocos2d::CCRect *)v169);
v94 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v93);
LOBYTE(v95) = 100;
(*(void (__fastcall **)(_QWORD *, __int64))(v94[40] + 40LL))(v94 + 40, v95);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v168, 200.0, 40.0);
(*(void (__fastcall **)(_QWORD *, _BYTE *))(*v94 + 312LL))(v94, v168);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v94, 4294967294LL);
(*(void (__fastcall **)(_QWORD *, _BYTE *))(*v94 + 184LL))(v94, v166);
(*(void (__fastcall **)(_QWORD *, void *))v94[40])(v94 + 40, &unk_14070463C);
v98 = CCTextInputNode::create(v97, v96, (__int64)"...");
*(_QWORD *)(a1 + 456) = v98;
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v98, 20);
*(_QWORD *)(*(_QWORD *)(a1 + 456) + 600LL) = a1 + 408;
(*(void (__fastcall **)(_QWORD, _BYTE *))(**(_QWORD **)(a1 + 456) + 184LL))(*(_QWORD *)(a1 + 456), v166);
v99 = *(_QWORD *)(a1 + 456);
*(_DWORD *)(v99 + 564) = 1060320051;
CCTextInputNode::refreshLabel(v99);
v100 = *(_QWORD *)(a1 + 456);
*(_DWORD *)(v100 + 560) = 1127481344;
CCTextInputNode::refreshLabel(v100);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 456) + 592LL) + 336LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 456) + 592LL),
0);
*(_DWORD *)(*(_QWORD *)(a1 + 456) + 608LL) = 100;
*(_OWORD *)Block = 0;
v171 = 0;
v172 = 0;
Block[0] = sub_14003D460(0x70u);
v171 = 97;
v172 = 111;
strcpy(
(char *)Block[0],
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 456), Block);
SecretLayer2::updateSearchLabel(a1, &byte_1406ED6E0);
v101 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v102 = CCMenuItemSpriteExtra::create(v101, 0, a1, (__int64)SecretLayer2::onBack);
*((_DWORD *)v102 + 93) = 1069547520;
v103 = cocos2d::CCMenu::create(v102, 0);
(*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v103, 1);
v104 = *(_QWORD *)v103;
v106 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v105);
v107 = cocos2d::CCDirector::getScreenTop(v106) - 23.0;
v109 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v108);
v110 = cocos2d::CCDirector::getScreenLeft(v109) + 24.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, v110, v107);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v104 + 184))(v103, v111);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v112) + 209) )
GameToolbox::addBackButton(a1, (__int64)v102);
v113 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_001.png");
v114 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock2_2_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v113 + 456LL))(
v113,
v114,
0xFFFFFFFFLL);
v115 = *(_QWORD *)v114;
cocos2d::CCNode::convertToNodeSpace(v113, &v162, &unk_14090B5E8);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v115 + 184))(v114, v116);
v117 = CCMenuItemSpriteExtra::create((int)v113, 0, a1, (__int64)SecretLayer2::onSubmit);
*(_QWORD *)(a1 + 472) = v117;
(*(void (__fastcall **)(struct cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v103 + 464LL))(v103, v117);
v118 = **(_QWORD **)(a1 + 472);
v119 = *(_QWORD *)(a1 + 472);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v162, v163 * 0.5, (float)(v164 * 0.5) - 20.0);
cocos2d::CCNode::convertToNodeSpace(v103, &v165, v120);
(*(void (__fastcall **)(__int64, __int64))(v118 + 184))(v119, v121);
*(_DWORD *)(*(_QWORD *)(a1 + 472) + 372LL) = 1060320051;
v122 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
Block[0] = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v122 = qword_14090BFD0;
}
UGV = GameManager::getUGV(v122, &word_14070D04C);
v124 = "secretDoor_closed_001.png";
if ( UGV )
v124 = "secretDoor_open_001.png";
v125 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName(v124);
v126 = CCMenuItemSpriteExtra::create(v125, 0, a1, (__int64)SecretLayer2::onDoor);
*(_QWORD *)(a1 + 512) = v126;
*((_BYTE *)v126 + 408) = 0;
*(_BYTE *)(*(_QWORD *)(a1 + 512) + 409LL) = 1;
(*(void (__fastcall **)(struct cocos2d::CCMenu *, _QWORD))(*(_QWORD *)v103 + 464LL))(v103, *(_QWORD *)(a1 + 512));
v127 = **(_QWORD **)(a1 + 512);
v128 = *(_QWORD *)(a1 + 512);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, v163 - 45.0, 45.0);
cocos2d::CCNode::convertToNodeSpace(v103, &v162, v129);
(*(void (__fastcall **)(__int64, __int64))(v127 + 184))(v128, v130);
v132 = (cocos2d::CCObject *)cocos2d::CCArray::create(v131);
*(_QWORD *)(a1 + 504) = v132;
cocos2d::CCObject::retain(v132);
v133 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playBtn2_001.png");
LODWORD(v128) = (_DWORD)v133;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v133 + 160LL))(v133);
v134 = CCMenuItemSpriteExtra::create(v128, 0, a1, (__int64)SecretLayer2::onSecretLevel);
*(_QWORD *)(a1 + 496) = v134;
(*(void (__fastcall **)(struct cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v103 + 464LL))(v103, v134);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v167, (float)(v163 - 45.0) - 0.0, 130.0);
v135 = **(_QWORD **)(a1 + 496);
v136 = *(_QWORD *)(a1 + 496);
cocos2d::CCNode::convertToNodeSpace(v103, Block, v167);
(*(void (__fastcall **)(__int64, __int64))(v135 + 184))(v136, v137);
v138 = cocos2d::CCLabelBMFont::create("The", (const char *)&qword_140704F78);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v138 + 160LL))(v138);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *))(*(_QWORD *)a1 + 464LL))(a1, v138);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, 0.0, 46.0);
cocos2d::CCPoint::operator+(v167, &v165, v139);
(*(void (__fastcall **)(struct cocos2d::CCObject *, void **))(*(_QWORD *)v138 + 184LL))(v138, &v165);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 504), v138);
v140 = cocos2d::CCLabelBMFont::create("Challenge", (const char *)&qword_140704F78);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v140 + 160LL))(v140);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *))(*(_QWORD *)a1 + 464LL))(a1, v140);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, 0.0, -15.0);
v142 = v141;
v143 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v138 + 200LL))(v138);
cocos2d::CCPoint::operator+(v143, &v165, v142);
(*(void (__fastcall **)(struct cocos2d::CCObject *, void **))(*(_QWORD *)v140 + 184LL))(v140, &v165);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 504), v140);
v144 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
Block[0] = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v144 = qword_14090BFE0;
}
if ( (int)GameStatsManager::getStat(v144, "13") < 200 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, 3.0, -30.0);
cocos2d::CCPoint::operator+(v167, &v165, v145);
v146 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_diamondsIcon_001.png");
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *))(*(_QWORD *)a1 + 464LL))(a1, v146);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, 12.0, -1.0);
cocos2d::CCPoint::operator+(&v165, &v162, v147);
(*(void (__fastcall **)(struct cocos2d::CCObject *, void ***))(*(_QWORD *)v146 + 184LL))(v146, &v162);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v146 + 160LL))(v146);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 504), v146);
v148 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 200);
CString = cocos2d::CCString::getCString(v148);
v150 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_140704F78);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *))(*(_QWORD *)a1 + 464LL))(a1, v150);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)Block, -8.5, 0.0);
cocos2d::CCPoint::operator+(&v165, &v162, v151);
(*(void (__fastcall **)(struct cocos2d::CCObject *, void ***))(*(_QWORD *)v150 + 184LL))(v150, &v162);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v150 + 160LL))(v150);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 504), v150);
}
v152 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
Block[0] = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v152 = qword_14090BFD0;
}
if ( !GameManager::getUGV(v152, &word_14070D060) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 496) + 936LL))(*(_QWORD *)(a1 + 496), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 496) + 336LL))(*(_QWORD *)(a1 + 496), 0);
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 504)) )
{
do
{
v153 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 504), v8);
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v153 + 336LL))(v153, 0);
++v8;
}
while ( v8 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 504)) );
}
}
v154 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
Block[0] = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v154 = qword_14090BFD0;
}
if ( !GameManager::getUGV(v154, &word_14070D04C) )
{
v155 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
Block[0] = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)Block[0]);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v155 = *(_QWORD *)&qword_14090BFB0;
}
MainLevel = GameLevelManager::getMainLevel(v155, 0xBB9u, 1u);
if ( *(_DWORD *)(MainLevel + 932) - *(_DWORD *)(MainLevel + 928) >= 100 )
{
v157 = cocos2d::CCCallFunc::create(a1, SecretLayer2::showCompletedLevel);
v158 = cocos2d::CCDelayTime::create(0.80000001);
v159 = cocos2d::CCSequence::create(v158, v157, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)a1, v159);
}
}
return 1;
}
return result;
}