//
// ParentalOptionsLayer::init from 0x426f1c to 0x42721e (770 bytes)
//
// 1 xrefs:
// > ParentalOptionsLayer::create @ 0x4266a8
//
// 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 ParentalOptionsLayer::init(ParentalOptionsLayer *a1)
{
int v2; // r9
cocos2d::CCDirector *v3; // r0
cocos2d::CCNode *v4; // r6
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v7; // r6
void (__fastcall *v8)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCDictionary *v9; // r0
cocos2d::CCDictionary *v10; // r0
cocos2d::CCMenu *v11; // r0
cocos2d::CCSprite *v12; // r0
CCMenuItemSpriteExtra *v13; // r10
void (__fastcall *v14)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
float v15; // s16
cocos2d::CCSprite *v16; // r0
CCMenuItemSpriteExtra *v17; // r0
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v19; // r0
float v20; // r0
cocos2d::CCSprite *v21; // r10
CCMenuItemSpriteExtra *v22; // r0
CCMenuItemSpriteExtra *m_nextButton; // r10
void (__fastcall *v24)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCDirector *v25; // r0
float v26; // r0
float v28; // r2
float v29; // r3
cocos2d::CCMenu *m_buttonMenu; // [sp+8h] [bp-4Ch]
cocos2d::CCMenu *v31; // [sp+8h] [bp-4Ch]
cocos2d::CCMenu *v32; // [sp+8h] [bp-4Ch]
CCMenuItemSpriteExtra *m_prevButton; // [sp+Ch] [bp-48h]
cocos2d::CCSize v34; // [sp+14h] [bp-40h] BYREF
void (*v35)(ParentalOptionsLayer *, cocos2d::CCObject *); // [sp+1Ch] [bp-38h]
int v36; // [sp+20h] [bp-34h]
void (*v37)(ParentalOptionsLayer *, cocos2d::CCObject *); // [sp+24h] [bp-30h]
int v38; // [sp+28h] [bp-2Ch]
void (*v39)(ParentalOptionsLayer *, cocos2d::CCObject *); // [sp+2Ch] [bp-28h]
int v40; // [sp+30h] [bp-24h]
cocos2d::CCPoint v41; // [sp+34h] [bp-20h] BYREF
cocos2d::CCRect v42; // [sp+3Ch] [bp-18h] BYREF
cocos2d::CCSize v43; // 0:^0.8
cocos2d::CCRect v44; // 0:kr00_16.16
v2 = FLAlertLayer::init(a1, (cocos2d::_ccColor4B)75);
if ( v2 )
{
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v34, v3);
cocos2d::CCRect::CCRect(&v42, 0.0, 0.0, 80.0, 80.0);
v44.origin.x = v28;
v44.origin.y = v29;
v44.size = v43;
v4 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"GJ_square01.png",
(const char *)&v42,
v44);
setContentSize = v4->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v42, 360.0, 260.0);
setContentSize(v4, (const cocos2d::CCSize *)&v42);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v4, -1);
setPosition = v4->setPosition;
cocos2d::CCPoint::CCPoint(&v42.origin, v34.width * 0.5, v34.height * 0.5);
setPosition(v4, &v42.origin);
v7 = cocos2d::CCLabelBMFont::create();
v8 = v7->setPosition;
cocos2d::CCPoint::CCPoint(&v42.origin, v34.width * 0.5, (float)((float)(v34.height * 0.5) + 130.0) - 16.0);
v8(v7, &v42.origin);
a1->m_mainLayer->addChild(a1->m_mainLayer, v7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v7->setScale)(v7, 1058642330);
v9 = cocos2d::CCDictionary::create();
a1->m_variables = v9;
cocos2d::CCObject::retain(v9);
v10 = cocos2d::CCDictionary::create();
a1->m_values = v10;
cocos2d::CCObject::retain(v10);
v11 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v11;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v11, 10);
ParentalOptionsLayer::addToggle(a1, "Disable Comments", "0075", nullptr);
ParentalOptionsLayer::addToggle(a1, "Disable Account\nComments", "0076", nullptr);
ParentalOptionsLayer::addToggle(a1, "Only Allow\nFeatured Levels", "0077", nullptr);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v35 = ParentalOptionsLayer::onClose;
v36 = 0;
v13 = CCMenuItemSpriteExtra::create(
v12,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ParentalOptionsLayer::onClose, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v13, 1.5);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v13);
v14 = v13->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v42.origin,
(float)((float)(v34.width * 0.5) - 180.0) + 5.0,
(float)((float)(v34.height * 0.5) + 130.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(&v41, m_buttonMenu, &v42.origin);
v14(v13, &v41);
v15 = v34.height * 0.5;
v16 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v38 = 0;
v37 = ParentalOptionsLayer::onPrevPage;
v17 = CCMenuItemSpriteExtra::create(
v16,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ParentalOptionsLayer::onPrevPage, (unsigned int)a1));
a1->m_prevButton = v17;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v17);
m_prevButton = a1->m_prevButton;
v18 = m_prevButton->setPosition;
v31 = a1->m_buttonMenu;
v19 = cocos2d::CCDirector::sharedDirector();
v20 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v19));
cocos2d::CCPoint::CCPoint(&v42.origin, v20 + 24.0, v15);
cocos2d::CCNode::convertToNodeSpace(&v41, v31, &v42.origin);
v18(m_prevButton, &v41);
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v21, 1);
v39 = ParentalOptionsLayer::onNextPage;
v40 = 0;
v22 = CCMenuItemSpriteExtra::create(
v21,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(ParentalOptionsLayer::onNextPage, (unsigned int)a1));
a1->m_nextButton = v22;
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v22);
m_nextButton = a1->m_nextButton;
v24 = m_nextButton->setPosition;
v32 = a1->m_buttonMenu;
v25 = cocos2d::CCDirector::sharedDirector();
v26 = COERCE_FLOAT(cocos2d::CCDirector::getScreenRight(v25));
cocos2d::CCPoint::CCPoint(&v42.origin, v26 - 24.0, v15);
cocos2d::CCNode::convertToNodeSpace(&v41, v32, &v42.origin);
v24(m_nextButton, &v41);
ParentalOptionsLayer::goToPage(a1, 0);
}
return v2;
}