//
// ParentalOptionsLayer::init from 0x1404d1530 to 0x1404d1b54 (1572 bytes)
//
// 5 xrefs:
// > ParentalOptionsLayer::create @ 0x1404d14e1
// > ParentalOptionsLayer::create @ 0x1404d14e8
// > ParentalOptionsLayer::create @ 0x1404d14d2
// > ??> @ 0x1407cf4e0
// > ??> @ 0x140929780
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:33:00 +0000
//
// Hidden C++ exception states: #wind=1
bool __fastcall ParentalOptionsLayer::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
__int64 *v6; // rdi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rbx
__int64 v10; // rax
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rcx
cocos2d::CCObject *v15; // rax
__int64 v16; // rcx
cocos2d::CCObject *v17; // rax
__int64 v18; // rcx
cocos2d::CCObject *v19; // rax
__int64 v20; // rcx
cocos2d::CCObject *v21; // rax
__int64 v22; // rcx
__int64 v23; // rax
int v24; // eax
cocos2d::CCObject *v25; // rsi
__int64 v26; // rdi
__int64 v27; // rbx
__int64 v28; // rax
__int64 v29; // rax
int v30; // eax
__int64 v31; // rcx
__int64 v32; // rbx
bool GameVariable; // al
__int64 v34; // rcx
__int64 v35; // rsi
__int64 v36; // rbx
__int64 v37; // rdi
__int64 v38; // rax
__int64 v39; // rax
float v40; // xmm7_4
int v41; // eax
cocos2d::CCObject *v42; // rax
__int64 v43; // rsi
__int64 v44; // rbx
__int64 v45; // rdi
__int64 v46; // rax
__int64 v47; // rax
cocos2d::CCSprite *v48; // rax
cocos2d::CCObject *v49; // rax
__int64 v50; // rsi
__int64 v51; // rbx
__int64 v52; // rdi
__int64 v53; // rax
__int64 v54; // rax
_BYTE v55[16]; // [rsp+30h] [rbp-40h] BYREF
float v56; // [rsp+A8h] [rbp+38h] BYREF
float v57; // [rsp+ACh] [rbp+3Ch]
void *v58; // [rsp+B0h] [rbp+40h] BYREF
char v59; // [rsp+B8h] [rbp+48h] BYREF
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
*(_BYTE *)(a1 + 596) = 1;
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v56);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v55, 0.0, 0.0, 80.0, 80.0);
v6 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v5);
v7 = *v6;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v58, 360.0, 260.0);
(*(void (__fastcall **)(__int64 *, __int64))(v7 + 312))(v6, v8);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v6,
0xFFFFFFFFLL);
v9 = *v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, v56 * 0.5, v57 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v9 + 184))(v6, v10);
v11 = cocos2d::CCLabelBMFont::create("Parental Control", (const char *)&qword_140704F78);
v12 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, v56 * 0.5, (float)((float)(v57 * 0.5) + 130.0) - 16.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v11);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 160LL))(v11);
v15 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v14);
*(_QWORD *)(a1 + 688) = v15;
cocos2d::CCObject::retain(v15);
v17 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v16);
*(_QWORD *)(a1 + 680) = v17;
cocos2d::CCObject::retain(v17);
v19 = (cocos2d::CCObject *)cocos2d::CCArray::create(v18);
*(_QWORD *)(a1 + 720) = v19;
cocos2d::CCObject::retain(v19);
v21 = (cocos2d::CCObject *)cocos2d::CCArray::create(v20);
*(_QWORD *)(a1 + 728) = v21;
cocos2d::CCObject::retain(v21);
v23 = cocos2d::CCMenu::create(v22);
*(_QWORD *)(a1 + 552) = v23;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v23, 10);
ParentalOptionsLayer::addMasterToggle(
a1,
"Safe Mode",
"0218",
"Blocks all communication.\nOnly approved online levels.",
"Safe Mode blocks comments, posts, messages, friend requests, user search and uploads. Online levels are li"
"mited to Featured, Daily, Weekly, Events, Gauntlets and Map Packs."
" Social links are hidden. Account privacy is set to block messages, friend requests and comments.");
ParentalOptionsLayer::addMasterToggle(
a1,
"Offline Mode",
"0219",
"No online levels or profiles.\nIncludes Safe Mode.",
"Offline Mode blocks everything Safe Mode blocks, plus online levels, profiles and leaderboards.");
ParentalOptionsLayer::addToggle(a1, "Disable\nComments", "0075");
ParentalOptionsLayer::addToggle(a1, "Disable\nPosts", "0076");
ParentalOptionsLayer::addToggle(a1, "Disable\nMessaging", "0243");
ParentalOptionsLayer::addToggle(a1, "Only Curated\nLevels", "0077");
ParentalOptionsLayer::updateToggleStates(a1);
v24 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v25 = CCMenuItemSpriteExtra::create(v24, 0, a1, (__int64)ParentalOptionsLayer::onClose);
*((_DWORD *)v25 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v25);
v26 = *(_QWORD *)v25;
v27 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
(float)((float)(v56 * 0.5) - 180.0) + 5.0,
(float)((float)(v57 * 0.5) + 130.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(v27, &v59, v28);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v26 + 184))(v25, v29);
LODWORD(v27) = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_lock_open_001.png");
v30 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_lock_001.png");
*(_QWORD *)(a1 + 712) = CCMenuItemToggler::create(v27, v30, a1, (__int64)ParentalOptionsLayer::onLockToggle);
v31 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v58 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v58);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v31 = qword_14090BFD0;
}
v32 = *(_QWORD *)(a1 + 712);
GameVariable = GameManager::getGameVariable(v31, "0228");
CCMenuItemToggler::toggle(v32, GameVariable);
v34 = *(_QWORD *)(a1 + 712);
*(_DWORD *)(*(_QWORD *)(v34 + 376) + 372LL) = 1069547520;
*(_DWORD *)(*(_QWORD *)(v34 + 384) + 372LL) = 1069547520;
CCMenuItemToggler::toggle(v34, *(unsigned __int8 *)(v34 + 392));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 712));
v35 = **(_QWORD **)(a1 + 712);
v36 = *(_QWORD *)(a1 + 552);
v37 = *(_QWORD *)(a1 + 712);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v58,
(float)((float)(v56 * 0.5) + 180.0) - 24.0,
(float)((float)(v57 * 0.5) - 130.0) + 24.0);
cocos2d::CCNode::convertToNodeSpace(v36, &v59, v38);
(*(void (__fastcall **)(__int64, __int64))(v35 + 184))(v37, v39);
v40 = v57 * 0.5;
v41 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
v42 = CCMenuItemSpriteExtra::create(v41, 0, a1, (__int64)ParentalOptionsLayer::onPrevPage);
*(_QWORD *)(a1 + 736) = v42;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v42);
v43 = **(_QWORD **)(a1 + 736);
v44 = *(_QWORD *)(a1 + 552);
v45 = *(_QWORD *)(a1 + 736);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, (float)(v56 * 0.5) - 224.0, v40);
cocos2d::CCNode::convertToNodeSpace(v44, &v59, v46);
(*(void (__fastcall **)(__int64, __int64))(v43 + 184))(v45, v47);
v48 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png");
LODWORD(v44) = (_DWORD)v48;
cocos2d::CCSprite::setFlipX(v48, 1);
v49 = CCMenuItemSpriteExtra::create(v44, 0, a1, (__int64)ParentalOptionsLayer::onNextPage);
*(_QWORD *)(a1 + 744) = v49;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v49);
v50 = **(_QWORD **)(a1 + 744);
v51 = *(_QWORD *)(a1 + 552);
v52 = *(_QWORD *)(a1 + 744);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, (float)(v56 * 0.5) + 224.0, v40);
cocos2d::CCNode::convertToNodeSpace(v51, &v59, v53);
(*(void (__fastcall **)(__int64, __int64))(v50 + 184))(v52, v54);
ParentalOptionsLayer::goToPage(a1, 0);
return 1;
}
return result;
}