//
// EditorUI::clickOnPosition from 0x10002da70 to 0x10002dc13 (419 bytes)
//
// 3 xrefs:
// > EditorUI::ccTouchBegan @ 0x10004f243
// > EditorUI::ccTouchMoved @ 0x10004f8fb
// > EditorUI::ccTouchEnded @ 0x10005003d
//
// 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 EditorUI::clickOnPosition(EditorUI *a1, cocos2d::CCPoint a2)
{
__int64 v2; // rsi
int m_selectedMode; // eax
LevelEditorLayer *v4; // r15
cocos2d::CCPoint v5; // xmm0_8
GameObject *v6; // rax
LevelEditorLayer *m_editorLayer; // r15
cocos2d::CCPoint v8; // xmm0_8
GameObject *v9; // rax
GameObject *v10; // r14
GameObject *m_selectedObject; // rax
cocos2d::CCArray *SelectedObjects; // rax
UndoObject *v13; // rax
_BYTE v14[48]; // [rsp-30h] [rbp-30h] BYREF
if ( a1->m_toolbarHeight <= *(float *)(v2 + 4) )
{
cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v14,
(const cocos2d::CCPoint *)a1->m_editorLayer->m_objectLayer);
sub_10028CC90(&a1->m_clickAtPosition, v14);
m_selectedMode = a1->m_selectedMode;
switch ( m_selectedMode )
{
case 3:
m_editorLayer = a1->m_editorLayer;
*(double *)&v8 = sub_10028CC60(v14, &a1->m_clickAtPosition);
v9 = LevelEditorLayer::objectAtPosition(m_editorLayer, v8);
if ( v9 )
{
v10 = v9;
m_selectedObject = a1->m_selectedObject;
if ( !m_selectedObject || m_selectedObject->m_uniqueID != v10->m_uniqueID )
{
SelectedObjects = EditorUI::getSelectedObjects(a1);
v13 = UndoObject::createWithArray(SelectedObjects, Select);
v13->m_redo = 0;
LevelEditorLayer::addToUndoList(a1->m_editorLayer, v13, 0);
EditorUI::selectObject(a1, v10, 0);
}
}
((void (__fastcall *)(EditButtonBar *, bool))a1->m_editButtonBar->setVisible)(
a1->m_editButtonBar,
a1->m_selectedMode == 3);
EditorUI::updateObjectInfoLabel(a1);
((void (__fastcall *)(EditorUI *))a1->updateScaleControl)(a1);
break;
case 2:
if ( !EditorUI::onCreate(a1) && !a1->m_swipeEnabled )
{
v4 = a1->m_editorLayer;
*(double *)&v5 = sub_10028CC60(v14, &a1->m_clickAtPosition);
v6 = LevelEditorLayer::objectAtPosition(v4, v5);
if ( v6 )
{
a1->m_selectedObjectIndex = v6->m_objectID;
EditorUI::updateCreateMenu(a1, 1);
}
}
break;
case 1:
EditorUI::onDelete(a1, (cocos2d::CCObject *)v14);
break;
}
EditorUI::updateButtons(a1);
}
}