{"type": "func", "start": 4295154288, "end": 4295154707, "name": "EditorUI::clickOnPosition", "pseudocode": "// \n// EditorUI::clickOnPosition from 0x10002da70 to 0x10002dc13 (419 bytes)\n// \n// 3 xrefs:\n// > EditorUI::ccTouchBegan @ 0x10004f243\n// > EditorUI::ccTouchMoved @ 0x10004f8fb\n// > EditorUI::ccTouchEnded @ 0x10005003d\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall EditorUI::clickOnPosition(EditorUI *a1, cocos2d::CCPoint a2)\n{\n  __int64 v2; // rsi\n  int m_selectedMode; // eax\n  LevelEditorLayer *v4; // r15\n  cocos2d::CCPoint v5; // xmm0_8\n  GameObject *v6; // rax\n  LevelEditorLayer *m_editorLayer; // r15\n  cocos2d::CCPoint v8; // xmm0_8\n  GameObject *v9; // rax\n  GameObject *v10; // r14\n  GameObject *m_selectedObject; // rax\n  cocos2d::CCArray *SelectedObjects; // rax\n  UndoObject *v13; // rax\n  _BYTE v14[48]; // [rsp-30h] [rbp-30h] BYREF\n\n  if ( a1->m_toolbarHeight <= *(float *)(v2 + 4) )\n  {\n    cocos2d::CCNode::convertToNodeSpace(\n      (cocos2d::CCNode *)v14,\n      (const cocos2d::CCPoint *)a1->m_editorLayer->m_objectLayer);\n    sub_10028CC90(&a1->m_clickAtPosition, v14);\n    m_selectedMode = a1->m_selectedMode;\n    switch ( m_selectedMode )\n    {\n      case 3:\n        m_editorLayer = a1->m_editorLayer;\n        *(double *)&v8 = sub_10028CC60(v14, &a1->m_clickAtPosition);\n        v9 = LevelEditorLayer::objectAtPosition(m_editorLayer, v8);\n        if ( v9 )\n        {\n          v10 = v9;\n          m_selectedObject = a1->m_selectedObject;\n          if ( !m_selectedObject || m_selectedObject->m_uniqueID != v10->m_uniqueID )\n          {\n            SelectedObjects = EditorUI::getSelectedObjects(a1);\n            v13 = UndoObject::createWithArray(SelectedObjects, Select);\n            v13->m_redo = 0;\n            LevelEditorLayer::addToUndoList(a1->m_editorLayer, v13, 0);\n            EditorUI::selectObject(a1, v10, 0);\n          }\n        }\n        ((void (__fastcall *)(EditButtonBar *, bool))a1->m_editButtonBar->setVisible)(\n          a1->m_editButtonBar,\n          a1->m_selectedMode == 3);\n        EditorUI::updateObjectInfoLabel(a1);\n        ((void (__fastcall *)(EditorUI *))a1->updateScaleControl)(a1);\n        break;\n      case 2:\n        if ( !EditorUI::onCreate(a1) && !a1->m_swipeEnabled )\n        {\n          v4 = a1->m_editorLayer;\n          *(double *)&v5 = sub_10028CC60(v14, &a1->m_clickAtPosition);\n          v6 = LevelEditorLayer::objectAtPosition(v4, v5);\n          if ( v6 )\n          {\n            a1->m_selectedObjectIndex = v6->m_objectID;\n            EditorUI::updateCreateMenu(a1, 1);\n          }\n        }\n        break;\n      case 1:\n        EditorUI::onDelete(a1, (cocos2d::CCObject *)v14);\n        break;\n    }\n    EditorUI::updateButtons(a1);\n  }\n}", "assembly": "; \n; EditorUI::clickOnPosition from 0x10002da70 to 0x10002dc13 (419 bytes)\n; \n; 3 xrefs:\n; > EditorUI::ccTouchBegan @ 0x10004f243\n; > EditorUI::ccTouchMoved @ 0x10004f8fb\n; > EditorUI::ccTouchEnded @ 0x10005003d\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmovss   xmm0, dword ptr [rdi+300h]                                     ; +0x0, 0x10002da70\nucomiss xmm0, dword ptr [rsi+4]                                        ; +0x8, 0x10002da78\nja      locret_10002DC12                                               ; +0xc, 0x10002da7c\npush    rbp                                                            ; +0x12, 0x10002da82\nmov     rbp, rsp                                                       ; +0x13, 0x10002da83\npush    r15                                                            ; +0x16, 0x10002da86\npush    r14                                                            ; +0x18, 0x10002da88\npush    r12                                                            ; +0x1a, 0x10002da8a\npush    rbx                                                            ; +0x1c, 0x10002da8c\nsub     rsp, 10h                                                       ; +0x1d, 0x10002da8d\nmov     rdx, rsi                                                       ; +0x21, 0x10002da91\nmov     rbx, rdi                                                       ; +0x24, 0x10002da94\nmov     rax, [rdi+4E8h]                                                ; +0x27, 0x10002da97\nmov     rsi, [rax+0EB8h]                                               ; +0x2e, 0x10002da9e\nlea     r15, [rbp-28h]                                                 ; +0x35, 0x10002daa5\nmov     rdi, r15                                                       ; +0x39, 0x10002daa9\ncall    cocos2d__CCNode__convertToNodeSpace                            ; +0x3c, 0x10002daac\nlea     r14, [rbx+518h]                                                ; +0x41, 0x10002dab1\nmov     rdi, r14                                                       ; +0x48, 0x10002dab8\nmov     rsi, r15                                                       ; +0x4b, 0x10002dabb\ncall    sub_10028CC90                                                  ; +0x4e, 0x10002dabe\nmov     eax, [rbx+4E0h]                                                ; +0x53, 0x10002dac3\ncmp     eax, 3                                                         ; +0x59, 0x10002dac9\njz      loc_10002DB52                                                  ; +0x5c, 0x10002dacc\ncmp     eax, 2                                                         ; +0x62, 0x10002dad2\njz      short loc_10002DAED                                            ; +0x65, 0x10002dad5\ncmp     eax, 1                                                         ; +0x67, 0x10002dad7\njnz     loc_10002DBFE                                                  ; +0x6a, 0x10002dada\nmov     rdi, rbx                                                       ; +0x70, 0x10002dae0\ncall    EditorUI__onDelete                                             ; +0x73, 0x10002dae3\njmp     loc_10002DBFE                                                  ; +0x78, 0x10002dae8\nmov     rdi, rbx                                                       ; +0x7d, 0x10002daed\ncall    EditorUI__onCreate                                             ; +0x80, 0x10002daf0\ntest    al, al                                                         ; +0x85, 0x10002daf5\njnz     loc_10002DBFE                                                  ; +0x87, 0x10002daf7\ncmp     byte ptr [rbx+304h], 0                                         ; +0x8d, 0x10002dafd\njnz     loc_10002DBFE                                                  ; +0x94, 0x10002db04\nmov     r15, [rbx+4E8h]                                                ; +0x9a, 0x10002db0a\nlea     r12, [rbp-28h]                                                 ; +0xa1, 0x10002db11\nmov     rdi, r12                                                       ; +0xa5, 0x10002db15\nmov     rsi, r14                                                       ; +0xa8, 0x10002db18\ncall    sub_10028CC60                                                  ; +0xab, 0x10002db1b\nmov     rdi, r15                                                       ; +0xb0, 0x10002db20\nmov     rsi, r12                                                       ; +0xb3, 0x10002db23\ncall    LevelEditorLayer__objectAtPosition                             ; +0xb6, 0x10002db26\ntest    rax, rax                                                       ; +0xbb, 0x10002db2b\njz      loc_10002DBFE                                                  ; +0xbe, 0x10002db2e\nmov     eax, [rax+404h]                                                ; +0xc4, 0x10002db34\nmov     [rbx+4C0h], eax                                                ; +0xca, 0x10002db3a\nmov     rdi, rbx                                                       ; +0xd0, 0x10002db40\nmov     esi, 1                                                         ; +0xd3, 0x10002db43\ncall    EditorUI__updateCreateMenu                                     ; +0xd8, 0x10002db48\njmp     loc_10002DBFE                                                  ; +0xdd, 0x10002db4d\nmov     r15, [rbx+4E8h]                                                ; +0xe2, 0x10002db52\nlea     r12, [rbp-28h]                                                 ; +0xe9, 0x10002db59\nmov     rdi, r12                                                       ; +0xed, 0x10002db5d\nmov     rsi, r14                                                       ; +0xf0, 0x10002db60\ncall    sub_10028CC60                                                  ; +0xf3, 0x10002db63\nmov     rdi, r15                                                       ; +0xf8, 0x10002db68\nmov     rsi, r12                                                       ; +0xfb, 0x10002db6b\ncall    LevelEditorLayer__objectAtPosition                             ; +0xfe, 0x10002db6e\ntest    rax, rax                                                       ; +0x103, 0x10002db73\njz      short loc_10002DBCD                                            ; +0x106, 0x10002db76\nmov     r14, rax                                                       ; +0x108, 0x10002db78\nmov     rax, [rbx+520h]                                                ; +0x10b, 0x10002db7b\ntest    rax, rax                                                       ; +0x112, 0x10002db82\njz      short loc_10002DB96                                            ; +0x115, 0x10002db85\nmov     eax, [rax+394h]                                                ; +0x117, 0x10002db87\ncmp     eax, [r14+394h]                                                ; +0x11d, 0x10002db8d\njz      short loc_10002DBCD                                            ; +0x124, 0x10002db94\nmov     rdi, rbx                                                       ; +0x126, 0x10002db96\ncall    EditorUI__getSelectedObjects                                   ; +0x129, 0x10002db99\nmov     rdi, rax                                                       ; +0x12e, 0x10002db9e\nmov     esi, 6                                                         ; +0x131, 0x10002dba1\ncall    UndoObject__createWithArray                                    ; +0x136, 0x10002dba6\nmov     byte ptr [rax+50h], 0                                          ; +0x13b, 0x10002dbab\nmov     rdi, [rbx+4E8h]                                                ; +0x13f, 0x10002dbaf\nmov     rsi, rax                                                       ; +0x146, 0x10002dbb6\nxor     edx, edx                                                       ; +0x149, 0x10002dbb9\ncall    LevelEditorLayer__addToUndoList                                ; +0x14b, 0x10002dbbb\nmov     rdi, rbx                                                       ; +0x150, 0x10002dbc0\nmov     rsi, r14                                                       ; +0x153, 0x10002dbc3\nxor     edx, edx                                                       ; +0x156, 0x10002dbc6\ncall    EditorUI__selectObject                                         ; +0x158, 0x10002dbc8\nxor     esi, esi                                                       ; +0x15d, 0x10002dbcd\ncmp     dword ptr [rbx+4E0h], 3                                        ; +0x15f, 0x10002dbcf\nsetz    sil                                                            ; +0x166, 0x10002dbd6\nmov     rdi, [rbx+2E8h]                                                ; +0x16a, 0x10002dbda\nmov     rax, [rdi]                                                     ; +0x171, 0x10002dbe1\ncall    qword ptr [rax+148h]                                           ; +0x174, 0x10002dbe4\nmov     rdi, rbx                                                       ; +0x17a, 0x10002dbea\ncall    EditorUI__updateObjectInfoLabel                                ; +0x17d, 0x10002dbed\nmov     rax, [rbx]                                                     ; +0x182, 0x10002dbf2\nmov     rdi, rbx                                                       ; +0x185, 0x10002dbf5\ncall    qword ptr [rax+530h]                                           ; +0x188, 0x10002dbf8\nmov     rdi, rbx                                                       ; +0x18e, 0x10002dbfe\ncall    EditorUI__updateButtons                                        ; +0x191, 0x10002dc01\nadd     rsp, 10h                                                       ; +0x196, 0x10002dc06\npop     rbx                                                            ; +0x19a, 0x10002dc0a\npop     r12                                                            ; +0x19b, 0x10002dc0b\npop     r14                                                            ; +0x19d, 0x10002dc0d\npop     r15                                                            ; +0x19f, 0x10002dc0f\npop     rbp                                                            ; +0x1a1, 0x10002dc11\nretn                                                                   ; +0x1a2, 0x10002dc12", "xrefs": ["EditorUI::ccTouchBegan @ 0x10004f243", "EditorUI::ccTouchMoved @ 0x10004f8fb", "EditorUI::ccTouchEnded @ 0x10005003d"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}