//
// GJAccountSettingsLayer::createToggleButton from 0x1002a1220 to 0x1002a13e0 (448 bytes)
//
// 8 xrefs:
// > GJAccountSettingsLayer::init @ 0x10029fdbd
// > GJAccountSettingsLayer::init @ 0x10029fe7b
// > GJAccountSettingsLayer::init @ 0x10029ff2d
// > GJAccountSettingsLayer::init @ 0x1002a014e
// > GJAccountSettingsLayer::init @ 0x1002a0201
// > GJAccountSettingsLayer::init @ 0x1002a0413
// > GJAccountSettingsLayer::init @ 0x1002a04d1
// > GJAccountSettingsLayer::init @ 0x1002a0582
//
// 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
//
CCMenuItemToggler *__fastcall GJAccountSettingsLayer::createToggleButton(
cocos2d::CCObject *a1,
__int64 a2,
unsigned __int64 a3,
unsigned __int64 a4,
_BOOL4 a5,
const cocos2d::CCPoint *a6,
float a7,
float a8,
unsigned __int64 *a9)
{
cocos2d::CCSprite *v10; // r15
cocos2d::CCSprite *v11; // r14
CCMenuItemToggler *v12; // r14
const char *v13; // r13
cocos2d::CCLabelBMFont *v14; // r13
float *v15; // rax
unsigned __int64 v17; // [rsp+0h] [rbp-60h] BYREF
cocos2d::CCObject *v18; // [rsp+8h] [rbp-58h]
unsigned __int64 v19; // [rsp+10h] [rbp-50h]
unsigned __int64 v20; // [rsp+18h] [rbp-48h]
double v21; // [rsp+24h] [rbp-3Ch] BYREF
float v22; // [rsp+2Ch] [rbp-34h]
float v23; // [rsp+30h] [rbp-30h]
_BOOL4 v24; // [rsp+34h] [rbp-2Ch]
double v25; // 0:xmm0_8.8
v22 = a8;
v23 = a7;
v24 = a5;
v19 = a4;
v20 = a3;
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setScale)(v10, 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, float))v11->setScale)(v11, 0.5);
v18 = a1;
v12 = CCMenuItemToggler::create(v10, v11, a1, (cocos2d::SEL_MenuHandler)__PAIR128__(v19, v20));
CCMenuItemToggler::toggle(v12, v24);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemToggler *))(*(_QWORD *)a6 + 440LL))(a6, v12);
*(cocos2d::CCPoint *)&v25 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v21, a6);
((void (__fastcall *)(CCMenuItemToggler *, double *, double))v12->setPosition)(v12, &v21, v25);
CCMenuItemToggler::setSizeMult(v12, 1.5);
if ( (*(_BYTE *)a2 & 1) != 0 )
v13 = *(const char **)(a2 + 16);
else
v13 = (const char *)(a2 + 1);
v14 = cocos2d::CCLabelBMFont::create_3(v13, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)&v18[10].m_nTag + 440LL))(
*(_QWORD *)&v18[10].m_nTag,
v14);
sub_10028CBE0((float *)&v21, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v14->setAnchorPoint)(v14, &v21);
v15 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v10->getContentSize)(v10);
sub_10028CBE0((float *)&v17, (float)((float)(*v15 * 0.5) * 0.5) + 4.0, 0.0);
sub_10028CCE0(&v21, a9, &v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v14->setPosition)(v14, &v21);
cocos2d::CCLabelBMFont::limitLabelWidth(v14, v23, v22, 0.0);
return v12;
}