//
// UIOptionsLayer::ccTouchBegan from 0x8d8d24 to 0x8d8e8c (360 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'UIOptionsLayer::ccTouchBegan @ 0x8d8e90
// > ??> @ 0x75be8
// > ??> @ 0x119e690
//
// 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 UIOptionsLayer::ccTouchBegan(UIOptionsLayer *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int v5; // w19
int v6; // w22
GJUINode *Node; // x20
float v8; // s0
float v9; // s1
__int64 v10; // x0
float v11; // s0
float v12; // s1
int v14; // w0
cocos2d::CCPoint v15; // [xsp+60h] [xbp+60h] BYREF
_BYTE v16[8]; // [xsp+68h] [xbp+68h] BYREF
__int64 v17; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v18; // 0:s0.4,4:s1.4
cocos2d::CCTouch::getLocation(a2);
v5 = 0;
cocos2d::CCNode::convertToNodeSpace(a1, &v15);
if ( a1->m_dual )
v6 = 4;
else
v6 = 1;
while ( 1 )
{
Node = UIOptionsLayer::getNode(a1, v5);
if ( Node->isVisible(Node) )
{
v18 = cocos2d::CCNode::convertToNodeSpace(Node, &v15);
if ( GJUINode::touchTest(Node, v18) )
break;
}
if ( ++v5 == v6 )
return 1;
}
if ( a1->m_dual )
{
v14 = Node->getTag(Node);
UIOptionsLayer::toggleUIGroup(a1, v14);
}
Node->m_touchID = a2->m_nId;
cocos2d::CCPoint::operator=(&Node->m_touchPosition, v8, v9);
v10 = (__int64)Node->getPosition(Node);
cocos2d::CCPoint::operator-(&v17, v16, v10);
cocos2d::CCPoint::operator=(&Node->m_touchDelta, v11, v12);
return 1;
}