//
// SupportLayer::createToggleButton from 0x42cc78 to 0x42ce30 (440 bytes)
//
// 1 xrefs:
// > SupportLayer::customSetup @ 0x42d0aa
//
// 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 SupportLayer::createToggleButton(
int a1,
int a2,
cocos2d::SEL_MenuHandler a3,
bool a4,
cocos2d::CCNode *a5,
const cocos2d::CCPoint *a6,
cocos2d::CCArray *a7)
{
cocos2d::CCSprite *v8; // r8
cocos2d::CCSprite *v9; // r6
CCMenuItemToggler *v10; // r6
cocos2d::CCLabelBMFont *v11; // r4
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r11
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
float *v14; // r0
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r7
float *v16; // r0
void (__fastcall *v17)(cocos2d::CCLabelBMFont *__hidden, float); // r7
int v18; // r1
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+8h] [bp-1Ch]
cocos2d::CCPoint v22; // [sp+1Ch] [bp-8h] BYREF
cocos2d::CCPoint v23; // [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(&v23, a5, a6);
setPosition(v10, &v23);
CCMenuItemToggler::setSizeMult(v10, 1.5);
v11 = cocos2d::CCLabelBMFont::create();
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**(_DWORD **)(a1 + 464) + 220))(*(_DWORD *)(a1 + 464), v11);
setAnchorPoint = v11->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v23, 0.0, 0.5);
setAnchorPoint(v11, &v23);
v13 = v11->setPosition;
v14 = (float *)v8->getContentSize(v8);
cocos2d::CCPoint::CCPoint(&v22, (float)((float)(*v14 * 0.5) * 0.8) + 8.0, 0.0);
cocos2d::CCPoint::operator+(&v23, a6, &v22);
v13(v11, &v23);
if ( v11->getContentSize(v11)->width > 120.0 )
{
setScale = v11->setScale;
v16 = (float *)v11->getContentSize(v11);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(v11, 120.0 / *v16);
}
v17 = v11->setScale;
if ( v11->getScale(v11) > 0.35 )
v18 = 1051931443;
else
v18 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))v11->getScale)(v11);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v17)(v11, v18);
if ( a7 )
{
cocos2d::CCArray::addObject(a7, v10);
cocos2d::CCArray::addObject(a7, v11);
}
return v10;
}