//
// EditorUI::onDeleteSelected from 0x100008260 to 0x1000084fe (670 bytes)
//
// 3 xrefs:
// > EditorUI::handleEditorAction @ 0x10060c711
// > EditorUI::init @ 0x100006075
// > EditorUI::setupDeleteMenu @ 0x10063b3e4
//
// This function is hookable on this platform (idp: pc, 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:18:48 +0000
//
__int64 __fastcall EditorUI::onDeleteSelected(_QWORD *a1)
{
__int64 v2; // rdi
__int64 v3; // rax
__int64 v4; // rdi
__int64 v5; // r14
unsigned int v6; // r15d
__int64 v7; // rdi
__int64 v8; // r12
char v9; // r13
unsigned int v10; // r15d
__int64 v11; // r12
__int64 v12; // rax
__int64 v13; // r14
__int64 v14; // rax
v2 = a1[112];
if ( (unsigned int)sub_1007FEF90(v2) )
{
v3 = EditorSFXManager::sharedState(v2);
EditorSFXManager::playAction_1(v3, 102);
v4 = a1[180] + 14704LL;
EditorBuildStats::noteAction(v4);
v5 = sub_1007FE900(v4);
if ( (unsigned int)sub_1007FEF90(a1[112]) )
{
v6 = 0;
do
{
v7 = a1[112];
v8 = sub_1007FEFE0(v7, v6);
if ( (unsigned __int8)EditorUI::shouldDeleteObject(v7) )
sub_1007FEBF0(v5, v8);
++v6;
}
while ( v6 < (unsigned int)sub_1007FEF90(a1[112]) );
}
if ( (unsigned int)sub_1007FEF90(v5) )
{
v9 = 0;
v10 = 0;
do
{
v11 = sub_1007FEFE0(v5, v10);
v9 |= *(_DWORD *)(v11 + 1028) == 747;
*(_BYTE *)(v11 + 1132) = *(_BYTE *)(v11 + 1133);
EditorUI::deselectObject(a1, v11);
LevelEditorLayer::removeObject(a1[180], v11, 1);
EditorUI::deactivateRotationControl(a1);
EditorUI::deactivateScaleControl(a1);
sub_100611790(a1);
++v10;
}
while ( v10 < (unsigned int)sub_1007FEF90(v5) );
*(_DWORD *)(a1[180] + 14712LL) += sub_1007FEF90(v5);
v12 = UndoObject::createWithArray(v5, 4);
LevelEditorLayer::addToUndoList(a1[180], v12, 0);
if ( (v9 & 1) != 0 )
sub_1005B94E0(a1);
}
else
{
*(_DWORD *)(a1[180] + 14712LL) += sub_1007FEF90(v5);
v14 = UndoObject::createWithArray(v5, 4);
LevelEditorLayer::addToUndoList(a1[180], v14, 0);
}
}
else if ( a1[187] )
{
if ( (unsigned __int8)EditorUI::shouldDeleteObject(v2) )
{
EditorBuildStats::noteAction(a1[180] + 14704LL);
v13 = a1[187];
if ( v13 )
{
*(_BYTE *)(v13 + 1132) = *(_BYTE *)(v13 + 1133);
EditorUI::deselectObject(a1, v13);
LevelEditorLayer::removeObject(a1[180], v13, 0);
EditorUI::deactivateRotationControl(a1);
EditorUI::deactivateScaleControl(a1);
sub_100611790(a1);
}
}
}
if ( !a1[187] && !(unsigned int)sub_1007FEF90(a1[112]) )
{
EditorUI::deactivateRotationControl(a1);
EditorUI::deactivateScaleControl(a1);
sub_100611790(a1);
}
EditorUI::updateObjectInfoLabel(a1);
(*(void (__fastcall **)(_QWORD *))(*a1 + 1352LL))(a1);
return EditorUI::updateButtons(a1);
}