//
// MoreSearchLayer::createToggleButton from 0x10062e4b0 to 0x10062e6c1 (529 bytes)
//
// 11 xrefs:
// > MoreSearchLayer::init @ 0x10062d3bc
// > MoreSearchLayer::init @ 0x10062d456
// > MoreSearchLayer::init @ 0x10062d4ee
// > MoreSearchLayer::init @ 0x10062d581
// > MoreSearchLayer::init @ 0x10062d60c
// > MoreSearchLayer::init @ 0x10062d690
// > MoreSearchLayer::init @ 0x10062d72b
// > MoreSearchLayer::init @ 0x10062d7b6
// > MoreSearchLayer::init @ 0x10062d83a
// > MoreSearchLayer::init @ 0x10062d8d4
// > MoreSearchLayer::init @ 0x10062d961
//
// 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 MoreSearchLayer::createToggleButton(
cocos2d::CCObject *a1,
__int64 a2,
unsigned __int64 a3,
unsigned __int64 a4,
_BOOL4 a5,
const cocos2d::CCPoint *a6,
unsigned __int64 *a7)
{
cocos2d::CCSprite *v8; // r12
cocos2d::CCSprite *v9; // rbx
CCMenuItemToggler *v10; // rbx
const char *v11; // r15
cocos2d::CCLabelBMFont *v12; // r15
float *v13; // rax
float *v14; // rax
double v15; // xmm0_8
unsigned __int64 v17; // [rsp+8h] [rbp-58h] BYREF
cocos2d::CCObject *v18; // [rsp+10h] [rbp-50h]
unsigned __int64 v19; // [rsp+18h] [rbp-48h]
unsigned __int64 v20; // [rsp+20h] [rbp-40h]
double v21; // [rsp+2Ch] [rbp-34h] BYREF
_BOOL4 v22; // [rsp+34h] [rbp-2Ch]
double v23; // 0:xmm0_8.8
v22 = a5;
v19 = a4;
v20 = a3;
v8 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v8->setScale)(v8, 0.80000001);
((void (__fastcall *)(cocos2d::CCSprite *, float))v9->setScale)(v9, 0.80000001);
v18 = a1;
v10 = CCMenuItemToggler::create(v8, v9, a1, (cocos2d::SEL_MenuHandler)__PAIR128__(v19, v20));
CCMenuItemToggler::toggle(v10, v22);
(*(void (__fastcall **)(const cocos2d::CCPoint *, CCMenuItemToggler *))(*(_QWORD *)a6 + 440LL))(a6, v10);
*(cocos2d::CCPoint *)&v23 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v21, a6);
((void (__fastcall *)(CCMenuItemToggler *, double *, double))v10->setPosition)(v10, &v21, v23);
CCMenuItemToggler::setSizeMult(v10, 1.5);
if ( (*(_BYTE *)a2 & 1) != 0 )
v11 = *(const char **)(a2 + 16);
else
v11 = (const char *)(a2 + 1);
v12 = cocos2d::CCLabelBMFont::create_3(v11, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)&v18[10].m_nTag + 440LL))(
*(_QWORD *)&v18[10].m_nTag,
v12);
sub_10028CBE0((float *)&v21, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v12->setAnchorPoint)(v12, &v21);
v13 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v8->getContentSize)(v8);
sub_10028CBE0((float *)&v17, (float)((float)(0.5 * *v13) * 0.80000001) + 8.0, 0.0);
sub_10028CCE0(&v21, a7, &v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v12->setPosition)(v12, &v21);
if ( *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getContentSize)(v12) > 80.0 )
{
v14 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getContentSize)(v12);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v12->setScale)(v12, 80.0 / *v14);
}
v15 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getScale)(v12);
if ( *(float *)&v15 <= 0.34999999 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getScale)(v12);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v12->setScale)(v12);
return v10;
}