//
// ParentalOptionsLayer::init from 0x14037b590 to 0x14037b9d8 (1096 bytes)
//
// 5 xrefs:
// > MoreOptionsLayer::onParental @ 0x140376667
// > MoreOptionsLayer::onParental @ 0x14037666e
// > MoreOptionsLayer::onParental @ 0x140376658
// > ??> @ 0x1405c4a80
// > ??> @ 0x1406d5cf0
//
// 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)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCDirector *v4; // rax
struct cocos2d::CCRect *v5; // rax
struct cocos2d::extension::CCScale9Sprite *v6; // rdi
cocos2d::extension::CCScale9Sprite_vtbl *v7; // rbx
const cocos2d::CCSize *v8; // rax
float v9; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v10; // rbx
double v11; // xmm0_8
const cocos2d::CCPoint *v12; // rax
struct cocos2d::CCLabelBMFont *v13; // rdi
cocos2d::CCLabelBMFont_vtbl *v14; // rbx
const cocos2d::CCPoint *v15; // rax
__int64 v16; // rcx
cocos2d::CCDictionary *v17; // rax
__int64 v18; // rcx
cocos2d::CCDictionary *v19; // rax
__int64 v20; // rcx
cocos2d::CCMenu *v21; // rax
cocos2d::CCLayer *m_mainLayer; // rcx
const char *v23; // r9
const char *v24; // r9
const char *v25; // r9
struct cocos2d::CCSprite *v26; // rax
CCMenuItemSpriteExtra *v27; // rdi
float v28; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v29; // rbx
struct cocos2d::CCPoint v30; // rax
struct cocos2d::CCSprite *v31; // rax
CCMenuItemSpriteExtra *v32; // rax
cocos2d::CCMenu *m_buttonMenu; // rcx
CCMenuItemSpriteExtra_vtbl *v34; // rbx
__int64 v35; // rcx
cocos2d::CCDirector *v36; // rax
float v37; // xmm0_4
struct cocos2d::CCPoint v38; // rax
cocos2d::CCSprite *v39; // rbx
CCMenuItemSpriteExtra *v40; // rax
cocos2d::CCMenu *v41; // rcx
CCMenuItemSpriteExtra_vtbl *v42; // rbx
__int64 v43; // rcx
cocos2d::CCDirector *v44; // rax
float v45; // xmm0_4
struct cocos2d::CCPoint v46; // rax
cocos2d::CCRect v47; // [rsp+30h] [rbp-48h] BYREF
float v48; // [rsp+88h] [rbp+10h]
cocos2d::CCSize v49; // [rsp+90h] [rbp+18h] BYREF
struct cocos2d::CCPoint v50; // [rsp+98h] [rbp+20h] BYREF
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4);
cocos2d::CCRect::CCRect(&v47, 0.0, 0.0, 80.0, 80.0);
v6 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
v7 = v6->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize(&v49, 360.0, 260.0);
v7->setContentSize(v6, v8);
v9 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v6,
0xFFFFFFFFLL);
v10 = v6->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v11 = cocos2d::CCPoint::CCPoint(v9, v48 * 0.5);
v10->setPosition_0(v6, v12);
v13 = cocos2d::CCLabelBMFont::create("Parental Control", (const char *)&qword_14052A4D8);
v14 = v13->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v11, v48 * 0.5);
v14->setPosition_0(v13, v15);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v13);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v13->setScale_0)(v13);
v17 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v16);
a1->m_variables = v17;
cocos2d::CCObject::retain(v17);
v19 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v18);
a1->m_values = v19;
cocos2d::CCObject::retain(v19);
v21 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v20);
m_mainLayer = a1->m_mainLayer;
a1->m_buttonMenu = v21;
m_mainLayer->addChild_0(m_mainLayer, v21, 10);
ParentalOptionsLayer::addToggle(a1, "Disable Comments", "0075", v23);
ParentalOptionsLayer::addToggle(a1, "Disable Account\nComments", "0076", v24);
ParentalOptionsLayer::addToggle(a1, "Only Allow\nFeatured Levels", "0077", v25);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v27 = CCMenuItemSpriteExtra::create(v26, nullptr, a1, (cocos2d::SEL_MenuHandler *)AudioAssetsBrowser::onClose);
HIDWORD(v27->m_pfnSelector.adj) = 1069547520;
v28 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v27);
v29 = v27->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v28, (float)((float)(v48 * 0.5) - 180.0) + 5.0);
v30 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v50);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v29->setPosition_0)(v27, v30);
v31 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v32 = CCMenuItemSpriteExtra::create(v31, nullptr, a1, (cocos2d::SEL_MenuHandler *)KeybindingsLayer::onPrevPage);
m_buttonMenu = a1->m_buttonMenu;
a1->m_prevButton = v32;
m_buttonMenu->addChild_1(m_buttonMenu, v32);
v34 = a1->m_prevButton->__vftable;
v36 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v35);
v37 = cocos2d::CCDirector::getScreenLeft(v36) + 24.0;
cocos2d::CCPoint::CCPoint(v37, v37);
v38 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v50);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v34->setPosition_0)(a1->m_prevButton, v38);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v39, 1);
v40 = CCMenuItemSpriteExtra::create(v39, nullptr, a1, (cocos2d::SEL_MenuHandler *)KeybindingsLayer::onNextPage);
v41 = a1->m_buttonMenu;
a1->m_nextButton = v40;
v41->addChild_1(v41, v40);
v42 = a1->m_nextButton->__vftable;
v44 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v43);
v45 = cocos2d::CCDirector::getScreenRight(v44) - 24.0;
cocos2d::CCPoint::CCPoint(v45, v45);
v46 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v50);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v42->setPosition_0)(a1->m_nextButton, v46);
KeybindingsLayer::goToPage((__int64)a1, 0);
return 1;
}
return result;
}