// // CreatorLayer::init from 0x3ab2d8 to 0x3abbf2 (2330 bytes) // // 1 xrefs: // > CreatorLayer::create @ 0x3aafbc // // 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 CreatorLayer::init(CreatorLayer *a1) { GameManager *v2; // r0 void (__fastcall *setKeypadEnabled)(cocos2d::CCLayer *__hidden, bool); // r3 cocos2d::CCDirector *v4; // r0 const char *v5; // r1 cocos2d::CCNode *v6; // r4 void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // r3 cocos2d::CCMenu *v10; // r10 cocos2d::CCSprite *v11; // r0 float v12; // s15 void (**v13)(CreatorLayer *, cocos2d::CCObject *); // kr00_4 void (**v14)(CreatorLayer *, cocos2d::CCObject *); // r3 void (*v15)(CreatorLayer *, cocos2d::CCObject *); // r3 CCSpriteGrayscale *v16; // r11 void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // r2 int v18; // r4 int v19; // r8 CCMenuItemSpriteExtra *v20; // r9 float v21; // r0 GameManager *v22; // r0 cocos2d::CCSprite *v23; // r4 void (__fastcall *v24)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 void (__fastcall *v25)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 cocos2d::CCDirector *v26; // r0 float v27; // s16 cocos2d::CCDirector *v28; // r0 float v29; // r0 cocos2d::CCSprite *v30; // r4 void (__fastcall *v31)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 void (__fastcall *v32)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 cocos2d::CCDirector *v33; // r0 float v34; // s16 cocos2d::CCDirector *v35; // r0 float v36; // r0 cocos2d::CCSprite *v37; // r4 void (__fastcall *v38)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 void (__fastcall *v39)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9 cocos2d::CCDirector *v40; // r0 float v41; // s16 cocos2d::CCDirector *v42; // r0 float v43; // r0 cocos2d::CCSprite *v44; // r4 void (__fastcall *v45)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8 void (__fastcall *v46)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8 cocos2d::CCDirector *v47; // r0 float v48; // s16 cocos2d::CCDirector *v49; // r0 float v50; // r0 GameStatsManager *v51; // r0 int Stat; // r0 _BOOL4 v53; // r9 const char *v54; // r0 cocos2d::CCSprite *v55; // r0 cocos2d::CCSprite *v56; // r11 CCMenuItemSpriteExtra *v57; // r4 float width; // s17 int v59; // r0 cocos2d::CCSprite *v60; // r9 cocos2d::CCString *v61; // r0 cocos2d::CCLabelBMFont *v62; // r9 void (__fastcall *v63)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11 GameManager *v64; // r0 const char *v65; // r0 cocos2d::CCSprite *v66; // r0 CCMenuItemSpriteExtra *v67; // r0 void (__fastcall *addChild)(cocos2d::CCMenu *__hidden, cocos2d::CCNode *); // r3 CCMenuItemSpriteExtra *v69; // r5 cocos2d::CCSprite *v70; // r0 CCMenuItemSpriteExtra *v71; // r7 cocos2d::CCNode *v72; // r5 void (__fastcall *v73)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 cocos2d::CCDirector *v74; // r0 float v75; // s16 cocos2d::CCDirector *v76; // r0 float v77; // r0 GameManager *v78; // r0 GameLevelManager *v79; // r0 int v81; // [sp+8h] [bp-6Ch] void (__fastcall *v82)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+8h] [bp-6Ch] void (__fastcall *v83)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+8h] [bp-6Ch] _BOOL4 v84; // [sp+Ch] [bp-68h] void (__fastcall *v85)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+10h] [bp-64h] void (__fastcall *v86)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+18h] [bp-5Ch] cocos2d::CCSize v87; // [sp+3Ch] [bp-38h] BYREF cocos2d::CCPoint v88; // [sp+44h] [bp-30h] BYREF cocos2d::CCPoint v89; // [sp+4Ch] [bp-28h] BYREF void (*v90)(CreatorLayer *, cocos2d::CCObject *); // [sp+54h] [bp-20h] int v91; // [sp+58h] [bp-1Ch] cocos2d::CCPoint v92; // [sp+5Ch] [bp-18h] BYREF cocos2d::CCPoint v93; // [sp+64h] [bp-10h] BYREF v84 = cocos2d::CCLayer::init(a1); if ( v84 ) { v2 = GameManager::sharedState(); setKeypadEnabled = a1->setKeypadEnabled; v2->m_currentLevelID = -1; setKeypadEnabled(a1, 1); a1->setKeyboardEnabled(a1, 1); v4 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v87, v4); v6 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_gradientBG.png", v5); setAnchorPoint = v6->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v93, 0.0, 0.0); setAnchorPoint(v6, &v93); a1->addChild_0(a1, v6, -2); ((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v6->setScaleX)(v6, (float)(v87.width + 10.0) / v6[1].m_fSkewX); ((void (__fastcall *)(cocos2d::CCNode *, _DWORD))v6->setScaleY)(v6, (float)(v87.height + 10.0) / v6[1].m_fSkewY); setPosition = v6->setPosition; cocos2d::CCPoint::CCPoint(&v93, -5.0, -5.0); setPosition(v6, &v93); getTag = v6->__vftable[1].getTag; LOWORD(v93.x) = 26112; BYTE2(v93.x) = -1; ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))getTag)(v6, &v93); v10 = cocos2d::CCMenu::create(); a1->addChild(a1, v10); v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_searchBtn_001.png"); v12 = (float)(v87.width - 100.0) / (float)((float)(v11->m_obRect.size.width * 0.8) + 360.0); if ( v12 <= 0.9 ) { v12 = 0.9; } else if ( v12 >= 1.0 ) { v12 = 1.0; } cocos2d::CCPoint::CCPoint(&v93, v87.width * 0.5, v87.height * 0.5); cocos2d::CCNode::convertToNodeSpace(&v88, v10, &v93); v81 = 0; while ( 2 ) { LODWORD(v89.x) = &unk_ACDDA8; switch ( v81 ) { case 1: sub_7753D4((int)&v89, "GJ_savedBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onSavedLevels; goto LABEL_25; case 2: sub_7753D4((int)&v89, "GJ_highscoreBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onLeaderboards; goto LABEL_25; case 3: sub_7753D4((int)&v89, "GJ_challengeBtn_001.png"); v18 = 0; v19 = 1; v91 = 0; v90 = CreatorLayer::onChallenge; goto LABEL_45; case 4: sub_7753D4((int)&v89, "GJ_versusBtn_001.png"); v14 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onMultiplayer; goto LABEL_13; case 5: sub_7753D4((int)&v89, "GJ_mapBtn_001.png"); v14 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onAdventureMap; LABEL_13: v90 = *v14; v91 = 0; sub_776584((int)&v93, (char *)LODWORD(v89.x)); v16 = CCSpriteGrayscale::createWithSpriteFrameName((const char **)&v93); sub_774008(&v93); CCSpriteWithHue::setEvenLuminance(v16, 1.0); setColor = v16->setColor; LOWORD(v93.x) = -20561; BYTE2(v93.x) = -81; setColor(v16, (const cocos2d::ccColor3B *)&v93); v18 = 0; v19 = 0; goto LABEL_26; case 6: sub_7753D4((int)&v89, "GJ_dailyBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onDailyLevel; goto LABEL_25; case 7: sub_7753D4((int)&v89, "GJ_weeklyBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onWeeklyLevel; goto LABEL_25; case 8: sub_7753D4((int)&v89, "GJ_eventBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onEventLevel; goto LABEL_25; case 9: sub_7753D4((int)&v89, "GJ_gauntletsBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onGauntlets; goto LABEL_25; case 10: sub_7753D4((int)&v89, "GJ_featuredBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onFeaturedLevels; goto LABEL_25; case 11: sub_7753D4((int)&v89, "GJ_listsBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onTopLists; goto LABEL_25; case 12: sub_7753D4((int)&v89, "GJ_pathsBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onPaths; goto LABEL_25; case 13: sub_7753D4((int)&v89, "GJ_mapPacksBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onMapPacks; goto LABEL_25; case 14: sub_7753D4((int)&v89, "GJ_searchBtn_001.png"); v18 = 1; v90 = CreatorLayer::onOnlineLevels; v19 = 0; v91 = 0; goto LABEL_45; default: sub_7753D4((int)&v89, "GJ_createBtn_001.png"); v13 = (void (**)(CreatorLayer *, cocos2d::CCObject *))&CreatorLayer::onMyLevels; LABEL_25: v15 = *v13; v18 = 0; v19 = 0; v91 = 0; v90 = v15; LABEL_45: v16 = (CCSpriteGrayscale *)cocos2d::CCSprite::createWithSpriteFrameName((const char *)LODWORD(v89.x)); LABEL_26: ((void (__fastcall *)(CCSpriteGrayscale *, _DWORD))v16->setScale)(v16, v12 * 0.8); v20 = CCMenuItemSpriteExtra::create( v16, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__((unsigned int)v90, (unsigned int)a1)); v10->addChild(v10, v20); v86 = v20->setPosition; v21 = floorf((float)v81 / 5.0); cocos2d::CCPoint::CCPoint( &v92, (float)((float)((float)(v81 % 5) - 1.5) * (float)(v12 * 90.0)) - (float)((float)(v12 * 90.0) * 0.5), -(float)((float)(v21 - 1.0) * (float)(v12 * 90.0))); cocos2d::CCPoint::operator+(&v93, &v88, &v92); v86(v20, &v93); if ( v19 ) { a1->m_questsSprite = v16; CreatorLayer::checkQuestsStatus(a1); } if ( v18 ) { v22 = GameManager::sharedState(); if ( GameManager::getGameVariable(v22, "0077") ) { v20->setEnabled(v20, 0); v20->setVisible(v20, 0); } } sub_774008(&v89); if ( ++v81 != 15 ) continue; v23 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png"); v24 = v23->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v93, 0.0, 0.0); v24(v23, &v93); v25 = v23->setPosition; v26 = cocos2d::CCDirector::sharedDirector(); v27 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v26)); v28 = cocos2d::CCDirector::sharedDirector(); v29 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v28)); cocos2d::CCPoint::CCPoint(&v93, v27 - 1.0, v29 - 1.0); v25(v23, &v93); a1->addChild_0(a1, v23, 1); v30 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png"); v31 = v30->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v93, 1.0, 0.0); v31(v30, &v93); v32 = v30->setPosition; v33 = cocos2d::CCDirector::sharedDirector(); v34 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v33)); v35 = cocos2d::CCDirector::sharedDirector(); v36 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v35)); cocos2d::CCPoint::CCPoint(&v93, v34 + 1.0, v36 - 1.0); v32(v30, &v93); cocos2d::CCSprite::setFlipX(v30, 1); v37 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png"); v38 = v37->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v93, 0.0, 1.0); v38(v37, &v93); v39 = v37->setPosition; v40 = cocos2d::CCDirector::sharedDirector(); v41 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v40)); v42 = cocos2d::CCDirector::sharedDirector(); v43 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v42)); cocos2d::CCPoint::CCPoint(&v93, v41 - 1.0, v43 + 1.0); v39(v37, &v93); cocos2d::CCSprite::setFlipY(v37, 1); a1->addChild_0(a1, v37, -1); v44 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png"); v45 = v44->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v93, 1.0, 1.0); v45(v44, &v93); v46 = v44->setPosition; v47 = cocos2d::CCDirector::sharedDirector(); v48 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v47)); v49 = cocos2d::CCDirector::sharedDirector(); v50 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v49)); cocos2d::CCPoint::CCPoint(&v93, v48 + 1.0, v50 + 1.0); v46(v44, &v93); cocos2d::CCSprite::setFlipY(v44, 1); cocos2d::CCSprite::setFlipX(v44, 1); v51 = GameStatsManager::sharedState(); Stat = GameStatsManager::getStat(v51, "13"); v53 = Stat > 49; if ( Stat > 49 ) v54 = "GJ_lock_open_001.png"; else v54 = "GJ_lockGray_001.png"; v55 = cocos2d::CCSprite::createWithSpriteFrameName(v54); v91 = 0; v90 = CreatorLayer::onSecretVault; v56 = v55; v57 = CCMenuItemSpriteExtra::create( v55, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(CreatorLayer::onSecretVault, (unsigned int)a1)); v10->addChild(v10, v57); v82 = v57->setPosition; cocos2d::CCPoint::CCPoint(&v92, v87.width - 22.0, v87.height - 18.0); cocos2d::CCNode::convertToNodeSpace(&v93, v10, &v92); v82(v57, &v93); if ( !v53 ) { width = v57->getContentSize(v57)->width; v59 = (int)v57->getContentSize(v57); cocos2d::CCPoint::CCPoint(&v89, width * 0.5, (float)(*(float *)(v59 + 4) * 0.5) - 22.0); v60 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_diamondsIcon_001.png"); v56->addChild(v56, v60); v85 = v60->setPosition; cocos2d::CCPoint::CCPoint(&v92, 9.0, -1.0); cocos2d::CCPoint::operator+(&v93, &v89, &v92); v85(v60, &v93); ((void (__fastcall *)(cocos2d::CCSprite *, int))v60->setScale)(v60, 1060320051); v61 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"%i", (const char *)&word_32); cocos2d::CCString::getCString(v61); v62 = cocos2d::CCLabelBMFont::create(); v56->addChild(v56, v62); v63 = v62->setPosition; cocos2d::CCPoint::CCPoint(&v92, -8.5, 0.0); cocos2d::CCPoint::operator+(&v93, &v89, &v92); v63(v62, &v93); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v62->setScale)(v62, 1053609165); } CCMenuItemSpriteExtra::setSizeMult(v57, 2.0); v64 = GameManager::sharedState(); if ( GameManager::getUGV(v64, (const char *)&aO1i2r3e45s7t89[8]) ) v65 = "secretDoorBtn_open_001.png"; else v65 = "secretDoorBtn_closed_001.png"; v66 = cocos2d::CCSprite::createWithSpriteFrameName(v65); a1->m_secretDoorSprite = v66; v92.y = 0.0; LODWORD(v92.x) = CreatorLayer::onTreasureRoom; v67 = CCMenuItemSpriteExtra::create( v66, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(CreatorLayer::onTreasureRoom, (unsigned int)a1)); addChild = v10->addChild; v69 = v67; v67->m_colorEnabled = 1; v67->m_animationEnabled = 0; addChild(v10, v67); v83 = v69->setPosition; cocos2d::CCPoint::CCPoint(&v89, v87.width - 22.0, 24.0); cocos2d::CCNode::convertToNodeSpace(&v93, v10, &v89); v83(v69, &v93); CCMenuItemSpriteExtra::setSizeMult(v69, 1.2); v70 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png"); v93.y = 0.0; LODWORD(v93.x) = CreatorLayer::onBack; v71 = CCMenuItemSpriteExtra::create( v70, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(CreatorLayer::onBack, (unsigned int)a1)); CCMenuItemSpriteExtra::setSizeMult(v71, 1.6); v72 = (cocos2d::CCNode *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v71, nullptr); a1->addChild_0(a1, v72, 1); v73 = v72->setPosition; v74 = cocos2d::CCDirector::sharedDirector(); v75 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v74)); v76 = cocos2d::CCDirector::sharedDirector(); v77 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v76)); cocos2d::CCPoint::CCPoint(&v89, v75 + 24.0, v77 - 23.0); v73(v72, &v89); GameManager::sharedState()->m_currentLevelID = 0; if ( PlatformToolbox::isControllerConnected() ) GameToolbox::addBackButton(a1, v71); v78 = GameManager::sharedState(); if ( v78->m_playerUserID.random == v78->m_playerUserID.seed ) { v79 = GameLevelManager::sharedState(); GameLevelManager::updateUserScore(v79); } break; } break; } } return v84; }