//
// SecretLayer4::init from 0x1403efb20 to 0x1403f0bd9 (4281 bytes)
//
// 5 xrefs:
// > LevelPage::onSecretDoor @ 0x14031cff3
// > LevelPage::onSecretDoor @ 0x14031cffa
// > LevelPage::onSecretDoor @ 0x14031cfe4
// > ??> @ 0x1405d4918
// > ??> @ 0x1406d8138
//
// 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=9
bool SecretLayer4::init(SecretLayer4 *a1)
{
float v1; // xmm3_4
bool result; // al
cocos2d::CCTextureCache *v4; // rax
__int64 v5; // rcx
cocos2d::CCSpriteFrameCache *v6; // rax
__int64 v7; // rcx
_BOOL8 v8; // rdx
_BOOL8 v9; // rdx
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
__int64 v12; // rcx
cocos2d::CCDictionary *v13; // rax
AchievementManager *v14; // rbx
cocos2d::CCString *v15; // rax
__int64 v16; // rcx
int v17; // ebx
unsigned __int64 v18; // rdx
void *v19; // rcx
struct cocos2d::CCObject *v20; // rbx
AchievementManager *v21; // rbx
cocos2d::CCString *v22; // rax
__int64 v23; // rcx
int v24; // ebx
unsigned __int64 v25; // rdx
void *v26; // rcx
struct cocos2d::CCObject *v27; // rbx
AchievementManager *v28; // rbx
cocos2d::CCString *v29; // rax
__int64 v30; // rcx
int v31; // ebx
unsigned __int64 v32; // rdx
void *v33; // rcx
struct cocos2d::CCObject *v34; // rbx
AchievementManager *v35; // rbx
cocos2d::CCString *v36; // rax
__int64 v37; // rcx
int v38; // ebx
unsigned __int64 v39; // rdx
void *v40; // rcx
struct cocos2d::CCObject *v41; // rbx
AchievementManager *v42; // rbx
cocos2d::CCString *v43; // rax
__int64 v44; // rcx
int v45; // ebx
unsigned __int64 v46; // rdx
void *v47; // rcx
struct cocos2d::CCObject *v48; // rbx
AchievementManager *v49; // rbx
cocos2d::CCString *v50; // rax
__int64 v51; // rcx
int v52; // ebx
unsigned __int64 v53; // rdx
void *v54; // rcx
struct cocos2d::CCObject *v55; // rbx
AchievementManager *v56; // rbx
float v57; // xmm0_4
cocos2d::CCString *v58; // rax
__int64 v59; // rcx
int v60; // ebx
unsigned __int64 v61; // rdx
void *v62; // rcx
struct cocos2d::CCObject *v63; // rbx
GameManager *v64; // rcx
__int64 v65; // rbx
struct cocos2d::CCDelayTime *v66; // rax
struct cocos2d::CCSequence *v67; // rax
cocos2d::ccColor3B *v68; // r8
struct cocos2d::CCSprite *v69; // rdi
cocos2d::CCSprite_vtbl *v70; // rbx
const cocos2d::CCPoint *v71; // rax
float v72; // xmm0_4
cocos2d::CCSprite_vtbl *v73; // rbx
const cocos2d::CCPoint *v74; // rax
struct cocos2d::CCLabelBMFont *v75; // rdi
float v76; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v77; // rbx
__int64 v78; // rax
float v79; // xmm0_4
cocos2d::CCLabelBMFont *v80; // rax
float v81; // xmm0_4
_QWORD *Message; // rax
struct cocos2d::CCRect *v83; // rax
struct cocos2d::extension::CCScale9Sprite *v84; // rbx
__int64 v85; // rdx
const char *v86; // r9
CCTextInputNode *v87; // rax
CCTextInputNode *m_searchInput; // rcx
CCTextInputNode *v89; // rcx
std::string *p_m_allowedChars; // rcx
struct cocos2d::CCPoint *v91; // rdx
struct cocos2d::CCSprite *v92; // rax
CCMenuItemSpriteExtra *v93; // rdi
struct cocos2d::CCMenu *v94; // r15
cocos2d::CCMenu_vtbl *v95; // rbx
__int64 v96; // rcx
cocos2d::CCDirector *v97; // rax
__int64 v98; // rcx
cocos2d::CCDirector *v99; // rax
float v100; // xmm0_4
const cocos2d::CCPoint *v101; // rax
__int64 v102; // rcx
__int64 v103; // rdx
__int64 v104; // rcx
cocos2d::CCNode *v105; // rsi
cocos2d::CCNode_vtbl *v106; // rbx
const cocos2d::CCSize *v107; // rax
struct cocos2d::CCSprite *v108; // rdi
float v109; // xmm0_4
cocos2d::CCSprite_vtbl *v110; // rbx
const cocos2d::CCPoint *v111; // rax
CCMenuItemSpriteExtra *v112; // rax
float v113; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v114; // rbx
struct cocos2d::CCPoint v115; // rax
__int64 v116; // rcx
__int64 v117; // rcx
cocos2d::CCNode *v118; // r15
__int64 v119; // rcx
__int64 v120; // rbx
GJChestSprite *v121; // rsi
void **v122; // rdi
void (__fastcall **v123)(void **, _QWORD); // rbx
double v124; // xmm0_8
__int64 v125; // rax
GJChestSprite_vtbl *v126; // rbx
float *v127; // rax
const cocos2d::CCPoint *v128; // rax
float v129; // xmm0_4
void (__fastcall **v130)(void **, struct cocos2d::CCPoint); // rbx
struct cocos2d::CCPoint v131; // rax
float v132; // [rsp+28h] [rbp-E0h]
int v133; // [rsp+28h] [rbp-E0h]
__int64 v134; // [rsp+38h] [rbp-D0h] BYREF
struct cocos2d::CCPoint *v135; // [rsp+40h] [rbp-C8h] BYREF
_QWORD v136[3]; // [rsp+48h] [rbp-C0h] BYREF
__int64 v137; // [rsp+60h] [rbp-A8h]
__int64 v138; // [rsp+68h] [rbp-A0h]
__int64 v139; // [rsp+70h] [rbp-98h] BYREF
struct cocos2d::CCPoint Src[3]; // [rsp+78h] [rbp-90h] BYREF
size_t Size; // [rsp+90h] [rbp-78h]
unsigned __int64 v142; // [rsp+98h] [rbp-70h]
char v143[16]; // [rsp+A0h] [rbp-68h] BYREF
__int64 v144; // [rsp+B0h] [rbp-58h]
__int64 v145; // [rsp+B8h] [rbp-50h]
_QWORD *v146; // [rsp+C0h] [rbp-48h] BYREF
cocos2d::CCSize v147; // [rsp+C8h] [rbp-40h] BYREF
cocos2d::CCRect v148; // [rsp+D0h] [rbp-38h] BYREF
void *Block[2]; // [rsp+E0h] [rbp-28h] BYREF
__int64 v150; // [rsp+F0h] [rbp-18h]
unsigned __int64 v151; // [rsp+F8h] [rbp-10h]
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v4 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v4, "SecretSheet.png", 0);
v6 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v5);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v6, "SecretSheet.plist");
Src[0] = (struct cocos2d::CCPoint)&v136[1];
*(_OWORD *)&v136[1] = 0;
v137 = 0;
v138 = 15;
v136[1] = sub_14003AA10(0x20u);
v137 = 16;
v138 = 31;
strcpy((char *)v136[1], "secretLoop03.mp3");
if ( !qword_1406C2ED8 )
{
v135 = (struct cocos2d::CCPoint *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v135);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
GameManager::fadeInMusic(v7, (__int64)&v136[1]);
LOBYTE(v8) = 1;
a1->setKeypadEnabled(a1, v8);
LOBYTE(v9) = 1;
a1->setKeyboardEnabled(a1, v9);
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
v13 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v12);
a1->m_messageThreads = v13;
cocos2d::CCObject::retain(v13);
v14 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret01");
v15 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v14->m_reportedAchievements, Block);
v17 = cocos2d::CCString::intValue(v15);
v18 = v151;
if ( v151 > 0xF )
{
v19 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v19);
}
if ( v17 < 100 )
{
v20 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v16, v18);
v20->setTag(v20, 1);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v20, 1);
}
v21 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret02");
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v21->m_reportedAchievements, Block);
v24 = cocos2d::CCString::intValue(v22);
v25 = v151;
if ( v151 > 0xF )
{
v26 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v26 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v26 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v26);
}
if ( v24 < 100 )
{
v27 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v23, v25);
v27->setTag(v27, 2);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v27, 2);
}
v28 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret03");
v29 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v28->m_reportedAchievements, Block);
v31 = cocos2d::CCString::intValue(v29);
v32 = v151;
if ( v151 > 0xF )
{
v33 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v33 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v33 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v33);
}
if ( v31 < 100 )
{
v34 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v30, v32);
v34->setTag(v34, 3);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v34, 3);
}
v35 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret04");
v36 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v35->m_reportedAchievements, Block);
v38 = cocos2d::CCString::intValue(v36);
v39 = v151;
if ( v151 > 0xF )
{
v40 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v40 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v40 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v40);
}
if ( v38 < 100 )
{
v41 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v37, v39);
v41->setTag(v41, 4);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v41, 4);
}
v42 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret05");
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v42->m_reportedAchievements, Block);
v45 = cocos2d::CCString::intValue(v43);
v46 = v151;
if ( v151 > 0xF )
{
v47 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v47 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v47 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v47);
}
if ( v45 < 100 )
{
v48 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v44, v46);
v48->setTag(v48, 5);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v48, 5);
}
v49 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret06");
v50 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v49->m_reportedAchievements, Block);
v52 = cocos2d::CCString::intValue(v50);
v53 = v151;
if ( v151 > 0xF )
{
v54 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v54 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v54 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v54);
}
if ( v52 < 100 )
{
v55 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v51, v53);
v55->setTag(v55, 6);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v55, 6);
}
v56 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v150 = 0;
v151 = 15;
Block[0] = sub_14003AA10(0x20u);
v150 = 24;
v151 = 31;
strcpy((char *)Block[0], "geometry.ach.v3.secret07");
v57 = *(float *)"secret07";
v58 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v56->m_reportedAchievements, Block);
v60 = cocos2d::CCString::intValue(v58);
v61 = v151;
if ( v151 > 0xF )
{
v62 = Block[0];
if ( v151 + 1 >= 0x1000 )
{
v62 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v62 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v62);
}
v150 = 0;
v151 = 15;
LOBYTE(Block[0]) = 0;
if ( v60 < 100 )
{
v63 = (struct cocos2d::CCObject *)cocos2d::CCNode::create(v59, v61);
v63->setTag(v63, 7);
cocos2d::CCDictionary::setObject(a1->m_messageThreads, v63, 7);
}
v64 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v135 = (struct cocos2d::CCPoint *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v135);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v64 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getUGV(v64, "9") )
{
v65 = cocos2d::CCCallFunc::create(a1, SecretLayer4::showFirstDialog);
v57 = 0.80000001;
v66 = cocos2d::CCDelayTime::create(0.80000001);
v67 = cocos2d::CCSequence::create(v66, v65, 0);
cocos2d::CCNode::runAction((CCLightFlash *)a1, (cocos2d::CCPoint)v67, v68, v1, v132);
a1->m_basicMessageIndex = 30;
}
v69 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v70 = v69->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v57, 0.0);
v70->setAnchorPoint(v69, v71);
a1->addChild_0(a1, v69, -3);
((void (__fastcall *)(struct cocos2d::CCSprite *))v69->setScaleX)(v69);
v72 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v69->setScaleY)(v69);
v73 = v69->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v72, -5.0);
v73->setPosition_0(v69, v74);
strcpy((char *)&v134, "K\n");
v69->setColor(&v69->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v134);
cocos2d::CCRect::CCRect(&v148, 0.0, 0.0, 40.0, 40.0);
v75 = cocos2d::CCLabelBMFont::create("Chamber of Time", "goldFont.fnt");
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v75->setScale_0)(v75);
v76 = ((float (__fastcall *)(SecretLayer4 *, struct cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v75);
v77 = v75->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v76, *(float *)v136 * 0.5);
v79 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *, __int64))v77->setPosition_0)(v75, v78);
cocos2d::CCPoint::CCPoint(v79, *(float *)v136 * 0.5);
v80 = cocos2d::CCLabelBMFont::create(" ", (const char *)&qword_14052A4D8);
a1->m_messageLabel = v80;
v81 = ((float (__fastcall *)(SecretLayer4 *, cocos2d::CCLabelBMFont *))a1->addChild_1)(a1, v80);
cocos2d::CCPoint::CCPoint(v81, 0.0);
cocos2d::CCPoint::operator+(&v139, Src);
a1->m_messageLabel->setPosition_0(a1->m_messageLabel, Src);
Message = (_QWORD *)SecretLayer4::getMessage(a1, &v136[1]);
SecretLayer2::updateMessageLabel((__int64)a1, Message);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, &v148);
v84 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v83);
LOBYTE(v85) = 100;
v84->setOpacity(&v84->cocos2d::CCRGBAProtocol, v85);
cocos2d::CCSize::CCSize(&v147, 200.0, 40.0);
v84->setContentSize(v84, &v147);
a1->addChild_0(a1, v84, -2);
v84->setPosition_0(v84, (const cocos2d::CCPoint *)&v139);
v84->setColor(&v84->cocos2d::CCRGBAProtocol, &stru_140529C10);
v87 = CCTextInputNode::create(180.0, 50.0, "...", v86, v133, (const char *)&qword_14052A4D8);
a1->m_searchInput = v87;
a1->addChild_0(a1, v87, 20);
a1->m_searchInput->m_delegate = &a1->TextInputDelegate;
a1->m_searchInput->setPosition_0(a1->m_searchInput, (const cocos2d::CCPoint *)&v139);
m_searchInput = a1->m_searchInput;
m_searchInput->m_maxLabelScale = 0.69999999;
CCTextInputNode::refreshLabel(m_searchInput);
v89 = a1->m_searchInput;
v89->m_maxLabelWidth = 180.0;
CCTextInputNode::refreshLabel(v89);
a1->m_searchInput->m_textField->setVisible(a1->m_searchInput->m_textField, 0);
a1->m_searchInput->m_maxLabelLength = 100;
*(_OWORD *)&Src[1].x = 0;
Size = 0;
v142 = 15;
Src[1] = (struct cocos2d::CCPoint)sub_14003AA10(0x70u);
Size = 97;
v142 = 111;
strcpy(
*(char **)&Src[1],
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~");
v135 = &Src[1];
p_m_allowedChars = &a1->m_searchInput->m_allowedChars;
if ( p_m_allowedChars != (std::string *)&Src[1] )
{
v91 = &Src[1];
if ( v142 > 0xF )
v91 = (struct cocos2d::CCPoint *)Src[1];
sub_14003CCE0((void **)p_m_allowedChars, v91, Size);
}
sub_14003A830((__int64)&Src[1]);
SecretLayer2::updateSearchLabel((__int64)a1, byte_140518980);
v92 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v93 = CCMenuItemSpriteExtra::create(v92, nullptr, a1, (cocos2d::SEL_MenuHandler *)SecretLayer4::onBack);
HIDWORD(v93->m_pfnSelector.adj) = 1069547520;
v94 = cocos2d::CCMenu::create(v93, 0);
a1->addChild_0(a1, v94, 1);
v95 = v94->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v97 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v96);
cocos2d::CCDirector::getScreenTop(v97);
v99 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v98);
v100 = cocos2d::CCDirector::getScreenLeft(v99) + 24.0;
cocos2d::CCPoint::CCPoint(v100, v100);
v95->setPosition_0(v94, v101);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v102) + 197) )
GameToolbox::addBackButton(a1, v93);
v105 = (cocos2d::CCNode *)cocos2d::CCNode::create(v104, v103);
v106 = v105->__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v135, 80.0, 80.0);
v106->setContentSize(v105, v107);
v108 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock3_001.png");
v109 = ((float (__fastcall *)(cocos2d::CCNode *, struct cocos2d::CCSprite *))v105->addChild_1)(v105, v108);
v110 = v108->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v109, 40.0);
v110->setPosition_0(v108, v111);
v112 = CCMenuItemSpriteExtra::create(v105, nullptr, a1, (cocos2d::SEL_MenuHandler *)SecretLayer4::onSubmit);
a1->m_submitButton = v112;
v113 = ((float (__fastcall *)(struct cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v94->addChild_1)(v94, v112);
v114 = a1->m_submitButton->__vftable;
cocos2d::CCPoint::CCPoint(v113, *(float *)v136 * 0.5);
v115 = cocos2d::CCNode::convertToNodeSpace(v94, Src);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v114->setPosition_0)(
a1->m_submitButton,
v115);
HIDWORD(a1->m_submitButton->m_pfnSelector.adj) = 1065353216;
v146 = &v136[1];
*(_OWORD *)&v136[1] = 0;
v137 = 4;
v138 = 15;
strcpy((char *)&v136[1], "0003");
v116 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
Block[0] = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)Block[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v116 = qword_1406C2EE8;
}
if ( !GameStatsManager::isSpecialChestUnlocked(v116, &v136[1]) )
{
v118 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v117);
a1->addChild_0(a1, v118, 10);
Block[0] = &v136[1];
*(_OWORD *)&v136[1] = 0;
v137 = 4;
v138 = 15;
strcpy((char *)&v136[1], "0003");
v146 = &v136[1];
v119 = qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v135 = (struct cocos2d::CCPoint *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v135);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v119 = qword_1406C2EE8;
}
v120 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v119 + 368), &v136[1]);
sub_14003A830((__int64)&v136[1]);
v121 = GJChestSprite::create(*(_DWORD *)(v120 + 64));
GJChestSprite::switchToState(v121, Closed, 0);
((void (__fastcall *)(GJChestSprite *))v121->setScale_0)(v121);
v122 = (void **)CCMenuItemSpriteExtra::create(
v121,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)SecretLayer4::onChest01);
v143[15] = 0;
v144 = 14;
v145 = 15;
strcpy(v143, "chestClick.ogg");
Block[0] = v143;
if ( v122 + 56 != (void **)v143 )
sub_14003CCE0(v122 + 56, v143, 0xEu);
sub_14003A830((__int64)v143);
v123 = (void (__fastcall **)(void **, _QWORD))*v122;
v124 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)Block, 60.000004, 48.0);
v123[37](v122, v125);
v126 = v121->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
(*((__int64 (__fastcall **)(void **))*v122 + 38))(v122);
v127 = (float *)(*((__int64 (__fastcall **)(void **))*v122 + 38))(v122);
cocos2d::CCPoint::CCPoint(*(float *)&v124, *v127 * 0.5);
v126->setPosition_0(v121, v128);
v129 = ((float (__fastcall *)(cocos2d::CCNode *, void **))v118->addChild_1)(v118, v122);
v130 = (void (__fastcall **)(void **, struct cocos2d::CCPoint))*v122;
cocos2d::CCPoint::CCPoint(v129, *(float *)v136 - 60.0);
v131 = cocos2d::CCNode::convertToNodeSpace(v118, (const struct cocos2d::CCPoint *)&v146);
v130[23](v122, v131);
}
return 1;
}
return result;
}