//
// UILayer::processUINodeTouch from 0x30d804 to 0x30d9b4 (432 bytes)
//
// 1 xrefs:
// > UILayer::processUINodesTouch @ 0x30da1c
//
// 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 UILayer::processUINodeTouch(UILayer *a1, GJUITouchEvent a2, int a3, cocos2d::CCPoint a4, GJUINode *a5, double a6)
{
char v8; // r5
cocos2d::CCPoint v9; // r1
int v10; // r0
int v11; // r6
char v13; // r11
cocos2d::CCPoint v14; // r1
int active; // r0
char v16; // r3
char v17; // r3
GJBaseGameLayer *m_gameLayer; // r0
int v19; // r1
double v20; // [sp+0h] [bp-1Ch]
cocos2d::CCPoint v21; // [sp+Ch] [bp-10h] BYREF
v8 = a2;
if ( a2 == Pressed )
{
cocos2d::CCNode::convertToNodeSpace(&v21, (cocos2d::CCNode *)LODWORD(a4.y), (const cocos2d::CCPoint *)LODWORD(a4.x));
LODWORD(v9.x) = &v21;
v10 = GJUINode::touchTest((GJUINode *)LODWORD(a4.y), v9);
v11 = v10;
if ( !v10 )
return 0;
*(_DWORD *)(LODWORD(a4.y) + 288) = a3;
if ( v10 == 1 )
{
GJUINode::toggleHighlight((GJUINode *)LODWORD(a4.y), 1, 1);
GJBaseGameLayer::queueButton(a1->m_gameLayer, v11, v11, *(_BYTE *)(LODWORD(a4.y) + 321), a6);
return 1;
}
if ( (unsigned int)(v10 - 2) > 1 )
{
*(_DWORD *)(LODWORD(a4.y) + 324) = 0;
*(_BYTE *)(LODWORD(a4.y) + 320) = 1;
return 1;
}
GJUINode::toggleHighlight((GJUINode *)LODWORD(a4.y), v10, 1);
GJBaseGameLayer::queueButton(a1->m_gameLayer, v11, 1, *(_BYTE *)(LODWORD(a4.y) + 321), a6);
GJBaseGameLayer::queueButton(a1->m_gameLayer, 5, 1, *(_BYTE *)(LODWORD(a4.y) + 321), a6);
LABEL_16:
*(_DWORD *)(LODWORD(a4.y) + 324) = v11;
return 1;
}
if ( *(_DWORD *)(LODWORD(a4.y) + 288) != a3 )
return 0;
if ( a2 != Moved )
{
if ( a2 == Ended )
{
v17 = *(_BYTE *)(LODWORD(a4.y) + 321);
v20 = a6;
m_gameLayer = a1->m_gameLayer;
if ( *(_BYTE *)(LODWORD(a4.y) + 322) )
{
v19 = 1;
}
else
{
GJBaseGameLayer::queueButton(m_gameLayer, *(_DWORD *)(LODWORD(a4.y) + 324), 0, v17, a6);
v17 = *(_BYTE *)(LODWORD(a4.y) + 321);
v20 = a6;
v19 = 5;
m_gameLayer = a1->m_gameLayer;
}
GJBaseGameLayer::queueButton(m_gameLayer, v19, 0, v17, v20);
GJUINode::touchEnded((GJUINode *)LODWORD(a4.y));
}
return 1;
}
if ( !*(_BYTE *)(LODWORD(a4.y) + 322) )
{
v13 = *(_BYTE *)(LODWORD(a4.y) + 323);
if ( !v13 )
{
cocos2d::CCNode::convertToNodeSpace(
&v21,
(cocos2d::CCNode *)LODWORD(a4.y),
(const cocos2d::CCPoint *)LODWORD(a4.x));
LODWORD(v14.x) = &v21;
active = GJUINode::activeTouchTest((GJUINode *)LODWORD(a4.y), v14);
v11 = active;
if ( (unsigned int)(active - 2) > 1 )
{
if ( !*(_BYTE *)(LODWORD(a4.y) + 320) )
{
v16 = *(_BYTE *)(LODWORD(a4.y) + 321);
*(_BYTE *)(LODWORD(a4.y) + 320) = v8;
GJBaseGameLayer::queueButton(a1->m_gameLayer, *(_DWORD *)(LODWORD(a4.y) + 324), 0, v16, a6);
if ( !*(_BYTE *)(LODWORD(a4.y) + 317) )
GJUINode::touchEnded((GJUINode *)LODWORD(a4.y));
*(_DWORD *)(LODWORD(a4.y) + 324) = 0;
}
return 1;
}
if ( *(_DWORD *)(LODWORD(a4.y) + 324) != active )
{
*(_BYTE *)(LODWORD(a4.y) + 320) = v13;
GJUINode::highlightButton((GJUINode *)LODWORD(a4.y), active);
GJBaseGameLayer::queueButton(a1->m_gameLayer, v11, v8, *(_BYTE *)(LODWORD(a4.y) + 321), a6);
GJBaseGameLayer::queueButton(
a1->m_gameLayer,
*(_DWORD *)(LODWORD(a4.y) + 324),
v13,
*(_BYTE *)(LODWORD(a4.y) + 321),
a6);
goto LABEL_16;
}
}
}
return 1;
}