//
// cocos2d::CCMenu::ccTouchBegan from 0x1001d8364 to 0x1001d8414 (176 bytes)
//
// 3 xrefs:
// > sub_1001D8458 @ 0x1001d845c
// > SliderTouchLogic::ccTouchBegan @ 0x1002ef1ac
// > ??> @ 0x1007bfbc0
//
// 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 __fastcall cocos2d::CCMenu::ccTouchBegan(cocos2d::CCMenu *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
cocos2d::CCNode *m_pParent; // x21
cocos2d::CCMenuItem *v6; // x0
bool v7; // w20
if ( a1->m_eState || !a1->m_bVisible || !a1->m_bEnabled )
return 0;
m_pParent = a1->m_pParent;
if ( m_pParent )
{
while ( ((unsigned int (__fastcall *)(cocos2d::CCNode *, cocos2d::CCTouch *, cocos2d::CCEvent *))m_pParent->isVisible)(
m_pParent,
a2,
a3) )
{
m_pParent = (cocos2d::CCNode *)((__int64 (__fastcall *)(cocos2d::CCNode *))m_pParent->getParent)(m_pParent);
if ( !m_pParent )
goto LABEL_7;
}
return 0;
}
LABEL_7:
v6 = cocos2d::CCMenu::itemForTouch_1(a1, a2);
a1->m_pSelectedItem = v6;
if ( !v6 )
return 0;
v7 = 1;
a1->m_eState = kCCMenuStateTrackingTouch;
((void (__fastcall *)(cocos2d::CCMenuItem *))v6->selected)(v6);
return v7;
}