//
// GJPathsLayer::init from 0x58cd60 to 0x58d0f0 (912 bytes)
//
// 1 xrefs:
// > GJPathsLayer::create @ 0x58c188
//
// 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 GJPathsLayer::init(GJPathsLayer *a1)
{
cocos2d::CCTextureCache *v2; // r0
cocos2d::CCSpriteFrameCache *v3; // r0
GameStatsManager *v4; // r0
int v5; // r8
cocos2d::CCDirector *v6; // r0
cocos2d::CCLayer *v7; // r0
GJPathsLayer_vtbl *v8; // r3
cocos2d::CCSprite *v9; // r7
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v11; // r0
CCMenuItemSpriteExtra *v12; // r7
cocos2d::CCMenu *v13; // r0
float width; // s14
float v15; // s15
cocos2d::CCMenu_vtbl *v16; // r3
cocos2d::CCMenu *v17; // r7
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v19; // r7
void (__fastcall *v20)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v21; // r7
void (__fastcall *v22)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v23; // r7
void (__fastcall *v24)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v25; // r9
GJPathSprite *v26; // r6
CCMenuItemSpriteExtra *v27; // r6
float v28; // s16
float v29; // s17
float v30; // r0
void (__fastcall *v32)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-50h]
cocos2d::CCMenu *m_buttonMenu; // [sp+14h] [bp-48h]
cocos2d::CCSize v34; // [sp+1Ch] [bp-40h] BYREF
cocos2d::CCPoint v35; // [sp+24h] [bp-38h] BYREF
void (*v36)(GJPathsLayer *, cocos2d::CCObject *); // [sp+2Ch] [bp-30h]
int v37; // [sp+30h] [bp-2Ch]
void (*v38)(GJPathsLayer *, cocos2d::CCObject *); // [sp+34h] [bp-28h]
int v39; // [sp+38h] [bp-24h]
cocos2d::CCPoint v40; // [sp+3Ch] [bp-20h] BYREF
cocos2d::CCPoint v41; // [sp+44h] [bp-18h] BYREF
cocos2d::CCPoint v42; // [sp+4Ch] [bp-10h] BYREF
v2 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v2, "GJ_PathSheet.png", 0);
v3 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v3, "GJ_PathSheet.plist");
a1->m_exiting = 1;
v4 = GameStatsManager::sharedState();
GameStatsManager::trySelectActivePath(v4);
FLAlertLayer::incrementForcePrio(a1);
v42.x = -1.1642e-10;
v5 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v42);
if ( v5 )
{
a1->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v34, v6);
v7 = cocos2d::CCLayer::create();
v8 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v7;
v8->addChild(a1, v7);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("pathSelectBG_001.png");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v9, -1);
((void (__fastcall *)(cocos2d::CCSprite *, int))v9->setScale)(v9, 1067030938);
setPosition = v9->setPosition;
cocos2d::CCPoint::CCPoint(&v42, v34.width * 0.5, v34.height * 0.5);
setPosition(v9, &v42);
a1->m_joystickConnected = -1;
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v36 = GJPathsLayer::onClose;
v37 = 0;
a1->m_closeSprite = v11;
v12 = CCMenuItemSpriteExtra::create(
v11,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJPathsLayer::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v12, 1.6);
v13 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v12, nullptr);
width = v34.width;
v15 = (float)(v34.height * 0.5) + 130.0;
v16 = v13->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v17 = v13;
a1->m_buttonMenu = v13;
v18 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v42, (float)((float)(width * 0.5) - 130.0) + 10.0, v15 - 10.0);
v18(v17, &v42);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
v19 = cocos2d::CCSprite::createWithSpriteFrameName("label_paths_001.png");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v19, 20);
v20 = v19->setPosition;
cocos2d::CCPoint::CCPoint(&v42, v34.width * 0.5, (float)(v34.height * 0.5) + 29.0);
v20(v19, &v42);
((void (__fastcall *)(cocos2d::CCSprite *, int))v19->setScale)(v19, 1061997773);
v21 = cocos2d::CCSprite::createWithSpriteFrameName("label_of_001.png");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v21, 20);
v22 = v21->setPosition;
cocos2d::CCPoint::CCPoint(&v42, v34.width * 0.5, v34.height * 0.5);
v22(v21, &v42);
((void (__fastcall *)(cocos2d::CCSprite *, int))v21->setScale)(v21, 1061997773);
v23 = cocos2d::CCSprite::createWithSpriteFrameName("label_power_001.png");
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v23, 20);
v24 = v23->setPosition;
cocos2d::CCPoint::CCPoint(&v42, v34.width * 0.5, (float)(v34.height * 0.5) - 34.0);
v24(v23, &v42);
v25 = 0;
((void (__fastcall *)(cocos2d::CCSprite *, int))v23->setScale)(v23, 1061997773);
cocos2d::CCPoint::CCPoint(&v35, v34.width * 0.5, v34.height * 0.5);
do
{
v26 = GJPathSprite::create(v25 + 1);
GJPathSprite::updateState(v26);
v38 = GJPathsLayer::onPath;
v39 = 0;
v27 = CCMenuItemSpriteExtra::create(
v26,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJPathsLayer::onPath, (unsigned int)a1));
v27->setTag(v27, v25 + 1);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v27);
v28 = (float)(90.0 - (float)((float)v25 * 36.0)) * 0.0174532925;
v29 = cosf(v28);
v30 = sinf(v28);
v32 = v27->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v42, v29 * 100.0, v30 * 100.0);
cocos2d::CCPoint::operator+(&v41, &v35, &v42);
cocos2d::CCNode::convertToNodeSpace(&v40, m_buttonMenu, &v41);
v32(v27, &v40);
++v25;
}
while ( v25 != 10 );
}
return v5;
}