//
// ParentalOptionsLayer::addToggle from 0x52f510 to 0x52f7ac (668 bytes)
//
// 4 xrefs:
// > ParentalOptionsLayer::init @ 0x5323c8
// > ParentalOptionsLayer::init @ 0x5323de
// > ParentalOptionsLayer::init @ 0x5323f4
// > ParentalOptionsLayer::init @ 0x53240a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:03 +0000
//
int __fastcall ParentalOptionsLayer::addToggle(
ParentalOptionsLayer *this,
const char *a2,
char *a3,
const char *a4,
const char *a5)
{
const char *v9; // r2
GameManager *v10; // r9
GameManager *v11; // r0
int GameVariable; // r0
cocos2d::CCDictionary *v13; // r3
size_t v14; // r0
cocos2d::CCObject *v15; // r0
cocos2d::CCObject *v16; // r0
int v17; // r7
size_t v18; // r0
cocos2d::CCDictionary *v19; // r3
cocos2d::CCNodeRGBA *ToggleButton; // r6
int v21; // r2
int v22; // r3
cocos2d::CCObject *v23; // r10
int result; // r0
size_t v25; // r0
cocos2d::CCObject *v26; // r11
size_t v27; // r0
const char *v28; // r1
int v29; // r5
cocos2d::CCObject *v30; // r5
void (__fastcall *v31)(cocos2d::CCObject *, _BYTE *); // r9
int v32; // r6
int v33; // [sp+30h] [bp-5Ch]
int v34; // [sp+30h] [bp-5Ch]
cocos2d::CCDictionary *v35; // [sp+34h] [bp-58h]
cocos2d::CCDictionary *v36; // [sp+34h] [bp-58h]
cocos2d::CCDictionary *v37; // [sp+34h] [bp-58h]
_BYTE v38[8]; // [sp+44h] [bp-48h] BYREF
_BYTE v39[8]; // [sp+4Ch] [bp-40h] BYREF
_BYTE v40[8]; // [sp+54h] [bp-38h] BYREF
_DWORD (*v41)(ParentalOptionsLayer *__hidden, cocos2d::CCObject *); // [sp+5Ch] [bp-30h]
int v42; // [sp+60h] [bp-2Ch]
_DWORD v43[2]; // [sp+64h] [bp-28h] BYREF
int v44[3]; // [sp+6Ch] [bp-20h] BYREF
int v45; // [sp+78h] [bp-14h] BYREF
int v46; // [sp+7Ch] [bp-10h]
int v47; // [sp+80h] [bp-Ch]
++*((_DWORD *)this + 131);
v9 = *((const char **)this + 132);
if ( (int)v9 < (int)a4 )
*((_DWORD *)this + 132) = a4;
else
*((_DWORD *)this + 132) = v9;
v10 = (GameManager *)atoi(a3);
v11 = (GameManager *)GameManager::sharedState(v10);
GameVariable = GameManager::getGameVariable(v11, a3);
v13 = *((cocos2d::CCDictionary **)this + 135);
v45 = 0;
v46 = 0;
v35 = v13;
v47 = 0;
v33 = GameVariable;
v14 = strlen(a3);
std::string::__init(&v45, a3, v14);
v15 = (cocos2d::CCObject *)cocos2d::CCString::create(&v45);
cocos2d::CCDictionary::setObject(v35, v15, (int)v10);
std::string::~string((int)&v45);
ParentalOptionsLayer::nextPosition((ParentalOptionsLayer *)v38, this, a4);
v16 = ParentalOptionsLayer::layerForPage(this, a4);
v45 = 0;
v46 = 0;
v47 = 0;
v17 = (int)v16;
v18 = strlen(a2);
std::string::__init(&v45, a2, v18);
v19 = *((cocos2d::CCDictionary **)this + 111);
v42 = 0;
v36 = v19;
v41 = ParentalOptionsLayer::onToggle;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, (const cocos2d::CCPoint *)v38);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, 8.0, 0.0);
ToggleButton = GameToolbox::createToggleButton(
(int)&v45,
(int)v41,
v42,
v33,
v36,
(int)v43,
(int)this,
v17,
0.8,
0.5,
110.0,
(int)v40,
"bigFont.fnt",
0,
0,
*((cocos2d::CCArray **)this + 140));
std::string::~string((int)&v45);
(*(void (__fastcall **)(cocos2d::CCNodeRGBA *, GameManager *))(*(_DWORD *)ToggleButton + 36))(ToggleButton, v10);
CCMenuItemToggler::setSizeMult(ToggleButton, 1.0);
ParentalOptionsLayer::incrementCountForPage(this, a4, v21, v22);
v23 = ParentalOptionsLayer::objectsForPage(this, a4);
cocos2d::CCArray::addObject(v23, ToggleButton);
(*(void (__fastcall **)(cocos2d::CCNodeRGBA *, _DWORD))(*(_DWORD *)ToggleButton + 172))(ToggleButton, 0);
result = (*(int (__fastcall **)(int, _DWORD))(*(_DWORD *)v17 + 172))(v17, 0);
if ( a5 )
{
v34 = *((_DWORD *)this + 134);
memset(v44, 0, sizeof(v44));
v25 = strlen(a5);
std::string::__init(v44, a5, v25);
v26 = (cocos2d::CCObject *)cocos2d::CCString::create(v44);
v37 = (cocos2d::CCDictionary *)ParentalOptionsLayer::infoKey(this, (const char *)v10);
v45 = 0;
v46 = 0;
v47 = 0;
v27 = strlen((const char *)v37);
std::string::__init(&v45, v37, v27);
cocos2d::CCDictionary::setObject(v34, v26);
std::string::~string((int)&v45);
std::string::~string((int)v44);
v29 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_infoIcon_001.png", v28);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v29 + 80))(v29, 1056964608);
v43[0] = ParentalOptionsLayer::onInfo;
v43[1] = 0;
v30 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(v29, 0, (int)this, (int)ParentalOptionsLayer::onInfo, 0);
CCMenuItemSpriteExtra::setSizeMult((int)v30, 2.0);
(*(void (__fastcall **)(cocos2d::CCObject *, GameManager *))(*(_DWORD *)v30 + 36))(v30, v10);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v30);
v31 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v30 + 92);
v32 = (*(int (__fastcall **)(cocos2d::CCNodeRGBA *))(*(_DWORD *)ToggleButton + 96))(ToggleButton);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, -18.0, 16.0);
cocos2d::CCPoint::operator+(v40, v32, v39);
v31(v30, v40);
cocos2d::CCArray::addObject(v23, v30);
return (*(int (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v30 + 172))(v30, 0);
}
return result;
}