//
// LevelSettingsLayer::createToggleButton from 0x5701e4 to 0x57035c (376 bytes)
//
// 1 xrefs:
// > LevelSettingsLayer::init @ 0x572152
//
// 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
//
int __fastcall LevelSettingsLayer::createToggleButton(
int a1,
int *a2,
cocos2d::SEL_MenuHandler a3,
bool a4,
cocos2d::CCNode *a5,
const cocos2d::CCPoint *a6)
{
cocos2d::CCSprite *v8; // r5
cocos2d::CCSprite *v9; // r4
CCMenuItemToggler *v10; // r4
int result; // r0
cocos2d::CCLabelBMFont *v12; // r4
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v14)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
float *v15; // r0
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r5
float *v17; // r0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+Ch] [bp-18h]
cocos2d::CCPoint v20; // [sp+1Ch] [bp-8h] BYREF
cocos2d::CCPoint v21; // [sp+24h] [bp+0h] BYREF
v8 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, int))v8->setScale)(v8, 1061997773);
((void (__fastcall *)(cocos2d::CCSprite *, int))v9->setScale)(v9, 1061997773);
v10 = CCMenuItemToggler::create(v8, v9, (cocos2d::CCObject *)a1, a3);
CCMenuItemToggler::toggle(v10, a4);
a5->addChild(a5, v10);
setPosition = v10->setPosition;
cocos2d::CCNode::convertToNodeSpace(&v21, a5, a6);
setPosition(v10, &v21);
CCMenuItemToggler::setSizeMult(v10, 1.5);
result = *a2;
if ( *(_DWORD *)(*a2 - 12) )
{
v12 = cocos2d::CCLabelBMFont::create();
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**(_DWORD **)(a1 + 456) + 220))(
*(_DWORD *)(a1 + 456),
v12);
setAnchorPoint = v12->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v21, 0.0, 0.5);
setAnchorPoint(v12, &v21);
v14 = v12->setPosition;
v15 = (float *)v8->getContentSize(v8);
cocos2d::CCPoint::CCPoint(&v20, (float)((float)(*v15 * 0.5) * 0.8) + 6.0, 0.0);
cocos2d::CCPoint::operator+(&v21, a6, &v20);
v14(v12, &v21);
if ( v12->getContentSize(v12)->width > 110.0 )
{
setScale = v12->setScale;
v17 = (float *)v12->getContentSize(v12);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(v12, 110.0 / *v17);
}
return ((int (__fastcall *)(cocos2d::CCLabelBMFont *, int))v12->setScale)(v12, 1051931443);
}
return result;
}