//
// EditorUI::ccTouchEnded from 0x6f09b8 to 0x6f107a (1730 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'EditorUI::ccTouchEnded @ 0x6f1088
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:57:35 +0000
//
GameManager *__fastcall EditorUI::ccTouchEnded(cocos2d::CCNode *this, int a2, int a3)
{
GameManager *result; // r0
int v7; // r3
int v8; // r0
int v9; // r2
GameManager *v10; // r0
int GameVariable; // r8
const cocos2d::CCPoint *v12; // r2
float v13; // r1
const cocos2d::CCPoint *v14; // r2
float v15; // s16
_BOOL4 v16; // r10
UndoObject *v17; // r1
float v18; // s16
GameManager *v19; // r0
GameManager *v20; // r0
GameObject *v21; // r1
unsigned int v22; // r7
int v23; // r8
cocos2d::CCPoint *v24; // r0
int v25; // r0
int v26; // r5
cocos2d::CCObject *v27; // r0
const cocos2d::CCPoint *v28; // r8
float v29; // r1
float v30; // s15
float v31; // r2
const cocos2d::CCPoint *v32; // r2
float v33; // s16
float v34; // r1
int v35; // r5
cocos2d::CCArray *v36; // r0
cocos2d::CCArray *v37; // r5
cocos2d::CCObject *v38; // r1
cocos2d::CCArray *v39; // r0
EditorSFXManager *v40; // r0
const cocos2d::CCPoint *v41; // r2
float v42; // r0
int v43; // r7
cocos2d::CCArray *v44; // r0
cocos2d::CCArray *CycledObject; // r5
cocos2d::CCObject *v46; // r1
EditorSFXManager *v47; // r0
GameObject *Object; // r0
cocos2d::CCArray *v49; // r0
float v50; // r2
float v51; // r3
GameObject *v52; // r0
EditorSFXManager *v53; // r0
EditorSFXManager *v54; // r0
int v55; // r1
int v56; // r6
cocos2d::CCArray *v57; // r0
int v58; // r1
int v59; // r2
int v60; // r3
const cocos2d::CCPoint *v61; // r0
int v62; // r8
int v63; // r10
void (__fastcall *v64)(int, float *); // r10
int v65; // r0
int v66; // r8
void (__fastcall *v67)(int, float *); // r10
int v68; // r0
int v69; // [sp+14h] [bp-60h]
_BYTE v70[8]; // [sp+1Ch] [bp-58h] BYREF
_BYTE v71[8]; // [sp+24h] [bp-50h] BYREF
_BYTE v72[8]; // [sp+2Ch] [bp-48h] BYREF
_BYTE v73[8]; // [sp+34h] [bp-40h] BYREF
float v74; // [sp+3Ch] [bp-38h] BYREF
float v75; // [sp+40h] [bp-34h]
float v76; // [sp+44h] [bp-30h] BYREF
float v77; // [sp+48h] [bp-2Ch]
_BYTE v78[16]; // [sp+4Ch] [bp-28h] BYREF
float v79[4]; // [sp+5Ch] [bp-18h] BYREF
if ( *((_BYTE *)this + 570) && *((_DWORD *)this + 131) == *(_DWORD *)(a2 + 52) )
{
cocos2d::CCNode::stopActionByTag(this, 128);
EditorUI::finishTouchDelay(this, v58, v59, v60);
}
*((_BYTE *)this + 588) = 0;
result = (GameManager *)cocos2d::CCNode::stopActionByTag(this, 123);
v7 = *(_DWORD *)(a2 + 52);
if ( *((_DWORD *)this + 129) == v7 )
{
v8 = *((_DWORD *)this + 144);
*((_DWORD *)this + 129) = -1;
return (GameManager *)(*(int (__fastcall **)(int, int, int))(*(_DWORD *)v8 + 456))(v8, a2, a3);
}
if ( *((_DWORD *)this + 130) == v7 )
{
v8 = *((_DWORD *)this + 148);
*((_DWORD *)this + 130) = -1;
return (GameManager *)(*(int (__fastcall **)(int, int, int))(*(_DWORD *)v8 + 456))(v8, a2, a3);
}
if ( *((_DWORD *)this + 133) == v7 )
{
v8 = *((_DWORD *)this + 149);
*((_DWORD *)this + 133) = -1;
return (GameManager *)(*(int (__fastcall **)(int, int, int))(*(_DWORD *)v8 + 456))(v8, a2, a3);
}
v9 = *((_DWORD *)this + 236);
if ( *(_DWORD *)(v9 + 1428) == 1 )
{
v8 = *(_DWORD *)(v9 + 11240);
return (GameManager *)(*(int (__fastcall **)(int, int, int))(*(_DWORD *)v8 + 456))(v8, a2, a3);
}
if ( *((_BYTE *)this + 568) )
{
*((_BYTE *)this + 568) = 0;
*((_DWORD *)this + 134) = -1;
*((_DWORD *)this + 131) = -1;
*((_BYTE *)this + 1004) = 0;
return result;
}
if ( *((_DWORD *)this + 131) == v7 )
{
v10 = (GameManager *)GameManager::sharedState(result);
GameVariable = GameManager::getGameVariable(v10, "0059");
EditorUI::getTouchPoint((cocos2d::CCTouch *)v70, this);
v15 = COERCE_FLOAT(cocos2d::ccpDistance((cocos2d::CCNode *)((char *)this + 948), (const cocos2d::CCPoint *)v70, v12));
if ( GameVariable )
v16 = v15 < COERCE_FLOAT(GameToolbox::touchUnitsForMM((GameToolbox *)0x3FCCCCCD, v13));
else
v16 = 0;
v18 = COERCE_FLOAT(cocos2d::ccpDistance((cocos2d::CCNode *)((char *)this + 972), (const cocos2d::CCPoint *)v70, v14));
if ( GameVariable )
GameVariable = v18 < COERCE_FLOAT(GameToolbox::touchUnitsForMM((GameToolbox *)0x3FCCCCCD, *(float *)&v17));
*((_DWORD *)this + 131) = -1;
if ( *((_BYTE *)this + 641) && *((_BYTE *)this + 639) && *((_DWORD *)this + 250) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, (const cocos2d::CCPoint *)&unk_D2DB20);
EditorUI::getTouchPoint((cocos2d::CCTouch *)v72, this);
v19 = (GameManager *)cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v73,
*(const cocos2d::CCPoint **)(*((_DWORD *)this + 236) + 2436));
v20 = (GameManager *)GameManager::sharedState(v19);
if ( !GameManager::getGameVariable(v20, "0008")
|| (v21 = *((GameObject **)this + 250)) == nullptr
|| !EditorUI::shouldSnap(this, v21)
|| (v22 = cocos2d::CCPoint::equals((cocos2d::CCPoint *)v72, (cocos2d::CCNode *)((char *)this + 948))) != 0 )
{
v23 = 0;
LABEL_29:
v24 = (cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 250) + 96))(*((_DWORD *)this + 250));
if ( cocos2d::CCPoint::equals(v24, (cocos2d::CCNode *)((char *)this + 660)) )
*((_BYTE *)this + 509) = 1;
v25 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 250) + 96))(*((_DWORD *)this + 250));
cocos2d::CCPoint::operator-(v79, v25, (char *)this + 660);
v26 = *((unsigned __int8 *)this + 509);
if ( !*((_BYTE *)this + 509) )
{
v17 = *((UndoObject **)this + 126);
if ( v17 )
{
LevelEditorLayer::addToUndoList(*((cocos2d::CCArray ***)this + 236), v17, *((unsigned __int8 *)this + 509));
v27 = *((cocos2d::CCObject **)this + 126);
if ( v27 )
{
cocos2d::CCObject::release(v27);
*((_DWORD *)this + 126) = v26;
}
}
}
goto LABEL_67;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (const cocos2d::CCPoint *)v73);
EditorUI::getGridSnappedPos((int)&v74, (int)this, v79);
EditorUI::getRelativeOffset((EditorUI *)v78, this);
v69 = *((_DWORD *)this + 250);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (const cocos2d::CCPoint *)&v74);
EditorUI::applySpecialOffset(&v76, this, v78, v69, v79);
cocos2d::CCPoint::operator+(v79, &v74, &v76);
cocos2d::CCPoint::operator=(&v74, v79);
v61 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 250) + 96))(*((_DWORD *)this + 250));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v78, v61);
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 250) + 92))(*((_DWORD *)this + 250), &v74);
cocos2d::CCPoint::operator-(v79, &v74, v78);
cocos2d::CCPoint::operator=(v71, v79);
if ( cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 167)) )
{
while ( v22 < cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 167)) )
{
v63 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 167), v22);
if ( *(_DWORD *)(v63 + 780) != *(_DWORD *)(*((_DWORD *)this + 250) + 780) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (const cocos2d::CCPoint *)v71);
EditorUI::moveObject(this, v63, v79);
}
++v22;
}
}
cocos2d::CCPoint::operator+(v79, (char *)this + 580, v71);
cocos2d::CCPoint::operator=((char *)this + 580, v79);
if ( (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 144) + 176))(*((_DWORD *)this + 144)) )
{
v62 = *((_DWORD *)this + 144);
}
else
{
if ( !(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 148) + 176))(*((_DWORD *)this + 148)) )
{
if ( (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 149) + 176))(*((_DWORD *)this + 149)) )
{
v66 = *((_DWORD *)this + 149);
v67 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v66 + 92);
v68 = (*(int (__fastcall **)(int))(*(_DWORD *)v66 + 96))(v66);
cocos2d::CCPoint::operator+(v79, v68, v71);
v67(v66, v79);
GJTransformControl::refreshControl(*((GJTransformControl **)this + 149));
}
goto LABEL_94;
}
v62 = *((_DWORD *)this + 148);
}
v64 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v62 + 92);
v65 = (*(int (__fastcall **)(int))(*(_DWORD *)v62 + 96))(v62);
cocos2d::CCPoint::operator+(v79, v65, v71);
v64(v62, v79);
LABEL_94:
v23 = 1;
goto LABEL_29;
}
if ( !*((_BYTE *)this + 637) || v16 )
{
if ( *((_BYTE *)this + 1004) )
{
v23 = 0;
*((_BYTE *)this + 1004) = 0;
LABEL_67:
v52 = *((GameObject **)this + 250);
if ( v52 )
{
if ( *((_BYTE *)this + 641) && *((_BYTE *)this + 639) )
{
if ( *((_BYTE *)v52 + 989) )
v53 = (EditorSFXManager *)(*(int (__fastcall **)(GameObject *, int))(*(_DWORD *)v52 + 764))(v52, 65280);
else
v53 = (EditorSFXManager *)GameObject::deselectObject(v52, (int)v17);
v54 = (EditorSFXManager *)EditorSFXManager::sharedState(v53);
if ( v23 )
v55 = 106;
else
v55 = 105;
EditorSFXManager::playAction(v54, v55);
}
*((_DWORD *)this + 250) = 0;
}
*((_BYTE *)this + 638) = 0;
*((_BYTE *)this + 637) = 0;
*((_BYTE *)this + 641) = 0;
*((_BYTE *)this + 509) = 0;
cocos2d::CCPoint::operator=((char *)this + 648, &unk_D2DB20);
*((_BYTE *)this + 639) = 0;
*((_BYTE *)this + 510) = 0;
cocos2d::CCPoint::operator=((char *)this + 964, (char *)this + 948);
*((_BYTE *)this + 1005) = 0;
v56 = *((unsigned __int8 *)this + 588);
EditorUI::updateButtons((cocos2d::CCArray **)this);
v57 = *((cocos2d::CCArray **)this + 164);
++*((_DWORD *)this + 255);
cocos2d::CCArray::removeAllObjects(v57);
if ( v56 )
{
EditorUI::updateSpecialUIElements((cocos2d::CCArray **)this);
(*(void (__fastcall **)(cocos2d::CCNode *))(*(_DWORD *)this + 588))(this);
*((_BYTE *)this + 588) = 0;
}
return (GameManager *)cocos2d::CCPoint::operator=((char *)this + 972, v70);
}
EditorUI::getTouchPoint((cocos2d::CCTouch *)v79, this);
v42 = COERCE_FLOAT(cocos2d::ccpDistance((cocos2d::CCNode *)((char *)this + 948), (const cocos2d::CCPoint *)v79, v41));
if ( !*((_BYTE *)this + 638) || v42 < 20.0 )
{
if ( *((_DWORD *)this + 235) != 3 )
{
if ( !*((_BYTE *)this + 1040) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (cocos2d::CCNode *)((char *)this + 948));
EditorUI::clickOnPosition((int)this, COERCE_FLOAT(v79), v50, v51);
}
goto LABEL_66;
}
cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v78,
*(const cocos2d::CCPoint **)(*((_DWORD *)this + 236) + 2436));
if ( !*((_DWORD *)this + 250) || !*((_BYTE *)this + 510) )
{
v43 = *((_DWORD *)this + 236);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (const cocos2d::CCPoint *)v78);
v44 = LevelEditorLayer::objectsAtPosition(v43, v79);
CycledObject = (cocos2d::CCArray *)EditorUI::getCycledObject(this, v44, 0);
if ( CycledObject )
{
EditorUI::createUndoSelectObject((cocos2d::CCArray ***)this, 0);
if ( *((_BYTE *)this + 637) )
{
if ( GameVariable )
{
if ( *((_DWORD *)this + 249) )
{
EditorUI::deselectObject(this);
}
else
{
Object = (GameObject *)cocos2d::CCArray::lastObject(*((cocos2d::CCArray **)this + 167));
if ( Object )
{
GameObject::deselectObject(Object, (int)v46);
cocos2d::CCArray::removeLastObject(*((cocos2d::CCArray **)this + 167), 1);
}
}
}
v49 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(CycledObject, v46);
EditorUI::selectObjects(this, v49, 0);
goto LABEL_66;
}
v40 = (EditorSFXManager *)EditorUI::selectObject(this, CycledObject, 0);
goto LABEL_57;
}
}
}
}
else
{
v28 = *(const cocos2d::CCPoint **)(*((_DWORD *)this + 236) + 2436);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v74, v28);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v76, v28);
if ( v74 > v76 )
v29 = v76;
else
v29 = v74;
v30 = fabsf(v74 - v76);
if ( v75 > v77 )
v31 = v77;
else
v31 = v75;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v78, v29, v31, v30, fabsf(v75 - v77));
EditorUI::getTouchPoint((cocos2d::CCTouch *)v79, this);
v33 = COERCE_FLOAT(cocos2d::ccpDistance((cocos2d::CCNode *)((char *)this + 948), (const cocos2d::CCPoint *)v79, v32));
if ( v33 >= COERCE_FLOAT(GameToolbox::touchUnitsForMM((GameToolbox *)0x3FCCCCCD, v34)) )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v79, (const cocos2d::CCRect *)v78);
EditorUI::selectObjectsInRect(this, v79);
}
else
{
v35 = *((_DWORD *)this + 236);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, (const cocos2d::CCPoint *)&v76);
v36 = LevelEditorLayer::objectsAtPosition(v35, v79);
v37 = (cocos2d::CCArray *)EditorUI::getCycledObject(this, v36, 0);
if ( v37 )
{
EditorUI::createUndoSelectObject((cocos2d::CCArray ***)this, 0);
v39 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(v37, v38);
v40 = (EditorSFXManager *)EditorUI::selectObjects(this, v39, 0);
LABEL_57:
v47 = (EditorSFXManager *)EditorSFXManager::sharedState(v40);
EditorSFXManager::playAction(v47, 121);
}
}
}
LABEL_66:
v23 = 0;
goto LABEL_67;
}
return result;
}