//
// GameToolbox::createToggleButton from 0x14006e5b0 to 0x14006e8a7 (759 bytes)
//
// 105 xrefs:
// > GameToolbox::createToggleButton_1 @ 0x14006e56d
// > ClearPlatformerSavesPopup::init @ 0x1400a37f8
// > ClearPlatformerSavesOptionsPopup::init @ 0x1400a4a06
// > ColorSelectPopup::init @ 0x140127dc5
// > ColorSelectPopup::init @ 0x14012809b
// > ConfigureHSVWidget::init @ 0x1401302a8
// > ConfigureHSVWidget::init @ 0x140130359
// > SongOptionsLayer::init @ 0x1401659b7
// > SongOptionsLayer::init @ 0x140165a9a
// > SongOptionsLayer::init @ 0x140165b89
// > GJGarageLayer::setupPage @ 0x14037f052
// > GJPathPage::init @ 0x140394e67
// > SetupEnterTriggerPopup::init @ 0x14039a6e1
// > SetupEnterTriggerPopup::init @ 0x14039a7cb
// > GJOptionsLayer::addToggleInternal @ 0x14039b31f
// > ShareListLayer::init @ 0x1404326a0
// > ShareListLayer::init @ 0x14043290f
// > OptionsLayer::customSetup @ 0x1404cb9c6
// > MoreVideoOptionsLayer::addToggle @ 0x1404cf76b
// > ParentalOptionsLayer::addMasterToggle @ 0x1404d1e8e
// > ParentalOptionsLayer::addToggle @ 0x1404d2631
// > SetGroupIDLayer::init @ 0x140590730
// > SetGroupIDLayer::init @ 0x14059083c
// > SetGroupIDLayer::init @ 0x140590954
// > SetGroupIDLayer::init @ 0x140590a7a
// > SetupObjectOptionsPopup::init @ 0x140594fd9
// > SetupObjectOptionsPopup::init @ 0x1405950b8
// > SetupObjectOptionsPopup::init @ 0x140595197
// > SetupObjectOptionsPopup::init @ 0x140595274
// > SetupObjectOptionsPopup::init @ 0x14059535a
// > SetupObjectOptionsPopup::init @ 0x140595440
// > SetupObjectOptionsPopup::init @ 0x140595526
// > SetupObjectOptionsPopup::init @ 0x140595619
// > SetupObjectOptionsPopup::init @ 0x140595711
// > SetupObjectOptionsPopup::init @ 0x1405957f4
// > SetupObjectOptionsPopup::init @ 0x1405958c6
// > SetupObjectOptionsPopup::init @ 0x140595996
// > SetupObjectOptionsPopup::init @ 0x140595a74
// > SetupObjectOptionsPopup::init @ 0x140595b5a
// > SetupObjectOptionsPopup::init @ 0x140595c4c
// > SetupObjectOptionsPopup::init @ 0x140595d3f
// > SetupObjectOptionsPopup::init @ 0x140595e23
// > SetupObjectOptionsPopup::init @ 0x140595f01
// > SetupObjectOptionsPopup::init @ 0x140595fdc
// > SetupObjectOptionsPopup::init @ 0x1405960bb
// > SetupObjectOptionsPopup::init @ 0x140596199
// > SetupObjectOptionsPopup::init @ 0x140596278
// > SetupObjectOptionsPopup::init @ 0x14059635b
// > SetupObjectOptionsPopup::init @ 0x14059646c
// > SetupAreaMoveTriggerPopup::addAreaDefaultControls @ 0x1405a43ba
// > SetupCameraEdgePopup::init @ 0x1405aa997
// > SetupCameraEdgePopup::init @ 0x1405aaa90
// > SetupCameraEdgePopup::init @ 0x1405aab81
// > SetupCameraEdgePopup::init @ 0x1405aac77
// > SetupCameraModePopup::init @ 0x1405aba44
// > SetupCameraModePopup::init @ 0x1405abb42
// > SetupCameraOffsetTrigger::init @ 0x1405ad938
// > SetupCameraOffsetTrigger::init @ 0x1405ada31
// > SetupEnterEffectPopup::init @ 0x1405b540c
// > SetupEnterEffectPopup::init @ 0x1405b54f0
// > SetupKeyframePopup::init @ 0x1405bba3f
// > CreateParticlePopup::init @ 0x1405c2a27
// > CreateParticlePopup::init @ 0x1405c2b59
// > CreateParticlePopup::init @ 0x1405c2cb3
// > CreateParticlePopup::init @ 0x1405c2e03
// > CreateParticlePopup::init @ 0x1405c2f3e
// > CreateParticlePopup::init @ 0x1405c30c3
// > CreateParticlePopup::init @ 0x1405c4a56
// > CreateParticlePopup::init @ 0x1405c4b78
// > CreateParticlePopup::init @ 0x1405c4c9f
// > CreateParticlePopup::init @ 0x1405c4dc1
// > CreateParticlePopup::init @ 0x1405c4edf
// > CreateParticlePopup::init @ 0x1405c4ff3
// > CreateParticlePopup::init @ 0x1405c510c
// > CreateParticlePopup::init @ 0x1405c522f
// > CreateParticlePopup::init @ 0x1405c534d
// > CreateParticlePopup::init @ 0x1405c545a
// > CreateParticlePopup::init @ 0x1405c5591
// > CreateParticlePopup::init @ 0x1405c56b8
// > CreateParticlePopup::init @ 0x1405c57d6
// > CreateParticlePopup::init @ 0x1405c58ee
// > SetupPulsePopup::init @ 0x1405ce9d5
// > SetupPulsePopup::init @ 0x1405ceae8
// > SetupPulsePopup::init @ 0x1405cec24
// > SetupPulsePopup::init @ 0x1405ced41
// > SetupPulsePopup::init @ 0x1405cee56
// > SetupPulsePopup::init @ 0x1405cef89
// > SetupPulsePopup::init @ 0x1405cf0aa
// > SetupSmartBlockLayer::init @ 0x1405ecd74
// > SetupSmartBlockLayer::init @ 0x1405ece59
// > SetupSmartBlockLayer::init @ 0x1405ecf38
// > SetupSmartBlockLayer::init @ 0x1405ed029
// > SetupSmartBlockLayer::init @ 0x1405ed120
// > SetupSmartBlockLayer::init @ 0x1405ed227
// > SetupSmartBlockLayer::init @ 0x1405ed30f
// > SetupTeleportPopup::init @ 0x1405f73a3
// > SetupTriggerPopup::createToggleButton @ 0x14060c0ce
// > SetupTriggerPopup::createMultiTriggerItems @ 0x14060c652
// > SetupTriggerPopup::createMultiTriggerItems @ 0x14060c732
// > SetupTriggerPopup::createMultiTriggerItems @ 0x14060c819
// > SetupTriggerPopup::createToggleValueControlAdvanced @ 0x14060e72e
// > SetupTriggerPopup::createCustomToggleValueControl @ 0x14060e99f
// > SongInfoLayer::init @ 0x140635781
// > SongInfoLayer::init @ 0x1406358ac
// > ??> @ 0x1409116e4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:25:48 +0000
//
// Hidden C++ exception states: #wind=1
cocos2d::CCMenuItem *__fastcall GameToolbox::createToggleButton(
const char *a1,
__int64 a2,
unsigned __int8 a3,
__int64 a4,
__int64 a5,
__int64 a6,
__int64 a7,
float a8,
float a9,
float a10,
float *a11,
const char *a12,
char a13,
int a14,
cocos2d::CCArray *a15)
{
__int64 v19; // rcx
struct cocos2d::CCSprite *v20; // r12
struct cocos2d::CCSprite *v21; // rbx
cocos2d::CCMenuItem *v22; // rsi
__int64 v23; // rbx
__int64 v24; // rbp
__int64 v25; // rax
const char *v26; // rcx
cocos2d::CCLabelBMFont *v27; // rbx
__int64 v28; // rdi
__int64 v29; // rax
float *v30; // rax
float v31; // xmm1_4
float v32; // xmm2_4
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rax
__int64 v37; // [rsp+20h] [rbp-98h] BYREF
const char *v38; // [rsp+28h] [rbp-90h] BYREF
float *v39; // [rsp+30h] [rbp-88h]
_QWORD v40[2]; // [rsp+38h] [rbp-80h] BYREF
v39 = a11;
v40[1] = a1;
v40[0] = a5;
v38 = a12;
v19 = a6;
if ( a7 )
v19 = a7;
v37 = v19;
v20 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v20 + 160LL))(v20);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v21 + 160LL))(v21);
v22 = CCMenuItemToggler::create((int)v21, (int)v20, a6, a2);
CCMenuItemToggler::toggle((__int64)v22, a3);
(*(void (__fastcall **)(__int64, cocos2d::CCMenuItem *))(*(_QWORD *)a4 + 464LL))(a4, v22);
v23 = *(_QWORD *)v22;
v24 = v40[0];
cocos2d::CCNode::convertToNodeSpace(a4, v40, v40[0]);
(*(void (__fastcall **)(cocos2d::CCMenuItem *, __int64))(v23 + 184))(v22, v25);
*(_DWORD *)(*((_QWORD *)v22 + 47) + 372LL) = 1069547520;
*(_DWORD *)(*((_QWORD *)v22 + 48) + 372LL) = 1069547520;
CCMenuItemToggler::toggle((__int64)v22, *((unsigned __int8 *)v22 + 392));
v26 = a1;
if ( *((_QWORD *)a1 + 3) > 0xFu )
v26 = *(const char **)a1;
v27 = cocos2d::CCLabelBMFont::create(v26, v38);
(*(void (__fastcall **)(__int64, cocos2d::CCLabelBMFont *))(*(_QWORD *)v37 + 464LL))(v37, v27);
if ( a14 )
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v27 + 64LL))(v27);
v28 = *(_QWORD *)v27;
if ( a13 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.5, 0.0);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v28 + 288))(v27, v33);
v34 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v20 + 320LL))(v20);
v32 = (float)((float)(*(float *)(v34 + 4) * 0.5) * a8) + v39[1];
v31 = *v39;
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.0, 0.5);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v28 + 288))(v27, v29);
v30 = (float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v20 + 320LL))(v20);
v31 = (float)((float)(*v30 * 0.5) * a8) + *v39;
v32 = v39[1];
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, v31, v32);
cocos2d::CCPoint::operator+(v24, &v37, v35);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64 *))(*(_QWORD *)v27 + 184LL))(v27, &v37);
cocos2d::CCLabelBMFont::limitLabelWidth(v27, a10, a9, 0.0);
if ( a15 )
{
cocos2d::CCArray::addObject(a15, v22);
cocos2d::CCArray::addObject(a15, v27);
}
sub_14003D310((__int64)a1);
return v22;
}