//
// EditorUI::deleteObject from 0x100032a20 to 0x100032c45 (549 bytes)
//
// 8 xrefs:
// > EditorUI::onDeleteSelected @ 0x10000c216
// > EditorUI::onDeleteSelected @ 0x10000c27a
// > EditorUI::onDelete @ 0x10002de4d
// > EditorUI::deleteSmartBlocksFromObjects @ 0x1000346dd
// > EditorUI::deleteTypeFromObjects @ 0x10003479d
// > EditorUI::addObjectsToSmartTemplate @ 0x100042691
// > EditorUI::createSmartObjectsFromTemplate @ 0x1000432e5
// > EditorUI::createSmartObjectsFromType @ 0x1000441a5
//
// 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
//
void __fastcall EditorUI::deleteObject(EditorUI *a1, GameObject *a2, bool a3)
{
GameObject *m_selectedObject; // rax
GJRotationControl *m_rotationControl; // r15
cocos2d::CCSprite *m_controlSprite; // r14
cocos2d::CCSpriteFrameCache *v8; // rax
cocos2d::CCSpriteFrame *v9; // rax
GJRotationControlDelegate *m_delegate; // rdi
char v11; // al
GJScaleControl *m_scaleControl; // rdi
GJScaleControlDelegate *v13; // rax
GJTransformControl *m_transformControl; // rax
GJTransformControlDelegate *v15; // rdi
if ( a2 )
{
a2->m_wasSelected = a2->m_isSelected;
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject && m_selectedObject->m_uniqueID == a2->m_uniqueID )
{
EditorUI::deselectObject_1(a1);
a1->m_canActivateControls = 1;
}
else
{
GameObject::deselectObject(a2);
if ( (unsigned __int8)sub_100720160(a1->m_selectedObjects, a2) )
{
a1->m_canActivateControls = 1;
sub_100720220(a1->m_selectedObjects, a2, 1);
}
}
LevelEditorLayer::removeObject(a1->m_editorLayer, a2, a3);
a1->m_rotationTouchID = -1;
if ( ((unsigned __int8 (__fastcall *)(GJRotationControl *))a1->m_rotationControl->isVisible)(a1->m_rotationControl) )
{
((void (__fastcall *)(GJRotationControl *, _QWORD))a1->m_rotationControl->setVisible)(a1->m_rotationControl, 0);
m_rotationControl = a1->m_rotationControl;
if ( m_rotationControl->m_touchID != -1 )
{
m_rotationControl->m_touchID = -1;
m_controlSprite = m_rotationControl->m_controlSprite;
v8 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v9 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v8, "GJ_rotationControlBtn01_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_controlSprite->setDisplayFrame)(
m_controlSprite,
v9);
m_delegate = m_rotationControl->m_delegate;
if ( m_delegate )
((void (__fastcall *)(GJRotationControlDelegate *))m_delegate->angleChangeEnded)(m_delegate);
}
}
v11 = ((__int64 (__fastcall *)(GJScaleControl *))a1->m_scaleControl->isVisible)(a1->m_scaleControl);
m_scaleControl = a1->m_scaleControl;
if ( v11 )
{
((void (__fastcall *)(GJScaleControl *, _QWORD))m_scaleControl->setVisible)(m_scaleControl, 0);
m_scaleControl = a1->m_scaleControl;
if ( m_scaleControl->m_touchID != -1 )
{
m_scaleControl->m_touchID = -1;
v13 = m_scaleControl->m_delegate;
if ( v13 )
{
((void (__fastcall *)(GJScaleControlDelegate *))v13->scaleChangeEnded)(m_scaleControl->m_delegate);
m_scaleControl = a1->m_scaleControl;
}
}
*(_QWORD *)&m_scaleControl->m_upperBound = 0x3F00000040000000LL;
}
EditorUI::updateEditButtonColor(a1, m_scaleControl->m_senderTag, (cocos2d::ccColor3B)-1);
a1->m_scaleControl->m_senderTag = 0;
if ( ((unsigned __int8 (__fastcall *)(GJTransformControl *))a1->m_transformControl->isVisible)(a1->m_transformControl) )
{
((void (__fastcall *)(GJTransformControl *, _QWORD))a1->m_transformControl->setVisible)(a1->m_transformControl, 0);
m_transformControl = a1->m_transformControl;
if ( m_transformControl->m_touchID != -1 )
{
m_transformControl->m_touchID = -1;
v15 = m_transformControl->m_delegate;
if ( v15 )
((void (__fastcall *)(GJTransformControlDelegate *))v15->transformChangeEnded)(v15);
}
}
EditorUI::updateEditButtonColor(a1, 31, (cocos2d::ccColor3B)-1);
}
}