//
// SecretLayer::init from 0x905c20 to 0x906738 (2840 bytes)
//
// 3 xrefs:
// > SecretLayer::create @ 0x9067e0
// > ??> @ 0x69ba0
// > ??> @ 0x11a7ac0
//
// 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 SecretLayer::init(SecretLayer *a1)
{
bool v2; // w25
GameManager *v4; // x21
void *v5; // x0
cocos2d::CCDirector *v6; // x0
cocos2d::CCDictionary *v7; // x0
AchievementManager *v8; // x0
cocos2d::CCDictionary *v9; // x21
cocos2d::CCNode *v10; // x0
AchievementManager *v11; // x0
cocos2d::CCDictionary *v12; // x21
cocos2d::CCNode *v13; // x0
AchievementManager *v14; // x0
cocos2d::CCDictionary *v15; // x21
cocos2d::CCNode *v16; // x0
AchievementManager *v17; // x0
cocos2d::CCDictionary *v18; // x21
cocos2d::CCNode *v19; // x0
AchievementManager *v20; // x0
cocos2d::CCDictionary *v21; // x21
cocos2d::CCNode *v22; // x0
AchievementManager *v23; // x0
cocos2d::CCDictionary *v24; // x21
cocos2d::CCNode *v25; // x0
AchievementManager *v26; // x0
cocos2d::CCDictionary *v27; // x21
cocos2d::CCNode *v28; // x0
AchievementManager *v29; // x0
AchievementManager *v30; // x0
AchievementManager *v31; // x0
AchievementManager *v32; // x0
AchievementManager *v33; // x0
const char *v34; // x1
cocos2d::CCNode *v35; // x21
int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // x2
cocos2d::CCLabelBMFont *v37; // x21
cocos2d::CCLabelBMFont *v38; // x0
SecretLayer_vtbl *v39; // x2
cocos2d::CCLabelBMFont *m_messageLabel; // x21
void *v41; // x0
cocos2d::CCNode *v42; // x21
CCTextInputNode *v43; // x0
CCTextInputNode *m_searchInput; // x21
void *v45; // x0
cocos2d::CCSprite *v46; // x0
CCMenuItemSpriteExtra *v47; // x24
cocos2d::CCNode *v48; // x21
void (__fastcall *v49)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCDirector *v50; // x0
float v51; // s0
float v52; // s9
cocos2d::CCDirector *v53; // x0
float v54; // s0
cocos2d::CCSprite *v55; // x0
CCMenuItemSpriteExtra *v56; // x0
cocos2d::CCNode_vtbl *v57; // x2
CCMenuItemSpriteExtra *m_submitButton; // x24
void (__fastcall *v59)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCDictionary *m_messageThreads; // x21
cocos2d::CCNode *v61; // x0
GameManager *v62; // x0
cocos2d::CCDictionary *v63; // x21
cocos2d::CCNode *v64; // x0
cocos2d::CCDictionary *v65; // x21
cocos2d::CCNode *v66; // x0
cocos2d::CCDictionary *v67; // x21
cocos2d::CCNode *v68; // x0
cocos2d::CCDictionary *v69; // x21
cocos2d::CCNode *v70; // x0
cocos2d::CCDictionary *v71; // x21
cocos2d::CCNode *v72; // x0
cocos2d::CCDictionary *v73; // x21
cocos2d::CCNode *v74; // x0
cocos2d::CCDictionary *v75; // x21
cocos2d::CCNode *v76; // x0
cocos2d::CCDictionary *v77; // x21
cocos2d::CCNode *v78; // x0
cocos2d::CCDictionary *v79; // x21
cocos2d::CCNode *v80; // x0
cocos2d::CCDictionary *v81; // x21
cocos2d::CCNode *v82; // x0
cocos2d::CCDictionary *v83; // x21
cocos2d::CCNode *v84; // x0
unsigned int *v85; // x1
int v86; // w2
unsigned int *v87; // x1
int v88; // w2
unsigned int *v89; // x21
int v90; // w1
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+88h] [xbp+88h]
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+88h] [xbp+88h]
void (__fastcall *v93)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+88h] [xbp+88h]
void (__fastcall *v94)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+88h] [xbp+88h]
float v95; // [xsp+98h] [xbp+98h]
float v96; // [xsp+9Ch] [xbp+9Ch]
cocos2d::CCPoint v97; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCSize v98; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v99; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCRect v100; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCRect v101; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v102; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v103; // 0:x2.16
cocos2d::SEL_MenuHandler v104; // 0:x2.16
cocos2d::CCRect v105; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v2 = cocos2d::CCLayer::init(a1);
if ( v2 )
{
v4 = GameManager::sharedState();
sub_D153B8((int)&v101, "secretLoop.mp3");
GameManager::fadeInMusic((__int64)v4, &v101);
v5 = (void *)(*(_QWORD *)&v101.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v101.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v85 = (unsigned int *)(*(_QWORD *)&v101.origin - 8LL);
do
v86 = __ldaxr(v85);
while ( __stlxr(v86 - 1, v85) );
}
else
{
v86 = *(_DWORD *)(*(_QWORD *)&v101.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v101.origin - 8LL) = v86 - 1;
}
if ( v86 <= 0 )
operator delete(v5);
}
a1->setKeypadEnabled(a1, 1);
a1->setKeyboardEnabled(a1, 1);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
v7 = cocos2d::CCDictionary::create();
a1->m_messageThreads = v7;
cocos2d::CCObject::retain(v7);
v8 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v8, "geometry.ach.secret06") )
{
m_messageThreads = a1->m_messageThreads;
v61 = SecretLayer::nodeWithTag(a1, 6);
cocos2d::CCDictionary::setObject(m_messageThreads, v61, 6);
}
v9 = a1->m_messageThreads;
v10 = SecretLayer::nodeWithTag(a1, 101);
cocos2d::CCDictionary::setObject(v9, v10, 101);
v11 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v11, "geometry.ach.secret07") )
{
v83 = a1->m_messageThreads;
v84 = SecretLayer::nodeWithTag(a1, 7);
cocos2d::CCDictionary::setObject(v83, v84, 7);
}
v12 = a1->m_messageThreads;
v13 = SecretLayer::nodeWithTag(a1, 102);
cocos2d::CCDictionary::setObject(v12, v13, 102);
v14 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v14, "geometry.ach.secret08") )
{
v81 = a1->m_messageThreads;
v82 = SecretLayer::nodeWithTag(a1, 8);
cocos2d::CCDictionary::setObject(v81, v82, 8);
}
v15 = a1->m_messageThreads;
v16 = SecretLayer::nodeWithTag(a1, 103);
cocos2d::CCDictionary::setObject(v15, v16, 103);
v17 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v17, "geometry.ach.secret09") )
{
v79 = a1->m_messageThreads;
v80 = SecretLayer::nodeWithTag(a1, 9);
cocos2d::CCDictionary::setObject(v79, v80, 9);
}
v18 = a1->m_messageThreads;
v19 = SecretLayer::nodeWithTag(a1, 104);
cocos2d::CCDictionary::setObject(v18, v19, 104);
v20 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v20, "geometry.ach.secret10") )
{
v77 = a1->m_messageThreads;
v78 = SecretLayer::nodeWithTag(a1, 10);
cocos2d::CCDictionary::setObject(v77, v78, 10);
}
v21 = a1->m_messageThreads;
v22 = SecretLayer::nodeWithTag(a1, 105);
cocos2d::CCDictionary::setObject(v21, v22, 105);
v23 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v23, "geometry.ach.secret13") )
{
v75 = a1->m_messageThreads;
v76 = SecretLayer::nodeWithTag(a1, 13);
cocos2d::CCDictionary::setObject(v75, v76, 13);
}
v24 = a1->m_messageThreads;
v25 = SecretLayer::nodeWithTag(a1, 120);
cocos2d::CCDictionary::setObject(v24, v25, 120);
v26 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v26, "geometry.ach.secret14") )
{
v73 = a1->m_messageThreads;
v74 = SecretLayer::nodeWithTag(a1, 14);
cocos2d::CCDictionary::setObject(v73, v74, 14);
}
v27 = a1->m_messageThreads;
v28 = SecretLayer::nodeWithTag(a1, 121);
cocos2d::CCDictionary::setObject(v27, v28, 121);
v29 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v29, "geometry.ach.secret15") )
{
v71 = a1->m_messageThreads;
v72 = SecretLayer::nodeWithTag(a1, 15);
cocos2d::CCDictionary::setObject(v71, v72, 15);
}
v30 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v30, "geometry.ach.secret16") )
{
v69 = a1->m_messageThreads;
v70 = SecretLayer::nodeWithTag(a1, 16);
cocos2d::CCDictionary::setObject(v69, v70, 16);
}
v31 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v31, "geometry.ach.secret17") )
{
v67 = a1->m_messageThreads;
v68 = SecretLayer::nodeWithTag(a1, 17);
cocos2d::CCDictionary::setObject(v67, v68, 17);
}
v32 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v32, "geometry.ach.secret19") )
{
v65 = a1->m_messageThreads;
v66 = SecretLayer::nodeWithTag(a1, 19);
cocos2d::CCDictionary::setObject(v65, v66, 19);
}
v33 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v33, "geometry.ach.v2.secret03") )
{
v62 = GameManager::sharedState();
if ( GameManager::getUGV(v62, &byte_F78BA8) )
{
v63 = a1->m_messageThreads;
v64 = SecretLayer::nodeWithTag(a1, 11);
cocos2d::CCDictionary::setObject(v63, v64, 11);
}
}
v35 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_gradientBG.png", v34);
setAnchorPoint = v35->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v101.origin, 0.0, 0.0);
setAnchorPoint(v35, &v101.origin);
a1->addChild_0(a1, v35, -3);
v35->setScaleX(v35, (float)(v95 + 10.0) / v35[1].m_obContentSize.height);
v35->setScaleY(v35, (float)(v96 + 10.0) / v35[1].m_sAdditionalTransform.a);
setPosition = v35->setPosition;
cocos2d::CCPoint::CCPoint(&v101.origin, -5.0, -5.0);
setPosition(v35, &v101.origin);
getTag = v35->__vftable[1].getTag;
LOWORD(v101.origin.x) = 19200;
BYTE2(v101.origin.x) = 100;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))getTag)(v35, &v101);
cocos2d::CCRect::CCRect(&v100, 0.0, 0.0, 40.0, 40.0);
v37 = cocos2d::CCLabelBMFont::create();
v37->setScale(v37, 1.0);
a1->addChild(a1, v37);
v93 = v37->setPosition;
cocos2d::CCPoint::CCPoint(&v101.origin, v95 * 0.5, v96 - 24.0);
v93(v37, &v101.origin);
cocos2d::CCPoint::CCPoint(&v97, v95 * 0.5, (float)(v96 * 0.5) + 50.0);
v38 = cocos2d::CCLabelBMFont::create();
v39 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_messageLabel = v38;
((void (__fastcall *)(SecretLayer *))v39->addChild)(a1);
m_messageLabel = a1->m_messageLabel;
v94 = m_messageLabel->setPosition;
cocos2d::CCPoint::CCPoint(&v99, 0.0, 43.0);
cocos2d::CCPoint::operator+(&v101, &v97, &v99);
v94(m_messageLabel, &v101.origin);
SecretLayer::getMessage(a1, (__int64)&v101);
SecretLayer::updateMessageLabel((__int64)a1, &v101);
v41 = (void *)(*(_QWORD *)&v101.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v101.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v87 = (unsigned int *)(*(_QWORD *)&v101.origin - 8LL);
do
v88 = __ldaxr(v87);
while ( __stlxr(v88 - 1, v87) );
}
else
{
v88 = *(_DWORD *)(*(_QWORD *)&v101.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v101.origin - 8LL) = v88 - 1;
}
if ( v88 <= 0 )
operator delete(v41);
}
cocos2d::CCRect::CCRect(&v101, &v100);
v42 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02b_small.png",
(const char *)&v101,
v105);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v42->__vftable[1].~CCNode_0)(v42, 100);
cocos2d::CCSize::CCSize(&v98, 200.0, 40.0);
v42->setContentSize(v42, &v98);
a1->addChild_0(a1, v42, -2);
v42->setPosition(v42, &v97);
((void (__fastcall *)(cocos2d::CCNode *, void *))v42->__vftable[1].getTag)(v42, &unk_EF1C38);
v43 = CCTextInputNode::create(180.0, 50.0, "...", "Thonburi");
a1->m_searchInput = v43;
a1->addChild_0(a1, v43, 20);
a1->m_searchInput->m_delegate = &a1->TextInputDelegate;
a1->m_searchInput->setPosition(a1->m_searchInput, &v97);
CCTextInputNode::setMaxLabelScale(a1->m_searchInput, 0.7);
CCTextInputNode::setMaxLabelWidth(a1->m_searchInput, 180.0);
a1->m_searchInput->m_textField->setVisible(a1->m_searchInput->m_textField, 0);
m_searchInput = a1->m_searchInput;
m_searchInput->m_maxLabelLength = 20;
sub_D153B8((int)&v101, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
CCTextInputNode::setAllowedChars((__int64)m_searchInput, (__int64)&v101);
v45 = (void *)(*(_QWORD *)&v101.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v101.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v89 = (unsigned int *)(*(_QWORD *)&v101.origin - 8LL);
do
v90 = __ldaxr(v89);
while ( __stlxr(v90 - 1, v89) );
}
else
{
v90 = *(_DWORD *)(*(_QWORD *)&v101.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v101.origin - 8LL) = v90 - 1;
}
if ( v90 <= 0 )
operator delete(v45);
}
SecretLayer::updateSearchLabel(a1, &byte_F288A0);
v46 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v103.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v103.adj = (size_t)SecretLayer::onBack;
v47 = CCMenuItemSpriteExtra::create(v46, nullptr, v103);
CCMenuItemSpriteExtra::setSizeMult(v47, 1.5);
v48 = (cocos2d::CCNode *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v47, nullptr);
a1->addChild_0(a1, v48, 1);
v49 = v48->setPosition;
v50 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenLeft(v50);
v52 = v51;
v53 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenTop(v53);
cocos2d::CCPoint::CCPoint(&v101.origin, v52 + 24.0, v54 - 23.0);
v49(v48, &v101.origin);
if ( PlatformToolbox::isControllerConnected() )
GameToolbox::addBackButton(a1, v47);
v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock_001.png");
v104.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v104.adj = (size_t)SecretLayer::onSubmit;
v56 = CCMenuItemSpriteExtra::create(v55, nullptr, v104);
v57 = v48->__vftable;
a1->m_submitButton = v56;
((void (__fastcall *)(cocos2d::CCNode *))v57->addChild)(v48);
m_submitButton = a1->m_submitButton;
v59 = m_submitButton->setPosition;
cocos2d::CCPoint::CCPoint(&v99, v95 * 0.5, (float)(v96 * 0.5) + -20.0);
v102 = cocos2d::CCNode::convertToNodeSpace(v48, &v99);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *, float, float))v59)(
m_submitButton,
&v101,
v102.x,
v102.y);
CCMenuItemSpriteExtra::setSizeMult(a1->m_submitButton, 0.7);
}
return v2;
}