//
// EditorUI::clickOnPosition from 0x1400e26e0 to 0x1400e286c (396 bytes)
//
// 8 xrefs:
// > EditorUI::ccTouchBegan @ 0x140123b60
// > EditorUI::ccTouchBegan @ 0x140123c28
// > EditorUI::ccTouchMoved @ 0x1401244b3
// > EditorUI::ccTouchEnded @ 0x1401251cb
// > ??> @ 0x14066e568
// > ??> @ 0x14066e57c
// > ??> @ 0x14066e58c
// > ??> @ 0x1406c8b8c
//
// 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 EditorUI::clickOnPosition(EditorUI *a1, cocos2d::CCPoint a2)
{
struct cocos2d::CCPoint v3; // rax
cocos2d::CCObject *v4; // rdx
int m_selectedMode; // eax
cocos2d::CCPoint v6; // rax
GameObject *v7; // rax
cocos2d::CCPoint v8; // rax
GameObject *v9; // rax
GameObject *m_selectedObject; // rdx
GameObject *v11; // rdi
bool v12; // r8
cocos2d::CCPoint v13; // [rsp+30h] [rbp+8h] BYREF
if ( a1->m_toolbarHeight <= *(float *)(*(_QWORD *)&a2 + 4LL) )
{
v3 = cocos2d::CCNode::convertToNodeSpace(a1->m_editorLayer->m_objectLayer, &v13);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_clickAtPosition, v3);
m_selectedMode = a1->m_selectedMode;
switch ( m_selectedMode )
{
case 1:
EditorUI::onDelete(a1, v4);
EditorUI::updateButtons(a1);
return;
case 2:
if ( !EditorUI::onCreate(a1) && !a1->m_swipeEnabled )
{
cocos2d::CCPoint::CCPoint(&v13, &a1->m_clickAtPosition);
v7 = LevelEditorLayer::objectAtPosition(a1->m_editorLayer, v6);
if ( v7 )
{
a1->m_selectedObjectIndex = v7->m_objectID;
EditorUI::updateCreateMenu(a1, 1);
EditorUI::updateButtons(a1);
return;
}
}
break;
case 3:
cocos2d::CCPoint::CCPoint(&v13, &a1->m_clickAtPosition);
v9 = LevelEditorLayer::objectAtPosition(a1->m_editorLayer, v8);
v11 = v9;
if ( v9 )
{
m_selectedObject = a1->m_selectedObject;
if ( !m_selectedObject || m_selectedObject->m_uniqueID != v9->m_uniqueID )
{
EditorUI::createUndoSelectObject(a1, 0);
EditorUI::selectObject(a1, v11, v12);
}
}
if ( a1->m_selectedMode == 3 )
LOBYTE(m_selectedObject) = 1;
else
m_selectedObject = nullptr;
a1->m_editButtonBar->setVisible(a1->m_editButtonBar, (bool)m_selectedObject);
EditorUI::updateObjectInfoLabel(a1);
a1->updateScaleControl(&a1->GJScaleControlDelegate);
break;
}
EditorUI::updateButtons(a1);
}
}