//
// GameToolbox::createToggleButton from 0x1400646a0 to 0x140064999 (761 bytes)
//
// 121 xrefs:
// > CollisionBlockPopup::init @ 0x14008b55a
// > ColorSelectPopup::init @ 0x14008eecb
// > ColorSelectPopup::init @ 0x14008f183
// > ConfigureHSVWidget::init @ 0x1400971c8
// > ConfigureHSVWidget::init @ 0x140097279
// > SongOptionsLayer::init @ 0x1400c48ae
// > SongOptionsLayer::init @ 0x1400c498b
// > SongOptionsLayer::init @ 0x1400c4a77
// > EditorPauseLayer::customSetup @ 0x1400dbb2d
// > EditorPauseLayer::customSetup @ 0x1400dbc56
// > EditorPauseLayer::customSetup @ 0x1400dbd78
// > EditorPauseLayer::customSetup @ 0x1400dbea7
// > EditorPauseLayer::customSetup @ 0x1400dbfd1
// > EditorPauseLayer::customSetup @ 0x1400dc100
// > EditorPauseLayer::customSetup @ 0x1400dc239
// > EditorPauseLayer::customSetup @ 0x1400dc373
// > EditorPauseLayer::customSetup @ 0x1400dc494
// > EditorPauseLayer::customSetup @ 0x1400dc5bb
// > EditorPauseLayer::customSetup @ 0x1400dc6e4
// > GJGarageLayer::setupPage @ 0x1402766f2
// > GJPathPage::init @ 0x1402870aa
// > SetupEnterTriggerPopup::init @ 0x14028f58f
// > SetupEnterTriggerPopup::init @ 0x14028f672
// > GJOptionsLayer::addToggleInternal @ 0x140290053
// > GameOptionsLayer::setupOptions @ 0x14029f54d
// > GameOptionsLayer::setupOptions @ 0x14029f7b4
// > ShareListLayer::init @ 0x14030a579
// > ShareListLayer::init @ 0x14030a7db
// > LevelSettingsLayer::init @ 0x140320426
// > OptionsLayer::customSetup @ 0x140372833
// > MoreOptionsLayer::addToggle @ 0x140374e8d
// > MoreVideoOptionsLayer::addToggle @ 0x140379a25
// > ParentalOptionsLayer::addToggle @ 0x14037bce5
// > SetGroupIDLayer::init @ 0x1403fa5e0
// > SetGroupIDLayer::init @ 0x1403fa6e7
// > SetGroupIDLayer::init @ 0x1403fa7fa
// > SetGroupIDLayer::init @ 0x1403fa91b
// > SetupObjectOptionsPopup::init @ 0x1403fe4d7
// > SetupObjectOptionsPopup::init @ 0x1403fe5af
// > SetupObjectOptionsPopup::init @ 0x1403fe687
// > SetupObjectOptionsPopup::init @ 0x1403fe75d
// > SetupObjectOptionsPopup::init @ 0x1403fe83c
// > SetupObjectOptionsPopup::init @ 0x1403fe91b
// > SetupObjectOptionsPopup::init @ 0x1403fe9fa
// > SetupObjectOptionsPopup::init @ 0x1403feae5
// > SetupObjectOptionsPopup::init @ 0x1403febd6
// > SetupObjectOptionsPopup::init @ 0x1403fecb2
// > SetupObjectOptionsPopup::init @ 0x1403fed7d
// > SetupObjectOptionsPopup::init @ 0x1403fee46
// > SetupObjectOptionsPopup::init @ 0x1403fef1d
// > SetupObjectOptionsPopup::init @ 0x1403feffc
// > SetupObjectOptionsPopup::init @ 0x1403ff0eb
// > SetupObjectOptionsPopup::init @ 0x1403ff1d6
// > SetupObjectOptionsPopup::init @ 0x1403ff2b3
// > SetupObjectOptionsPopup::init @ 0x1403ff38a
// > SetupObjectOptionsPopup::init @ 0x1403ff45e
// > SetupObjectOptionsPopup::init @ 0x1403ff536
// > SetupObjectOptionsPopup::init @ 0x1403ff60d
// > SetupObjectOptionsPopup::init @ 0x1403ff6e5
// > SetupObjectOptionsPopup::init @ 0x1403ff7c1
// > SetupObjectOptionsPopup::init @ 0x1403ff8cb
// > SetupAreaMoveTriggerPopup::addAreaDefaultControls @ 0x14040cd81
// > SetupCameraEdgePopup::init @ 0x14041354f
// > SetupCameraEdgePopup::init @ 0x140413641
// > SetupCameraEdgePopup::init @ 0x14041372e
// > SetupCameraEdgePopup::init @ 0x140413820
// > SetupCameraModePopup::init @ 0x1404145d9
// > SetupCameraModePopup::init @ 0x1404146d2
// > SetupCameraOffsetTrigger::init @ 0x1404164e4
// > SetupCameraOffsetTrigger::init @ 0x1404165c6
// > SetupCountTriggerPopup::init @ 0x14041bcc0
// > SetupCountTriggerPopup::init @ 0x14041bdb8
// > SetupCountTriggerPopup::init @ 0x14041beb7
// > SetupEnterEffectPopup::init @ 0x14041ffc6
// > SetupEnterEffectPopup::init @ 0x1404200a4
// > SetupKeyframePopup::init @ 0x14042652c
// > CreateParticlePopup::init @ 0x14042d71d
// > CreateParticlePopup::init @ 0x14042d845
// > CreateParticlePopup::init @ 0x14042d995
// > CreateParticlePopup::init @ 0x14042dae0
// > CreateParticlePopup::init @ 0x14042dc1d
// > CreateParticlePopup::init @ 0x14042dd9d
// > CreateParticlePopup::init @ 0x14042f6b3
// > CreateParticlePopup::init @ 0x14042f7d7
// > CreateParticlePopup::init @ 0x14042f8f8
// > CreateParticlePopup::init @ 0x14042fa10
// > CreateParticlePopup::init @ 0x14042fb36
// > CreateParticlePopup::init @ 0x14042fc56
// > CreateParticlePopup::init @ 0x14042fd70
// > CreateParticlePopup::init @ 0x14042fe94
// > CreateParticlePopup::init @ 0x14042ffa5
// > CreateParticlePopup::init @ 0x1404300b7
// > CreateParticlePopup::init @ 0x1404301f2
// > CreateParticlePopup::init @ 0x140430319
// > CreateParticlePopup::init @ 0x14043043b
// > CreateParticlePopup::init @ 0x140430553
// > SetupPulsePopup::init @ 0x140439269
// > SetupPulsePopup::init @ 0x14043934f
// > SetupPulsePopup::init @ 0x140439459
// > SetupPulsePopup::init @ 0x14043953f
// > SetupPulsePopup::init @ 0x14043962c
// > SetupPulsePopup::init @ 0x14043972d
// > SetupPulsePopup::init @ 0x14043982a
// > SetupSmartBlockLayer::init @ 0x140457425
// > SetupSmartBlockLayer::init @ 0x140457503
// > SetupSmartBlockLayer::init @ 0x1404575db
// > SetupSmartBlockLayer::init @ 0x1404576c2
// > SetupSmartBlockLayer::init @ 0x1404577af
// > SetupSmartBlockLayer::init @ 0x1404578b6
// > SetupSmartBlockLayer::init @ 0x140457997
// > SetupTeleportPopup::init @ 0x1404614a9
// > SetupTriggerPopup::createToggleButton @ 0x140474c97
// > SetupTriggerPopup::createMultiTriggerItems @ 0x140475214
// > SetupTriggerPopup::createMultiTriggerItems @ 0x1404752e3
// > SetupTriggerPopup::createMultiTriggerItems @ 0x1404753bb
// > SetupTriggerPopup::createToggleValueControl @ 0x140476ef9
// > SetupTriggerPopup::createCustomToggleValueControl @ 0x14047719f
// > SearchSFXPopup::init @ 0x140480f99
// > SongInfoLayer::init @ 0x1404938d9
// > SongInfoLayer::init @ 0x1404939f4
// > ??> @ 0x1406c5d18
//
// 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
//
// Hidden C++ exception states: #wind=1
CCMenuItemToggler *__fastcall GameToolbox::createToggleButton(
const char *a1,
cocos2d::SEL_MenuHandler *a2,
bool a3,
cocos2d::CCNode *a4,
struct cocos2d::CCPoint a5,
cocos2d::CCObject *a6,
cocos2d::CCObject *a7,
float a8,
float a9,
float a10,
float *a11,
const char *a12,
char a13,
int a14,
cocos2d::CCArray *a15)
{
cocos2d::CCObject *v19; // rcx
struct cocos2d::CCSprite *v20; // r12
struct cocos2d::CCSprite *v21; // rbx
CCMenuItemToggler *v22; // rsi
CCMenuItemToggler_vtbl *v23; // rbx
struct cocos2d::CCPoint v24; // rbp
struct cocos2d::CCPoint v25; // rax
const char *v26; // rcx
cocos2d::CCLabelBMFont *v27; // rbx
cocos2d::CCLabelBMFont_vtbl *v28; // rdi
const cocos2d::CCPoint *v29; // rax
float *v30; // rdi
float v31; // xmm6_4
float v32; // xmm1_4
float v33; // xmm2_4
const cocos2d::CCPoint *v34; // rax
__int64 v35; // rax
_QWORD *v37; // [rsp+20h] [rbp-A8h] BYREF
const char *v38; // [rsp+28h] [rbp-A0h] BYREF
float *v39; // [rsp+30h] [rbp-98h]
struct cocos2d::CCPoint v40[2]; // [rsp+38h] [rbp-90h] BYREF
v40[1] = (struct cocos2d::CCPoint)a1;
v40[0] = a5;
v39 = a11;
v38 = a12;
v19 = a6;
if ( a7 )
v19 = a7;
v37 = &v19->__vftable;
v20 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v20->setScale_0)(v20);
((void (__fastcall *)(struct cocos2d::CCSprite *))v21->setScale_0)(v21);
v22 = CCMenuItemToggler::create(v21, v20, a6, a2);
CCMenuItemToggler::toggle(v22, a3);
a4->addChild_1(a4, v22);
v23 = v22->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v24 = v40[0];
v25 = cocos2d::CCNode::convertToNodeSpace(a4, v40);
((void (__fastcall *)(CCMenuItemToggler *, struct cocos2d::CCPoint))v23->setPosition_0)(v22, v25);
*(_DWORD *)(*(_QWORD *)&v22->m_nScriptTapHandler + 372LL) = 1069547520;
HIDWORD(v22->m_offButton->m_pfnSelector.adj) = 1069547520;
CCMenuItemToggler::toggle(v22, (bool)v22->m_onButton);
v26 = a1;
if ( *((_QWORD *)a1 + 3) > 0xFu )
v26 = *(const char **)a1;
v27 = cocos2d::CCLabelBMFont::create(v26, v38);
(*(void (__fastcall **)(_QWORD *, cocos2d::CCLabelBMFont *))(*v37 + 448LL))(v37, v27);
if ( a14 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v27->setTag)(v27);
v28 = v27->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a13 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.5, 0.0);
v28->setAnchorPoint(v27, v34);
v35 = (__int64)v20->getContentSize(v20);
v33 = (float)((float)(*(float *)(v35 + 4) * 0.5) * a8) + v39[1];
v32 = *v39;
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.0, 0.5);
v28->setAnchorPoint(v27, v29);
v30 = v39;
v31 = v39[1];
v32 = (float)((float)(v20->getContentSize(v20)->width * 0.5) * a8) + *v30;
v33 = v31;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, v32, v33);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator+)(v24, &v37);
v27->setPosition_0(v27, (const cocos2d::CCPoint *)&v37);
cocos2d::CCLabelBMFont::limitLabelWidth(v27, a10, a9, 0.0);
if ( a15 )
{
cocos2d::CCArray::addObject(a15, v22);
cocos2d::CCArray::addObject(a15, v27);
}
sub_14003A830((__int64)a1);
return v22;
}