//
// EditorUI::deselectTargetPortals from 0x1400e6870 to 0x1400e69ca (346 bytes)
//
// 6 xrefs:
// > EditorUI::onDelete @ 0x1400e5eb5
// > EditorUI::onDelete @ 0x1400e60e7
// > EditorUI::onDeleteSelected @ 0x1400e669a
// > ??> @ 0x14066ea0c
// > ??> @ 0x14066ea40
// > ??> @ 0x1406c8d0c
//
// 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 EditorUI::deselectTargetPortals(EditorUI *a1)
{
cocos2d::CCArray *m_selectedObjects; // rcx
__int64 v3; // rcx
unsigned int v4; // esi
cocos2d::CCArray *v5; // rbp
unsigned int i; // edi
struct cocos2d::CCObject *v7; // rax
GameObject *v8; // rax
GameObject *m_selectedObject; // rax
GameObject *v10; // rcx
m_selectedObjects = a1->m_selectedObjects;
if ( m_selectedObjects && cocos2d::CCArray::count(m_selectedObjects) )
{
v4 = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
for ( i = 0; i < cocos2d::CCArray::count(a1->m_selectedObjects); ++i )
{
v7 = cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, i);
if ( v7[18].m_eObjType == 749 )
cocos2d::CCArray::addObject(v5, v7);
}
if ( cocos2d::CCArray::count(v5) )
{
do
{
v8 = (GameObject *)cocos2d::CCArray::objectAtIndex(v5, v4);
EditorUI::deselectObject(a1, v8);
++v4;
}
while ( v4 < cocos2d::CCArray::count(v5) );
}
}
else
{
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject && m_selectedObject->m_objectID == 749 )
{
cocos2d::CCNode::stopActionByTag(a1, 124);
v10 = a1->m_selectedObject;
if ( v10 )
{
v10->m_isSelected = 0;
GameObject::updateObjectEditorColor(v10);
}
a1->m_selectedObject = nullptr;
EditorUI::toggleEditObjectButton(a1);
a1->m_canActivateControls = 1;
cocos2d::CCPoint::operator=(&a1->m_lastTouchPoint, &dword_1406C1AA8);
}
}
}