//
// EditorUI::ccTouchMoved from 0x140123e90 to 0x1401245d1 (1857 bytes)
//
// 2 xrefs:
// > ??> @ 0x140552670
// > ??> @ 0x1406c99cc
//
// 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
//
// Hidden C++ exception states: #wind=1
void EditorUI::ccTouchMoved(EditorUI *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int m_nId; // eax
_QWORD *p_FLAlert_Clicked; // rcx
CCMenuItemSpriteExtra *m_unlinkBtn; // rcx
__int64 v9; // rcx
cocos2d::CCDirector *v10; // rax
struct cocos2d::CCPoint v11; // rax
struct cocos2d::CCPoint v12; // rax
__int64 v13; // rcx
const struct cocos2d::CCPoint *v14; // r8
struct cocos2d::CCPoint v15; // rax
GameManager *v16; // rcx
float v17; // xmm0_4
unsigned int i; // esi
GameObject *v19; // rbx
cocos2d::CCPoint v20; // rax
cocos2d::CCPoint v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rcx
cocos2d::CCDirector *v27; // rax
struct cocos2d::CCPoint v28; // rax
struct cocos2d::CCPoint v29; // rax
float *v30; // rax
float *v31; // rbx
float v32; // xmm8_4
float v33; // xmm7_4
float v34; // xmm0_4
__int64 v35; // rcx
cocos2d::CCDirector *v36; // rax
struct cocos2d::CCPoint v37; // rax
struct cocos2d::CCPoint v38; // rax
cocos2d::CCPoint v39; // [rsp+20h] [rbp-30h] BYREF
cocos2d::CCPoint v40; // [rsp+28h] [rbp-28h] BYREF
cocos2d::CCPoint v41; // [rsp+80h] [rbp+30h] BYREF
struct cocos2d::CCPoint v42; // [rsp+88h] [rbp+38h] BYREF
cocos2d::CCPoint v43; // [rsp+98h] [rbp+48h] BYREF
m_nId = a2->m_nId;
if ( LODWORD(a1->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable) == m_nId )
{
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
p_FLAlert_Clicked = &a1->m_pScriptKeypadHandlerEntry->cocos2d::CCLayer::__vftable;
LABEL_3:
(*(void (__fastcall **)(_QWORD *, cocos2d::CCTouch *, cocos2d::CCEvent *))(p_FLAlert_Clicked[40] + 16LL))(
p_FLAlert_Clicked + 40,
a2,
a3);
return;
}
if ( HIDWORD(a1->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable) == m_nId )
{
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
p_FLAlert_Clicked = *(_QWORD **)&a1->m_uPreviousPriority;
goto LABEL_3;
}
if ( *(_DWORD *)&a1->m_bMouseEnabled == m_nId )
{
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
p_FLAlert_Clicked = &a1->FLAlert_Clicked;
goto LABEL_3;
}
m_unlinkBtn = a1->m_unlinkBtn;
if ( LODWORD(m_unlinkBtn[4].m_fScaleX) == 1 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)(*((_QWORD *)&m_unlinkBtn[25].m_activateSound.m_data.m_bigStorage + 1)
+ 320LL)
+ 16LL))(*((_QWORD *)&m_unlinkBtn[25].m_activateSound.m_data.m_bigStorage + 1) + 320LL);
return;
}
if ( *(_DWORD *)&a1->m_bTouchEnabled == m_nId )
{
cocos2d::CCTouch::getLocationInView(a2);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
v11 = cocos2d::CCDirector::convertToGL(v10, &v41);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v42, v11);
v12 = cocos2d::CCNode::convertToWorldSpace((EditorUI *)((char *)a1 - 320), &v41);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v42, v12);
if ( BYTE1(a1->m_objectEditorStates._List._Mypair._Myval2._Mysize) )
{
if ( BYTE1(a1->m_copyPasteBtn) )
goto LABEL_49;
if ( fabs(cocos2d::ccpDistance((cocos2d *)&v42, (const struct cocos2d::CCPoint *)&a1->m_enableLinkBtn, v14)) >= 4.0 )
BYTE1(a1->m_copyPasteBtn) = 1;
if ( BYTE1(a1->m_copyPasteBtn) )
{
LABEL_49:
v15 = cocos2d::CCNode::convertToNodeSpace(*(cocos2d::CCNode **)&a1->m_unlinkBtn[7].m_nScriptTapHandler, &v41);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v42, v15);
if ( !cocos2d::CCPoint::equals(&v42) )
{
if ( !HIBYTE(a1->m_objectEditorStates._List._Mypair._Myval2._Myhead) && a1->m_unk3F0 )
{
v16 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v41 = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = ((__int64 (__fastcall *)(_QWORD))sub_14017AB00)(v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v16 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v16, "0008") )
{
v17 = ((float (__fastcall *)(cocos2d::CCObject *))a1->m_unk3F0->__vftable[4].getTag)(a1->m_unk3F0);
if ( (int)v17 == 90 * ((int)v17 / 90) )
{
LOWORD(v41.x) = -25601;
BYTE2(v41.x) = 50;
((void (__fastcall *)(cocos2d::CCObject *, cocos2d::CCPoint *))a1->m_unk3F0->__vftable[18].update)(
a1->m_unk3F0,
&v41);
}
}
}
HIBYTE(a1->m_objectEditorStates._List._Mypair._Myval2._Myhead) = 1;
cocos2d::CCPoint::operator-(&v42, &v43, &a1->m_editGroupBtn);
if ( cocos2d::CCArray::count((cocos2d::CCArray *)a1->m_objectEditorStates._Mask) )
{
for ( i = 0; i < cocos2d::CCArray::count((cocos2d::CCArray *)a1->m_objectEditorStates._Mask); ++i )
{
v19 = (GameObject *)cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)a1->m_objectEditorStates._Mask, i);
cocos2d::CCPoint::CCPoint(&v41);
EditorUI::moveObject((EditorUI *)((char *)a1 - 320), v19, v20);
}
}
else
{
cocos2d::CCPoint::CCPoint(&v41);
EditorUI::moveObject((EditorUI *)((char *)a1 - 320), (GameObject *)a1->m_editSpecialBtn, v21);
}
cocos2d::CCPoint::operator=(&a1->m_editGroupBtn, &v42);
cocos2d::CCPoint::operator+(&a1->m_pScriptAccelerateHandlerEntry, &v41);
cocos2d::CCPoint::operator=(&a1->m_pScriptAccelerateHandlerEntry, &v41);
if ( ((unsigned __int8 (__fastcall *)(cocos2d::CCScriptHandlerEntry *))a1->m_pScriptKeypadHandlerEntry->cocos2d::CCLayer::__vftable[4].encodeWithCoder)(a1->m_pScriptKeypadHandlerEntry) )
{
v22 = ((__int64 (__fastcall *)(cocos2d::CCScriptHandlerEntry *))a1->m_pScriptKeypadHandlerEntry->cocos2d::CCLayer::__vftable[2].getTag)(a1->m_pScriptKeypadHandlerEntry);
cocos2d::CCPoint::operator+(v22, &v41);
a1->m_pScriptKeypadHandlerEntry->cocos2d::CCLayer::__vftable[2].encodeWithCoder(
a1->m_pScriptKeypadHandlerEntry,
(DS_Dictionary *)&v41);
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
return;
}
if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_uPreviousPriority + 328LL))(*(_QWORD *)&a1->m_uPreviousPriority) )
{
v23 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_uPreviousPriority + 200LL))(*(_QWORD *)&a1->m_uPreviousPriority);
cocos2d::CCPoint::operator+(v23, &v41);
(*(void (__fastcall **)(_QWORD, cocos2d::CCPoint *))(**(_QWORD **)&a1->m_uPreviousPriority + 184LL))(
*(_QWORD *)&a1->m_uPreviousPriority,
&v41);
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
return;
}
if ( (*((unsigned __int8 (__fastcall **)(FLAlertLayerProtocol_vtbl *))a1->FLAlert_Clicked + 41))(a1->FLAlertLayerProtocol::__vftable) )
{
v24 = (*((__int64 (__fastcall **)(FLAlertLayerProtocol_vtbl *))a1->FLAlert_Clicked + 25))(a1->FLAlertLayerProtocol::__vftable);
cocos2d::CCPoint::operator+(v24, &v41);
(*((void (__fastcall **)(FLAlertLayerProtocol_vtbl *, cocos2d::CCPoint *))a1->FLAlert_Clicked + 23))(
a1->FLAlertLayerProtocol::__vftable,
&v41);
GJTransformControl::refreshControl((GJTransformControl *)a1->FLAlertLayerProtocol::__vftable);
}
}
}
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
}
else if ( !LOBYTE(a1->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable)
&& (BYTE4(a1->m_objectEditorStates._List._Mypair._Myval2._Myhead)
|| (v25 = cocos2d::CCDirector::sharedDirector(v13),
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v25 + 176LL))(v25) + 88))
|| LOBYTE(a1->m_createButtonBars)) )
{
cocos2d::CCTouch::getLocationInView(a2);
v27 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v26);
v28 = cocos2d::CCDirector::convertToGL(v27, &v43);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v41, v28);
v29 = cocos2d::CCNode::convertToWorldSpace((EditorUI *)((char *)a1 - 320), &v43);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v41, v29);
if ( LODWORD(a1->m_linkBtn) == 3 )
{
cocos2d::CCPoint::operator=(&a1->m_undoBtn, &v41);
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
}
else
{
cocos2d::CCPoint::CCPoint(&v39);
v31 = v30;
v32 = *(float *)(*(_QWORD *)&a1->m_unlinkBtn[27].m_fTransformY + 636LL);
v33 = (float)(floorf(*v30 / v32) + 0.5) * v32;
v34 = floorf(v31[1] / v32);
cocos2d::CCPoint::CCPoint(&v40, v33, (float)(v34 + 0.5) * v32);
EditorUI::getLimitedPosition((EditorUI *)((char *)a1 - 320), (cocos2d::CCPoint)&v43);
cocos2d::CCPoint::operator=(&v41, &v43);
cocos2d::CCPoint::operator=(&a1->m_objectEditorStates._Vec, &v41);
cocos2d::CCTouch::getLocationInView(a2);
v36 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v35);
v37 = cocos2d::CCDirector::convertToGL(v36, &v40);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v43, v37);
v38 = cocos2d::CCNode::convertToWorldSpace((EditorUI *)((char *)a1 - 320), &v39);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v43, v38);
EditorUI::clickOnPosition((EditorUI *)((char *)a1 - 320), (cocos2d::CCPoint)&v43);
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
}
}
else if ( LOBYTE(a1->m_copyPasteBtn) )
{
cocos2d::CCPoint::operator-(&v42, &v41, &a1->m_editGroupBtn);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_unlinkBtn[7].m_nScriptTapHandler + 200LL))(*(_QWORD *)&a1->m_unlinkBtn[7].m_nScriptTapHandler);
cocos2d::CCPoint::CCPoint(&v43);
cocos2d::CCPoint::operator+(&v43, &v39);
(*(void (__fastcall **)(_QWORD, cocos2d::CCPoint *))(**(_QWORD **)&a1->m_unlinkBtn[7].m_nScriptTapHandler + 184LL))(
*(_QWORD *)&a1->m_unlinkBtn[7].m_nScriptTapHandler,
&v39);
EditorUI::constrainGameLayerPosition((EditorUI *)((char *)a1 - 320), -100.0, -100.0);
cocos2d::CCPoint::operator=(&a1->m_editGroupBtn, &v42);
EditorUI::updateSlider((EditorUI *)((char *)a1 - 320));
}
else if ( fabs(cocos2d::ccpDistance((cocos2d *)&v42, (const struct cocos2d::CCPoint *)&a1->m_enableLinkBtn, v14)) >= 20.0 )
{
cocos2d::CCPoint::operator=(&a1->m_editGroupBtn, &v42);
LOBYTE(a1->m_copyPasteBtn) = 1;
cocos2d::CCNode::stopActionByTag((EditorUI *)((char *)a1 - 320), 123);
}
}
}