//
// LevelSettingsLayer::createToggleButton from 0xa352e8 to 0xa35538 (592 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::init @ 0xa36fc8
// > ??> @ 0x723f0
//
// 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
//
__int64 __fastcall LevelSettingsLayer::createToggleButton(
__int64 a1,
_QWORD *a2,
void (__cdecl *a3)(cocos2d::CCObject *),
size_t a4,
bool a5,
cocos2d::CCNode *a6,
const cocos2d::CCPoint *a7)
{
cocos2d::CCSprite *v12; // x21
cocos2d::CCSprite *v13; // x20
CCMenuItemToggler *v14; // x20
cocos2d::CCNode *v15; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCLabelBMFont *v18; // x20
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v20; // x0
const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x1
void (__fastcall *v22)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
float *v23; // x0
float width; // s0
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // x21
float *v26; // x0
cocos2d::CCPoint v27; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v28; // [xsp+90h] [xbp+90h] BYREF
cocos2d::CCPoint v29; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v30; // 0:^70.16
v30.ptr = a3;
v30.adj = a4;
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v13 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
v12->setScale(v12, 0.8);
v13->setScale(v13, 0.8);
v14 = CCMenuItemToggler::create(v12, v13, (cocos2d::CCObject *)a1, v30);
CCMenuItemToggler::toggle(v14, a5);
a6->addChild(a6, v14);
v15 = a6;
setPosition = v14->setPosition;
v29 = cocos2d::CCNode::convertToNodeSpace(v15, a7);
((void (__fastcall *)(CCMenuItemToggler *, cocos2d::CCPoint *, float, float))setPosition)(v14, &v28, v29.x, v29.y);
CCMenuItemToggler::setSizeMult(v14, 1.5);
if ( *(_QWORD *)(*a2 - 24LL) )
{
v18 = cocos2d::CCLabelBMFont::create();
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 440LL))(
*(_QWORD *)(a1 + 576),
v18);
setAnchorPoint = v18->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v28, 0.0, 0.5);
setAnchorPoint(v18, &v28);
v20 = v12;
getContentSize = v12->getContentSize;
v22 = v18->setPosition;
v23 = (float *)getContentSize(v20);
cocos2d::CCPoint::CCPoint(&v27, (float)((float)(*v23 * 0.5) * 0.8) + 6.0, 0.0);
cocos2d::CCPoint::operator+(&v28, a7, &v27);
v22(v18, &v28);
width = v18->getContentSize(v18)->width;
if ( width > 110.0 )
{
setScale = v18->setScale;
v26 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v18->getContentSize)(v18, width);
setScale(v18, 110.0 / *v26);
}
v18->setScale(v18, 0.35);
}
return _stack_chk_guard;
}