//
// cocos2d::CCMenu::giveMenuTouchPriority from 0x1800593c0 to 0x180059443 (131 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2af0
//
// 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::CCMenu::giveMenuTouchPriority(cocos2d::CCMenu *this)
{
cocos2d::CCMenuItem *m_pSelectedItem; // rcx
struct cocos2d::CCDirector *v3; // rax
cocos2d::CCMenu_vtbl *v4; // rbx
__int64 v5; // rax
__int64 v6; // rdx
if ( this->m_eState == kCCMenuStateTrackingTouch )
{
m_pSelectedItem = this->m_pSelectedItem;
if ( m_pSelectedItem )
{
((void (__fastcall *)(cocos2d::CCMenuItem *))m_pSelectedItem->unselected)(m_pSelectedItem);
this->m_pSelectedItem = nullptr;
}
this->m_eState = kCCMenuStateWaiting;
}
((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))this->setTouchEnabled)(this, 0);
v3 = cocos2d::CCDirector::sharedDirector();
v4 = this->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v5 = ((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v3->getTouchDispatcher)(v3);
((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))v4->setTouchPriority)(
this,
(unsigned int)(*(_DWORD *)(v5 + 124) - 1));
LOBYTE(v6) = 1;
((void (__fastcall *)(cocos2d::CCMenu *, __int64))this->setTouchEnabled)(this, v6);
}