//
// cocos2d::CCMenuItemToggle::setSelectedIndex from 0x18005bb90 to 0x18005bc83 (243 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800f8fd0
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2f64
//
// 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
//
void __fastcall cocos2d::CCMenuItemToggle::setSelectedIndex(cocos2d::CCMenuItemToggle *this, int a2)
{
cocos2d::CCMenuItemToggle_vtbl *v4; // rax
__int64 v5; // rax
struct cocos2d::CCString *v6; // rdi
_DWORD *v7; // rax
cocos2d::CCString_vtbl *v8; // rbx
float *v9; // rax
float v10; // [rsp+30h] [rbp+8h] BYREF
float v11; // [rsp+34h] [rbp+Ch]
float v12; // [rsp+40h] [rbp+18h] BYREF
if ( a2 != this->m_nScriptTapHandler && (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 48)) )
{
v4 = this->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
this->m_nScriptTapHandler = a2;
v5 = ((__int64 (__fastcall *)(cocos2d::CCMenuItemToggle *, __int64))v4->getChildByTag)(this, 3233828865LL);
if ( v5 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 504LL))(v5, 0);
v6 = cocos2d::CCArray::stringAtIndex(*((cocos2d::CCArray **)this + 48), this->m_nScriptTapHandler);
((void (__fastcall *)(cocos2d::CCMenuItemToggle *, struct cocos2d::CCString *, _QWORD, __int64))this->addChild)(
this,
v6,
0,
3233828865LL);
v7 = (_DWORD *)((__int64 (__fastcall *)(struct cocos2d::CCString *))v6->__vftable[4].isEqual)(v6);
cocos2d::cc_timeval::operator=(&v10, v7);
((void (__fastcall *)(cocos2d::CCMenuItemToggle *, float *))this->setContentSize)(this, &v10);
v8 = v6->__vftable;
v9 = kmVec2Fill(&v12, v10 * 0.5, v11 * 0.5);
((void (__fastcall *)(struct cocos2d::CCString *, float *))v8[2].encodeWithCoder)(v6, v9);
}
}