//
// GameToolbox::createToggleButton from 0x1004eede0 to 0x1004ef03b (603 bytes)
//
// 129 xrefs:
// > GJRotateCommandLayer::init @ 0x10000276a
// > GJRotateCommandLayer::init @ 0x100002871
// > GJRotateCommandLayer::init @ 0x100002991
// > SetupKeyframePopup::init @ 0x100200e9e
// > SetupKeyframePopup::init @ 0x100200fe8
// > SetupKeyframePopup::init @ 0x100201135
// > SongOptionsLayer::init @ 0x100216914
// > SongOptionsLayer::init @ 0x100216a10
// > SongOptionsLayer::init @ 0x100216b13
// > SetupTriggerPopup::createToggleButton @ 0x1002361ae
// > SetupTriggerPopup::createMultiTriggerItems @ 0x1002363fd
// > SetupTriggerPopup::createMultiTriggerItems @ 0x1002364e7
// > SetupTriggerPopup::createMultiTriggerItems @ 0x1002365d4
// > SetupTriggerPopup::createToggleValueControlAdvanced @ 0x10023ae37
// > SetupTriggerPopup::createCustomToggleValueControl @ 0x10023b0f9
// > CollisionBlockPopup::init @ 0x1002866a9
// > EditorPauseLayer::customSetup @ 0x100292bc0
// > EditorPauseLayer::customSetup @ 0x100292cb6
// > EditorPauseLayer::customSetup @ 0x100292d9d
// > EditorPauseLayer::customSetup @ 0x100292e7f
// > EditorPauseLayer::customSetup @ 0x100292f6e
// > EditorPauseLayer::customSetup @ 0x10029306b
// > EditorPauseLayer::customSetup @ 0x10029314f
// > EditorPauseLayer::customSetup @ 0x10029323a
// > EditorPauseLayer::customSetup @ 0x100293329
// > EditorPauseLayer::customSetup @ 0x10029341f
// > EditorPauseLayer::customSetup @ 0x100293503
// > SetupEnterTriggerPopup::init @ 0x10029b273
// > SetupEnterTriggerPopup::init @ 0x10029b372
// > GJOptionsLayer::addToggleInternal @ 0x10029c874
// > GameOptionsLayer::setupOptions @ 0x1002b1413
// > GameOptionsLayer::setupOptions @ 0x1002b15e9
// > SetupCountTriggerPopup::init @ 0x1002bbf13
// > SetupCountTriggerPopup::init @ 0x1002bc01c
// > SetupCountTriggerPopup::init @ 0x1002bc124
// > GJPathPage::init @ 0x1003006a4
// > SetGroupIDLayer::init @ 0x1003141bd
// > SetGroupIDLayer::init @ 0x1003142bd
// > SetGroupIDLayer::init @ 0x1003143bf
// > SetGroupIDLayer::init @ 0x1003144dd
// > SetupObjectOptionsPopup::init @ 0x10031851d
// > SetupObjectOptionsPopup::init @ 0x10031861e
// > SetupObjectOptionsPopup::init @ 0x10031871f
// > SetupObjectOptionsPopup::init @ 0x100318821
// > SetupObjectOptionsPopup::init @ 0x100318923
// > SetupObjectOptionsPopup::init @ 0x100318a24
// > SetupObjectOptionsPopup::init @ 0x100318b25
// > SetupObjectOptionsPopup::init @ 0x100318c3b
// > SetupObjectOptionsPopup::init @ 0x100318d4e
// > SetupObjectOptionsPopup::init @ 0x100318e48
// > SetupObjectOptionsPopup::init @ 0x100318f3f
// > SetupObjectOptionsPopup::init @ 0x10031902f
// > SetupObjectOptionsPopup::init @ 0x100319128
// > SetupObjectOptionsPopup::init @ 0x100319229
// > SetupObjectOptionsPopup::init @ 0x100319326
// > SetupObjectOptionsPopup::init @ 0x10031943c
// > SetupObjectOptionsPopup::init @ 0x100319545
// > SetupObjectOptionsPopup::init @ 0x10031963e
// > SetupObjectOptionsPopup::init @ 0x100319737
// > SetupObjectOptionsPopup::init @ 0x100319837
// > SetupObjectOptionsPopup::init @ 0x100319930
// > SetupObjectOptionsPopup::init @ 0x100319a30
// > SetupObjectOptionsPopup::init @ 0x100319b38
// > SetupObjectOptionsPopup::init @ 0x100319c4e
// > SetupTeleportPopup::init @ 0x1003596c2
// > SetupTeleportPopup::init @ 0x10035980c
// > SetupTeleportPopup::init @ 0x100359956
// > ShareListLayer::init @ 0x100362832
// > ShareListLayer::init @ 0x100362a6f
// > GJGarageLayer::setupPage @ 0x10036d34e
// > SetupPulsePopup::init @ 0x1003abafa
// > SetupPulsePopup::init @ 0x1003abc04
// > SetupPulsePopup::init @ 0x1003abd1e
// > SetupPulsePopup::init @ 0x1003abe22
// > SetupPulsePopup::init @ 0x1003abf2d
// > SetupPulsePopup::init @ 0x1003ac046
// > SetupPulsePopup::init @ 0x1003ac161
// > SetupEnterEffectPopup::init @ 0x1003f29f9
// > SetupEnterEffectPopup::init @ 0x1003f2af3
// > ConfigureHSVWidget::init @ 0x10043044a
// > ConfigureHSVWidget::init @ 0x10043050a
// > SearchSFXPopup::init @ 0x10044110c
// > CreateParticlePopup::init @ 0x10046fd65
// > CreateParticlePopup::init @ 0x10046fe90
// > CreateParticlePopup::init @ 0x10046ffc1
// > CreateParticlePopup::init @ 0x1004700eb
// > CreateParticlePopup::init @ 0x100470220
// > CreateParticlePopup::init @ 0x10047035b
// > CreateParticlePopup::init @ 0x1004718e3
// > CreateParticlePopup::init @ 0x1004719ed
// > CreateParticlePopup::init @ 0x100471af3
// > CreateParticlePopup::init @ 0x100471c20
// > CreateParticlePopup::init @ 0x100471d32
// > CreateParticlePopup::init @ 0x100471e41
// > CreateParticlePopup::init @ 0x100471f4e
// > CreateParticlePopup::init @ 0x10047205c
// > CreateParticlePopup::init @ 0x10047216d
// > CreateParticlePopup::init @ 0x100472285
// > CreateParticlePopup::init @ 0x1004723a7
// > CreateParticlePopup::init @ 0x1004724ee
// > CreateParticlePopup::init @ 0x1004725ff
// > CreateParticlePopup::init @ 0x100472731
// > SetupCameraModePopup::init @ 0x1004a9161
// > SetupCameraModePopup::init @ 0x1004a9253
// > SetupAreaMoveTriggerPopup::addAreaDefaultControls @ 0x1004d3b5d
// > SetupSmartBlockLayer::init @ 0x1004e6433
// > SetupSmartBlockLayer::init @ 0x1004e652c
// > SetupSmartBlockLayer::init @ 0x1004e661e
// > SetupSmartBlockLayer::init @ 0x1004e6721
// > SetupSmartBlockLayer::init @ 0x1004e682b
// > SetupSmartBlockLayer::init @ 0x1004e6942
// > SetupSmartBlockLayer::init @ 0x1004e6a25
// > GameToolbox::createToggleButton_1 @ 0x1004eed94
// > SetupPortalPopup::init @ 0x10056fc8a
// > SetupPortalPopup::init @ 0x10056fd93
// > SetupCameraEdgePopup::init @ 0x100588855
// > SetupCameraEdgePopup::init @ 0x10058896b
// > SetupCameraEdgePopup::init @ 0x100588a7e
// > SetupCameraEdgePopup::init @ 0x100588b97
// > SongInfoLayer::init @ 0x1006017f0
// > SongInfoLayer::init @ 0x10060190a
// > SetupCameraOffsetTrigger::init @ 0x100662604
// > SetupCameraOffsetTrigger::init @ 0x100662716
// > ColorSelectPopup::init @ 0x100725efe
// > ColorSelectPopup::init @ 0x1007261df
// > OptionsLayer::customSetup @ 0x10079ab70
// > MoreOptionsLayer::addToggle @ 0x10079cdbe
// > MoreVideoOptionsLayer::addToggle @ 0x1007a16de
// > ParentalOptionsLayer::addToggle @ 0x1007a3bde
//
// 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 GameToolbox::createToggleButton(
__int64 a1,
unsigned __int64 a2,
unsigned __int64 a3,
_BOOL4 a4,
const cocos2d::CCPoint *a5,
unsigned __int64 *a6,
float a7,
float a8,
float a9,
cocos2d::CCObject *a10,
cocos2d::CCObject *a11,
float *a12,
const char *a13,
char a14,
int a15,
__int64 a16)
{
cocos2d::CCObject *v17; // r13
cocos2d::CCSprite *v18; // r12
cocos2d::CCSprite *v19; // rbx
CCMenuItemToggler *v20; // rbx
const char *v21; // rdi
cocos2d::CCLabelBMFont *v22; // r15
__int64 v23; // rax
float v24; // xmm1_4
float v25; // xmm0_4
float *v26; // rax
unsigned __int64 v28; // [rsp+8h] [rbp-68h] BYREF
unsigned __int64 v29; // [rsp+10h] [rbp-60h]
float v30; // [rsp+1Ch] [rbp-54h]
float v31; // [rsp+20h] [rbp-50h]
_BOOL4 v32; // [rsp+24h] [rbp-4Ch]
unsigned __int64 *v33; // [rsp+28h] [rbp-48h]
float v34[3]; // [rsp+30h] [rbp-40h]
double v35; // [rsp+3Ch] [rbp-34h] BYREF
float v36; // [rsp+44h] [rbp-2Ch]
double v37; // 0:xmm0_8.8
v31 = a9;
v30 = a8;
v36 = a7;
v33 = a6;
v32 = a4;
v29 = a3;
*(_QWORD *)v34 = a1;
v17 = a11;
if ( !a11 )
v17 = a10;
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v19 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v18->setScale)(v18, v36);
((void (__fastcall *)(cocos2d::CCSprite *, float))v19->setScale)(v19, v36);
v20 = CCMenuItemToggler::create(v19, v18, a10, (cocos2d::SEL_MenuHandler)__PAIR128__(v29, a2));
CCMenuItemToggler::toggle(v20, v32);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemToggler *))(*(_QWORD *)a5 + 440LL))(a5, v20);
*(cocos2d::CCPoint *)&v37 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v35, a5);
((void (__fastcall *)(CCMenuItemToggler *, double *, double))v20->setPosition)(v20, &v35, v37);
CCMenuItemToggler::setSizeMult(v20, 1.5);
if ( (**(_BYTE **)v34 & 1) != 0 )
v21 = *(const char **)(*(_QWORD *)v34 + 16LL);
else
v21 = (const char *)(*(_QWORD *)v34 + 1LL);
v22 = cocos2d::CCLabelBMFont::create_3(v21, a13);
((void (__fastcall *)(cocos2d::CCObject *, cocos2d::CCLabelBMFont *))v17->__vftable[5].update)(v17, v22);
if ( a15 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v22->setTag)(v22);
if ( a14 )
{
sub_10028CBE0((float *)&v35, 0.5, 0.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v22->setAnchorPoint)(v22, &v35);
v34[0] = *a12;
v23 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v18->getContentSize)(v18);
v24 = (float)((float)(0.5 * *(float *)(v23 + 4)) * v36) + a12[1];
v25 = v34[0];
}
else
{
sub_10028CBE0((float *)&v35, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v22->setAnchorPoint)(v22, &v35);
v26 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v18->getContentSize)(v18);
v25 = (float)((float)(0.5 * *v26) * v36) + *a12;
v24 = a12[1];
}
sub_10028CBE0((float *)&v28, v25, v24);
sub_10028CCE0(&v35, v33, &v28);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v22->setPosition)(v22, &v35);
cocos2d::CCLabelBMFont::limitLabelWidth(v22, v31, v30, 0.0);
if ( a16 )
{
sub_10071FCD0(a16, v20);
sub_10071FCD0(a16, v22);
}
return v20;
}