//
// EditorUI::onDeleteSelected from 0x7d1d0c to 0x7d1eac (416 bytes)
//
// 5 xrefs:
// > EditorUI::handleEditorAction @ 0xbd809c
// > ??> @ 0x60bf8
// > EditorUI::init @ 0x7cf884
// > EditorUI::setupDeleteMenu @ 0xbde87c
// > ??> @ 0x1542490
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:54:16 +0000
//
__int64 __fastcall EditorUI::onDeleteSelected(EditorUI *this, cocos2d::CCObject *a2)
{
EditorSFXManager *v3; // x0
GameObject *v4; // x1
EditorSFXManager *v6; // x0
unsigned int v7; // w20
cocos2d::CCArray *v8; // x0
cocos2d::CCArray *v9; // x21
bool v10; // cf
unsigned int v11; // w1
GameObject *v12; // x22
unsigned int v13; // w20
int v14; // w22
GameObject *v15; // x1
unsigned int v16; // w1
UndoObject *v17; // x0
v3 = (EditorSFXManager *)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112));
if ( (_DWORD)v3 )
{
v6 = (EditorSFXManager *)EditorSFXManager::sharedState(v3);
v7 = 0;
EditorSFXManager::playAction(v6, 102);
v8 = (cocos2d::CCArray *)EditorBuildStats::noteAction((EditorBuildStats *)(*((_QWORD *)this + 180) + 14704LL));
v9 = (cocos2d::CCArray *)cocos2d::CCArray::create(v8);
while ( 1 )
{
v10 = v7 >= (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112));
v11 = v7++;
if ( v10 )
break;
while ( 1 )
{
v12 = (GameObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 112), v11);
if ( !EditorUI::shouldDeleteObject(this, v12) )
break;
cocos2d::CCArray::addObject(v9, v12);
v10 = v7 >= (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112));
v11 = v7++;
if ( v10 )
goto LABEL_11;
}
}
LABEL_11:
v13 = 0;
v14 = 0;
while ( 1 )
{
v10 = v13 >= (unsigned int)cocos2d::CCArray::count(v9);
v16 = v13++;
if ( v10 )
break;
v15 = (GameObject *)cocos2d::CCArray::objectAtIndex(v9, v16);
if ( *((_DWORD *)v15 + 257) == 747 )
v14 = 1;
EditorUI::deleteObject(this, v15, 1);
}
*(_DWORD *)(*((_QWORD *)this + 180) + 14712LL) += cocos2d::CCArray::count(v9);
v17 = (UndoObject *)UndoObject::createWithArray(v9, 4);
LevelEditorLayer::addToUndoList(*((cocos2d::CCArray ***)this + 180), v17, 0);
if ( v14 )
EditorUI::deselectTargetPortals(this);
goto LABEL_4;
}
v4 = *((GameObject **)this + 187);
if ( !v4 || !EditorUI::shouldDeleteObject(this, v4) )
{
LABEL_4:
EditorUI::updateSpecialUIElements((cocos2d::CCArray **)this);
return EditorUI::updateButtons(this);
}
EditorBuildStats::noteAction((EditorBuildStats *)(*((_QWORD *)this + 180) + 14704LL));
EditorUI::deleteObject(this, *((GameObject **)this + 187), 0);
EditorUI::updateSpecialUIElements((cocos2d::CCArray **)this);
return EditorUI::updateButtons(this);
}