//
// cocos2d::CCMenu::ccTouchBegan from 0xaf20fc to 0xaf21ac (176 bytes)
//
// 4 xrefs:
// > SliderTouchLogic::ccTouchBegan @ 0x594a34
// > `non-virtual thunk to'cocos2d::CCMenu::ccTouchBegan @ 0xaf21b0
// > ??> @ 0x6f738
// > ??> @ 0x120e620
//
// 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
//
bool cocos2d::CCMenu::ccTouchBegan(cocos2d::CCMenu *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
bool m_bEnabled; // w21
cocos2d::CCNode *m_pParent; // x19
cocos2d::CCMenuItem *v8; // x0
cocos2d::CCMenuItem_vtbl *v9; // x1
if ( a1->m_eState == kCCMenuStateWaiting && a1->m_bVisible )
{
m_bEnabled = a1->m_bEnabled;
if ( m_bEnabled )
{
m_pParent = a1->m_pParent;
if ( m_pParent )
{
while ( m_pParent->isVisible(m_pParent) )
{
m_pParent = m_pParent->getParent(m_pParent);
if ( !m_pParent )
goto LABEL_10;
}
}
else
{
LABEL_10:
v8 = cocos2d::CCMenu::itemForTouch(a1, a2);
a1->m_pSelectedItem = v8;
if ( v8 )
{
v9 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_eState = kCCMenuStateTrackingTouch;
v9->selected(v8);
return m_bEnabled;
}
}
}
}
return 0;
}