//
// MoreOptionsLayer::addToggle from 0x52dfb4 to 0x52e26c (696 bytes)
//
// 52 xrefs:
// > MoreOptionsLayer::init @ 0x532d2a
// > MoreOptionsLayer::init @ 0x532d3c
// > MoreOptionsLayer::init @ 0x532d4e
// > MoreOptionsLayer::init @ 0x532d60
// > MoreOptionsLayer::init @ 0x532d72
// > MoreOptionsLayer::init @ 0x532d84
// > MoreOptionsLayer::init @ 0x532d9a
// > MoreOptionsLayer::init @ 0x532dac
// > MoreOptionsLayer::init @ 0x532dbe
// > MoreOptionsLayer::init @ 0x532dd0
// > MoreOptionsLayer::init @ 0x532de2
// > MoreOptionsLayer::init @ 0x532df4
// > MoreOptionsLayer::init @ 0x532e06
// > MoreOptionsLayer::init @ 0x532e18
// > MoreOptionsLayer::init @ 0x532e2a
// > MoreOptionsLayer::init @ 0x532e3c
// > MoreOptionsLayer::init @ 0x532e4e
// > MoreOptionsLayer::init @ 0x532e60
// > MoreOptionsLayer::init @ 0x532e72
// > MoreOptionsLayer::init @ 0x532e84
// > MoreOptionsLayer::init @ 0x532e96
// > MoreOptionsLayer::init @ 0x532eae
// > MoreOptionsLayer::init @ 0x532ec0
// > MoreOptionsLayer::init @ 0x532ed2
// > MoreOptionsLayer::init @ 0x532ee4
// > MoreOptionsLayer::init @ 0x533066
// > MoreOptionsLayer::init @ 0x53307e
// > MoreOptionsLayer::init @ 0x533096
// > MoreOptionsLayer::init @ 0x5330ae
// > MoreOptionsLayer::init @ 0x5330cc
// > MoreOptionsLayer::init @ 0x5330e4
// > MoreOptionsLayer::init @ 0x5330fc
// > MoreOptionsLayer::init @ 0x533114
// > MoreOptionsLayer::init @ 0x53312c
// > MoreOptionsLayer::init @ 0x533144
// > MoreOptionsLayer::init @ 0x53315c
// > MoreOptionsLayer::init @ 0x533174
// > MoreOptionsLayer::init @ 0x53318c
// > MoreOptionsLayer::init @ 0x5331aa
// > MoreOptionsLayer::init @ 0x5331c2
// > MoreOptionsLayer::init @ 0x5331da
// > MoreOptionsLayer::init @ 0x5331f2
// > MoreOptionsLayer::init @ 0x533210
// > MoreOptionsLayer::init @ 0x533228
// > MoreOptionsLayer::init @ 0x533240
// > MoreOptionsLayer::init @ 0x533258
// > MoreOptionsLayer::init @ 0x533270
// > MoreOptionsLayer::init @ 0x533288
// > MoreOptionsLayer::init @ 0x5332a0
// > MoreOptionsLayer::init @ 0x5332b8
// > MoreOptionsLayer::init @ 0x5332d0
// > MoreOptionsLayer::init @ 0x5332e8
//
// 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:02 +0000
//
int __fastcall MoreOptionsLayer::addToggle(MoreOptionsLayer *this, const char *a2, char *a3, const char *a4)
{
const char *v4; // r10
int v7; // r0
float v10; // r0
int v11; // r3
int v12; // s15
GameManager *v13; // r9
GameManager *v14; // r0
int GameVariable; // r0
cocos2d::CCDictionary *v16; // r8
size_t v17; // r0
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r0
int v20; // r7
size_t v21; // r0
const cocos2d::CCPoint *v22; // r3
cocos2d::CCNodeRGBA *ToggleButton; // r6
int v24; // r2
int v25; // r3
cocos2d::CCObject *v26; // r10
int result; // r0
size_t v28; // r0
cocos2d::CCObject *v29; // r11
size_t v30; // r0
const char *v31; // r1
int v32; // r5
cocos2d::CCObject *v33; // r5
void (__fastcall *v34)(cocos2d::CCObject *, _BYTE *); // r9
int v35; // r6
int v36; // [sp+30h] [bp-5Ch]
int v37; // [sp+30h] [bp-5Ch]
const cocos2d::CCPoint *v38; // [sp+34h] [bp-58h]
const char *v39; // [sp+34h] [bp-58h]
_BYTE v40[8]; // [sp+44h] [bp-48h] BYREF
_BYTE v41[8]; // [sp+4Ch] [bp-40h] BYREF
_BYTE v42[8]; // [sp+54h] [bp-38h] BYREF
_DWORD (*v43)(MoreOptionsLayer *__hidden, cocos2d::CCObject *); // [sp+5Ch] [bp-30h]
int v44; // [sp+60h] [bp-2Ch]
_DWORD v45[2]; // [sp+64h] [bp-28h] BYREF
int v46[3]; // [sp+6Ch] [bp-20h] BYREF
int v47; // [sp+78h] [bp-14h] BYREF
int v48; // [sp+7Ch] [bp-10h]
int v49; // [sp+80h] [bp-Ch]
v7 = *((_DWORD *)this + 133);
*((_DWORD *)this + 133) = v7 + 1;
v10 = floorf((float)(v7 / 10));
v11 = *((_DWORD *)this + 134);
v12 = LODWORD(v10);
if ( v10 <= 0.0 )
v4 = nullptr;
else
v12 = (int)v10;
if ( v10 > 0.0 )
v4 = (const char *)v12;
if ( v11 < (int)v4 )
*((_DWORD *)this + 134) = v4;
else
*((_DWORD *)this + 134) = v11;
v13 = (GameManager *)atoi(a3);
v14 = (GameManager *)GameManager::sharedState(v13);
GameVariable = GameManager::getGameVariable(v14, a3);
v47 = 0;
v48 = 0;
v49 = 0;
v16 = *((cocos2d::CCDictionary **)this + 136);
v36 = GameVariable;
v17 = strlen(a3);
std::string::__init(&v47, a3, v17);
v18 = (cocos2d::CCObject *)cocos2d::CCString::create(&v47);
cocos2d::CCDictionary::setObject(v16, v18, (int)v13);
std::string::~string((int)&v47);
MoreOptionsLayer::nextPosition((MoreOptionsLayer *)v40, this, v4);
v19 = MoreOptionsLayer::layerForPage(this, v4);
v47 = 0;
v48 = 0;
v49 = 0;
v20 = (int)v19;
v21 = strlen(a2);
std::string::__init(&v47, a2, v21);
v22 = *((const cocos2d::CCPoint **)this + 111);
v44 = 0;
v38 = v22;
v43 = MoreOptionsLayer::onToggle;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, (const cocos2d::CCPoint *)v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, 8.0, 0.0);
ToggleButton = GameToolbox::createToggleButton(
(int)&v47,
(int)v43,
v44,
v36,
v38,
(int)v45,
(int)this,
v20,
0.8,
0.4,
130.0,
(int)v42,
"bigFont.fnt",
0,
0,
nullptr);
std::string::~string((int)&v47);
(*(void (__fastcall **)(cocos2d::CCNodeRGBA *, GameManager *))(*(_DWORD *)ToggleButton + 36))(ToggleButton, v13);
CCMenuItemToggler::setSizeMult(ToggleButton, 1.0);
MoreOptionsLayer::incrementCountForPage(this, v4, v24, v25);
v26 = MoreOptionsLayer::objectsForPage(this, v4);
cocos2d::CCArray::addObject(v26, ToggleButton);
(*(void (__fastcall **)(cocos2d::CCNodeRGBA *, _DWORD))(*(_DWORD *)ToggleButton + 172))(ToggleButton, 0);
result = (*(int (__fastcall **)(int, _DWORD))(*(_DWORD *)v20 + 172))(v20, 0);
if ( a4 )
{
v37 = *((_DWORD *)this + 135);
memset(v46, 0, sizeof(v46));
v28 = strlen(a4);
std::string::__init(v46, a4, v28);
v29 = (cocos2d::CCObject *)cocos2d::CCString::create(v46);
v39 = (const char *)MoreOptionsLayer::infoKey(this, (const char *)v13);
v47 = 0;
v48 = 0;
v49 = 0;
v30 = strlen(v39);
std::string::__init(&v47, v39, v30);
cocos2d::CCDictionary::setObject(v37, v29);
std::string::~string((int)&v47);
std::string::~string((int)v46);
v32 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_infoIcon_001.png", v31);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v32 + 80))(v32, 1056964608);
v45[0] = MoreOptionsLayer::onInfo;
v45[1] = 0;
v33 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(v32, 0, (int)this, (int)MoreOptionsLayer::onInfo, 0);
CCMenuItemSpriteExtra::setSizeMult((int)v33, 2.0);
(*(void (__fastcall **)(cocos2d::CCObject *, GameManager *))(*(_DWORD *)v33 + 36))(v33, v13);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v33);
v34 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v33 + 92);
v35 = (*(int (__fastcall **)(cocos2d::CCNodeRGBA *))(*(_DWORD *)ToggleButton + 96))(ToggleButton);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, -18.0, 16.0);
cocos2d::CCPoint::operator+(v42, v35, v41);
v34(v33, v42);
cocos2d::CCArray::addObject(v26, v33);
return (*(int (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v33 + 172))(v33, 0);
}
return result;
}