//
// SecretLayer::init from 0x1003bd0ec to 0x1003bdac4 (2520 bytes)
//
// 2 xrefs:
// > SecretLayer::create @ 0x1003bd0a0
// > ??> @ 0x1008112a8
//
// 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 __fastcall SecretLayer::init(SecretLayer *a1)
{
_BOOL4 v2; // w19
GameManager *v3; // x21
cocos2d::CCDirector *v4; // x0
cocos2d::CCDictionary *v5; // x0
AchievementManager *v6; // x0
cocos2d::CCDictionary *m_messageThreads; // x21
cocos2d::CCNode *v8; // x22
cocos2d::CCDictionary *v9; // x21
cocos2d::CCNode *v10; // x22
AchievementManager *v11; // x0
cocos2d::CCDictionary *v12; // x21
cocos2d::CCNode *v13; // x22
cocos2d::CCDictionary *v14; // x21
cocos2d::CCNode *v15; // x22
AchievementManager *v16; // x0
cocos2d::CCDictionary *v17; // x21
cocos2d::CCNode *v18; // x22
cocos2d::CCDictionary *v19; // x21
cocos2d::CCNode *v20; // x22
AchievementManager *v21; // x0
cocos2d::CCDictionary *v22; // x21
cocos2d::CCNode *v23; // x22
cocos2d::CCDictionary *v24; // x21
cocos2d::CCNode *v25; // x22
AchievementManager *v26; // x0
cocos2d::CCDictionary *v27; // x21
cocos2d::CCNode *v28; // x22
cocos2d::CCDictionary *v29; // x21
cocos2d::CCNode *v30; // x22
AchievementManager *v31; // x0
cocos2d::CCDictionary *v32; // x21
cocos2d::CCNode *v33; // x22
cocos2d::CCDictionary *v34; // x21
cocos2d::CCNode *v35; // x22
AchievementManager *v36; // x0
cocos2d::CCDictionary *v37; // x21
cocos2d::CCNode *v38; // x22
cocos2d::CCDictionary *v39; // x21
cocos2d::CCNode *v40; // x22
AchievementManager *v41; // x0
cocos2d::CCDictionary *v42; // x21
cocos2d::CCNode *v43; // x22
AchievementManager *v44; // x0
cocos2d::CCDictionary *v45; // x21
cocos2d::CCNode *v46; // x22
AchievementManager *v47; // x0
cocos2d::CCDictionary *v48; // x21
cocos2d::CCNode *v49; // x22
AchievementManager *v50; // x0
cocos2d::CCDictionary *v51; // x21
cocos2d::CCNode *v52; // x22
AchievementManager *v53; // x0
GameManager *v54; // x0
cocos2d::CCDictionary *v55; // x21
cocos2d::CCNode *v56; // x22
cocos2d::CCSprite *v57; // x21
__n128 v58; // q0
__n128 v59; // q1
__n128 v60; // q0
__n128 v61; // q1
cocos2d::CCLabelBMFont *v62; // x21
__n128 v63; // q0
__n128 v64; // q1
__n128 v65; // q0
__n128 v66; // q1
cocos2d::CCLabelBMFont *v67; // x0
__n128 v68; // q0
cocos2d::CCLabelBMFont *m_messageLabel; // x21
__n128 v70; // q1
double v71; // d0
double v72; // d0
cocos2d::extension::CCScale9Sprite *v73; // x21
CCTextInputNode *v74; // x0
CCTextInputNode *m_searchInput; // x0
CCTextInputNode *v76; // x21
cocos2d::CCSprite *v77; // x0
CCMenuItemSpriteExtra *v78; // x22
__int64 v79; // x1
__int64 v80; // x2
__int64 v81; // x3
__int64 v82; // x4
__int64 v83; // x5
__int64 v84; // x6
__int64 v85; // x7
cocos2d::CCMenu *v86; // x21
cocos2d::CCDirector *v87; // x0
float v88; // s9
cocos2d::CCDirector *v89; // x0
__n128 v90; // q1
__n128 v91; // q0
cocos2d::CCSprite *v92; // x0
CCMenuItemSpriteExtra *v93; // x0
__n128 v94; // q0
CCMenuItemSpriteExtra *m_submitButton; // x22
__n128 v96; // q1
float v98; // s1
float v99; // s2
float v100; // s3
cocos2d::CCPoint v101; // [xsp+8h] [xbp-B8h] BYREF
std::string v102; // [xsp+10h] [xbp-B0h] BYREF
float32x2_t v103[2]; // [xsp+28h] [xbp-98h] BYREF
void *__p[2]; // [xsp+38h] [xbp-88h] BYREF
char v105; // [xsp+4Fh] [xbp-71h]
float32x2_t v106; // [xsp+50h] [xbp-70h] BYREF
float32x2_t v107; // [xsp+58h] [xbp-68h] BYREF
float v108[4]; // [xsp+60h] [xbp-60h] BYREF
float v109; // [xsp+70h] [xbp-50h]
float v110; // [xsp+74h] [xbp-4Ch]
void *v111[2]; // [xsp+78h] [xbp-48h] BYREF
char v112; // [xsp+8Fh] [xbp-31h]
cocos2d::CCPoint v113; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v114; // 0:x3.16
cocos2d::SEL_MenuHandler v115; // 0:x3.16
cocos2d::CCRect v116; // 0:kr10_16.16
v2 = cocos2d::CCLayer::init(a1);
if ( v2 )
{
v3 = GameManager::sharedState();
sub_100009900(v111, "secretLoop.mp3");
GameManager::fadeInMusic((__int64)v3, (__int64)v111);
if ( v112 < 0 )
operator delete(v111[0]);
((void (__fastcall *)(SecretLayer *, __int64))a1->setKeypadEnabled)(a1, 1);
((void (__fastcall *)(SecretLayer *, __int64))a1->setKeyboardEnabled)(a1, 1);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v4);
v5 = cocos2d::CCDictionary::create();
a1->m_messageThreads = v5;
cocos2d::CCObject::retain(v5);
v6 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v6, "geometry.ach.secret06") )
{
m_messageThreads = a1->m_messageThreads;
v8 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v8->setTag)(v8, 6);
cocos2d::CCDictionary::setObject(m_messageThreads, v8, 6);
}
v9 = a1->m_messageThreads;
v10 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v10->setTag)(v10, 101);
cocos2d::CCDictionary::setObject(v9, v10, 101);
v11 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v11, "geometry.ach.secret07") )
{
v12 = a1->m_messageThreads;
v13 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v13->setTag)(v13, 7);
cocos2d::CCDictionary::setObject(v12, v13, 7);
}
v14 = a1->m_messageThreads;
v15 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v15->setTag)(v15, 102);
cocos2d::CCDictionary::setObject(v14, v15, 102);
v16 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v16, "geometry.ach.secret08") )
{
v17 = a1->m_messageThreads;
v18 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v18->setTag)(v18, 8);
cocos2d::CCDictionary::setObject(v17, v18, 8);
}
v19 = a1->m_messageThreads;
v20 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v20->setTag)(v20, 103);
cocos2d::CCDictionary::setObject(v19, v20, 103);
v21 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v21, "geometry.ach.secret09") )
{
v22 = a1->m_messageThreads;
v23 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v23->setTag)(v23, 9);
cocos2d::CCDictionary::setObject(v22, v23, 9);
}
v24 = a1->m_messageThreads;
v25 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v25->setTag)(v25, 104);
cocos2d::CCDictionary::setObject(v24, v25, 104);
v26 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v26, "geometry.ach.secret10") )
{
v27 = a1->m_messageThreads;
v28 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v28->setTag)(v28, 10);
cocos2d::CCDictionary::setObject(v27, v28, 10);
}
v29 = a1->m_messageThreads;
v30 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v30->setTag)(v30, 105);
cocos2d::CCDictionary::setObject(v29, v30, 105);
v31 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v31, "geometry.ach.secret13") )
{
v32 = a1->m_messageThreads;
v33 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v33->setTag)(v33, 13);
cocos2d::CCDictionary::setObject(v32, v33, 13);
}
v34 = a1->m_messageThreads;
v35 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v35->setTag)(v35, 120);
cocos2d::CCDictionary::setObject(v34, v35, 120);
v36 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v36, "geometry.ach.secret14") )
{
v37 = a1->m_messageThreads;
v38 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v38->setTag)(v38, 14);
cocos2d::CCDictionary::setObject(v37, v38, 14);
}
v39 = a1->m_messageThreads;
v40 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v40->setTag)(v40, 121);
cocos2d::CCDictionary::setObject(v39, v40, 121);
v41 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v41, "geometry.ach.secret15") )
{
v42 = a1->m_messageThreads;
v43 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v43->setTag)(v43, 15);
cocos2d::CCDictionary::setObject(v42, v43, 15);
}
v44 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v44, "geometry.ach.secret16") )
{
v45 = a1->m_messageThreads;
v46 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v46->setTag)(v46, 16);
cocos2d::CCDictionary::setObject(v45, v46, 16);
}
v47 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v47, "geometry.ach.secret17") )
{
v48 = a1->m_messageThreads;
v49 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v49->setTag)(v49, 17);
cocos2d::CCDictionary::setObject(v48, v49, 17);
}
v50 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v50, "geometry.ach.secret19") )
{
v51 = a1->m_messageThreads;
v52 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v52->setTag)(v52, 19);
cocos2d::CCDictionary::setObject(v51, v52, 19);
}
v53 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v53, "geometry.ach.v2.secret03") )
{
v54 = GameManager::sharedState();
if ( GameManager::getUGV(v54, "2") )
{
v55 = a1->m_messageThreads;
v56 = cocos2d::CCNode::create();
((void (__fastcall *)(cocos2d::CCNode *, __int64))v56->setTag)(v56, 11);
cocos2d::CCDictionary::setObject(v55, v56, 11);
}
}
v57 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v58.n128_u32[0] = 0;
v59.n128_u32[0] = 0;
sub_100022980(v58, v59, v108);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v57->setAnchorPoint)(v57, v108);
((void (__fastcall *)(SecretLayer *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v57, 4294967293LL);
((void (__fastcall *)(cocos2d::CCSprite *, float))v57->setScaleX)(
v57,
(float)(v109 + 10.0) / v57->m_obRect.size.width);
v60 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float))v57->setScaleY)(
v57,
(float)(v110 + 10.0) / v57->m_obRect.size.height);
v60.n128_u32[0] = -5.0;
v61.n128_u32[0] = -5.0;
sub_100022980(v60, v61, v108);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v57->setPosition)(v57, v108);
BYTE2(v108[0]) = 100;
LOWORD(v108[0]) = 19200;
((void (__fastcall *)(cocos2d::CCSprite *, float *))v57->setColor)(v57, v108);
sub_100022990(v108, 0.0, 0.0, 40.0, 40.0);
v62 = cocos2d::CCLabelBMFont::create_1("The Vault", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v62->setScale)(v62, 1.0);
v63 = ((__n128 (__fastcall *)(SecretLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v62);
v63.n128_f32[0] = v109 * 0.5;
v64.n128_f32[0] = v110 + -24.0;
sub_100022980(v63, v64, v103);
v65 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v62->setPosition)(v62, v103);
v65.n128_f32[0] = v109 * 0.5;
v66.n128_f32[0] = (float)(v110 * 0.5) + 50.0;
sub_100022980(v65, v66, &v107);
v67 = cocos2d::CCLabelBMFont::create_1(" ", "bigFont.fnt");
a1->m_messageLabel = v67;
v68 = ((__n128 (__fastcall *)(SecretLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v67);
m_messageLabel = a1->m_messageLabel;
v70.n128_u32[0] = 1110179840;
v68.n128_u32[0] = 0;
sub_100022980(v68, v70, &v106);
*(float32x2_t *)&v71 = sub_1000229DC(&v107, &v106, v103);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))m_messageLabel->setPosition)(
m_messageLabel,
v103,
v71);
SecretLayer::getMessage(__p, a1);
SecretLayer::updateMessageLabel(a1, __p);
if ( v105 < 0 )
operator delete(__p[0]);
v72 = sub_100022B98(v103, (__int64)v108);
v116.origin.x = *(float *)&v72;
v116.origin.y = v98;
v116.size.width = v99;
v116.size.height = v100;
v73 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v116);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v73->setOpacity)(v73, 100);
sub_100022988((float *)v103, 200.0, 40.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, float32x2_t *))v73->setContentSize)(v73, v103);
((void (__fastcall *)(SecretLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->addChild_0)(
a1,
v73,
4294967294LL);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, float32x2_t *))v73->setPosition)(v73, &v107);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, void *))v73->setColor)(v73, &unk_100646228);
v74 = CCTextInputNode::create(180.0, 50.0, "...", "Thonburi", 24, "bigFont.fnt");
a1->m_searchInput = v74;
((void (__fastcall *)(SecretLayer *, CCTextInputNode *, __int64))a1->addChild_0)(a1, v74, 20);
m_searchInput = a1->m_searchInput;
m_searchInput->m_delegate = &a1->TextInputDelegate;
((void (__fastcall *)(CCTextInputNode *, float32x2_t *))m_searchInput->setPosition)(m_searchInput, &v107);
CCTextInputNode::setMaxLabelScale(a1->m_searchInput, 0.7);
CCTextInputNode::setMaxLabelWidth(a1->m_searchInput, 180.0);
((void (__fastcall *)(cocos2d::CCTextFieldTTF *, _QWORD))a1->m_searchInput->m_textField->setVisible)(
a1->m_searchInput->m_textField,
0);
v76 = a1->m_searchInput;
v76->m_maxLabelLength = 20;
sub_100009900(&v102, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
CCTextInputNode::setAllowedChars((std::string *)v76, &v102);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
SecretLayer::updateSearchLabel(a1, "");
v77 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v114.ptr = (void (__cdecl *)(cocos2d::CCObject *))SecretLayer::onBack;
v114.adj = 0;
v78 = CCMenuItemSpriteExtra::create(v77, nullptr, a1, v114);
CCMenuItemSpriteExtra::setSizeMult(v78, 1.5);
v86 = sub_1001D7ED0(v78, v79, v80, v81, v82, v83, v84, v85, 0);
((void (__fastcall *)(SecretLayer *, cocos2d::CCMenu *, __int64))a1->addChild_0)(a1, v86, 1);
v87 = cocos2d::CCDirector::sharedDirector();
v88 = sub_1001768D8((__int64)v87) + 24.0;
v89 = cocos2d::CCDirector::sharedDirector();
v90.n128_f32[0] = sub_1001768C8((__int64)v89) + -23.0;
v91.n128_f32[0] = v88;
sub_100022980(v91, v90, &v106);
((void (__fastcall *)(cocos2d::CCMenu *, float32x2_t *))v86->setPosition)(v86, &v106);
if ( PlatformToolbox::isControllerConnected() )
GameToolbox::addBackButton(a1, v78);
v92 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_secretLock_001.png");
v115.ptr = (void (__cdecl *)(cocos2d::CCObject *))SecretLayer::onSubmit;
v115.adj = 0;
v93 = CCMenuItemSpriteExtra::create(v92, nullptr, a1, v115);
a1->m_submitButton = v93;
v94 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v86->addChild)(v86, v93);
m_submitButton = a1->m_submitButton;
v94.n128_f32[0] = v109 * 0.5;
v96.n128_f32[0] = (float)(v110 * 0.5) + -20.0;
sub_100022980(v94, v96, &v101);
v113 = cocos2d::CCNode::convertToNodeSpace(v86, &v101);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))m_submitButton->setPosition)(
m_submitButton,
&v106,
v113.x,
v113.y);
CCMenuItemSpriteExtra::setSizeMult(a1->m_submitButton, 0.7);
}
return v2;
}