//
// TutorialLayer::init from 0x42bde4 to 0x42c142 (862 bytes)
//
// 1 xrefs:
// > TutorialLayer::create @ 0x42ba7c
//
// 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 TutorialLayer::init(TutorialLayer *a1)
{
int v2; // r9
cocos2d::CCDirector *v3; // r0
cocos2d::CCLayer *v4; // r0
TutorialLayer_vtbl *v5; // r3
cocos2d::CCLayer *v6; // r0
cocos2d::CCNode *v7; // r6
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v10; // r6
void (__fastcall *v11)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r5
float *v13; // r0
cocos2d::CCSprite *v14; // r0
CCMenuItemSpriteExtra *v15; // r6
cocos2d::CCMenu *v16; // r0
float height; // s14
float v18; // s13
cocos2d::CCMenu_vtbl *v19; // r3
cocos2d::CCMenu *v20; // r10
void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
ButtonSprite *v22; // r0
CCMenuItemSpriteExtra *v23; // r0
ButtonSprite *v24; // r0
CCMenuItemSpriteExtra *v25; // r0
CCMenuItemSpriteExtra *m_nextButton; // r10
void (__fastcall *v27)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
CCMenuItemSpriteExtra *m_exitButton; // r6
void (__fastcall *v29)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const cocos2d::CCPoint *v30; // r0
float v32; // r2
float v33; // r3
float v34; // [sp+10h] [bp-4Ch]
float v35; // [sp+10h] [bp-4Ch]
cocos2d::CCMenu *m_buttonMenu; // [sp+14h] [bp-48h]
cocos2d::CCSize v37; // [sp+1Ch] [bp-40h] BYREF
void (*v38)(TutorialLayer *, cocos2d::CCObject *); // [sp+24h] [bp-38h]
int v39; // [sp+28h] [bp-34h]
void (*v40)(TutorialLayer *, cocos2d::CCObject *); // [sp+2Ch] [bp-30h]
int v41; // [sp+30h] [bp-2Ch]
void (*v42)(TutorialLayer *, cocos2d::CCObject *); // [sp+34h] [bp-28h]
int v43; // [sp+38h] [bp-24h]
cocos2d::CCPoint v44; // [sp+3Ch] [bp-20h] BYREF
cocos2d::CCRect v45; // [sp+44h] [bp-18h] BYREF
cocos2d::CCSize v46; // 0:^0.8
cocos2d::CCRect v47; // 0:kr00_16.16
v45.origin.x = -1.034e-25;
v2 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v45);
if ( v2 )
{
a1->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v37, v3);
v4 = cocos2d::CCLayer::create();
v5 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v4;
v5->addChild(a1, v4);
v6 = cocos2d::CCLayer::create();
a1->m_tutorialLayer = v6;
a1->m_mainLayer->addChild(a1->m_mainLayer, v6);
cocos2d::CCRect::CCRect(&v45, 0.0, 0.0, 80.0, 80.0);
v47.origin.x = v32;
v47.origin.y = v33;
v47.size = v46;
v7 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v45,
v47);
((void (__fastcall *)(cocos2d::CCNode *, int))v7->__vftable[1].~CCNode_0)(v7, 255);
setContentSize = v7->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v45, 420.0, 260.0);
setContentSize(v7, (const cocos2d::CCSize *)&v45);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v7, -1);
setPosition = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v45.origin, v37.width * 0.5, v37.height * 0.5);
setPosition(v7, &v45.origin);
v10 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v10, 20);
v11 = v10->setPosition;
cocos2d::CCPoint::CCPoint(&v45.origin, v37.width * 0.5, (float)((float)(v37.height * 0.5) + 130.0) - 25.0);
v11(v10, &v45.origin);
if ( v10->getContentSize(v10)->width > 300.0 )
{
setScale = v10->setScale;
v13 = (float *)v10->getContentSize(v10);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(v10, 300.0 / *v13);
}
a1->m_joystickConnected = -1;
v14 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v38 = TutorialLayer::onClose;
v39 = 0;
v15 = CCMenuItemSpriteExtra::create(
v14,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(TutorialLayer::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v15, 1.6);
v16 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v15, nullptr);
height = v37.height;
v18 = (float)(v37.width * 0.5) - 210.0;
v19 = v16->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v20 = v16;
a1->m_buttonMenu = v16;
v21 = v19->setPosition;
cocos2d::CCPoint::CCPoint(&v45.origin, v18 + 10.0, (float)((float)(height * 0.5) + 130.0) - 10.0);
v21(v20, &v45.origin);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
v22 = ButtonSprite::create(
(ButtonSprite *)"Next",
(const char *)off_DC,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x42200000,
v34);
v40 = TutorialLayer::onNext;
v41 = 0;
v23 = CCMenuItemSpriteExtra::create(
v22,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(TutorialLayer::onNext, (unsigned int)a1));
a1->m_nextButton = v23;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v23);
v24 = ButtonSprite::create(
(ButtonSprite *)"Exit",
(const char *)off_DC,
0,
0.6,
0,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x42200000,
v35);
v42 = TutorialLayer::onClose;
v43 = 0;
v25 = CCMenuItemSpriteExtra::create(
v24,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(TutorialLayer::onClose, (unsigned int)a1));
a1->m_exitButton = v25;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v25);
m_nextButton = a1->m_nextButton;
v27 = m_nextButton->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v45.origin,
(float)((float)(v37.width * 0.5) + 210.0) - 52.0,
(float)((float)(v37.height * 0.5) - 130.0) + 50.0);
cocos2d::CCNode::convertToNodeSpace(&v44, m_buttonMenu, &v45.origin);
v27(m_nextButton, &v44);
m_exitButton = a1->m_exitButton;
v29 = m_exitButton->setPosition;
v30 = a1->m_nextButton->getPosition(a1->m_nextButton);
v29(m_exitButton, v30);
a1->m_exitButton->setVisible(a1->m_exitButton, 0);
a1->m_page = 0;
TutorialLayer::loadPage(a1, 1);
}
return v2;
}