//
// EditorUI::selectObjects from 0x6be8e8 to 0x6bedcc (1252 bytes)
//
// 16 xrefs:
// > LevelEditorLayer::breakApartTextObject @ 0x6723bc
// > LevelEditorLayer::handleAction @ 0x67288c
// > LevelEditorLayer::handleAction @ 0x6728ac
// > EditorUI::selectObject @ 0x6be508
// > EditorUI::createNewKeyframeAnim @ 0x6bf0c0
// > EditorUI::changeSelectedObjects @ 0x6c0f98
// > EditorUI::selectObjectsInRect @ 0x6c105c
// > EditorUI::processSelectObjects @ 0x6c1120
// > EditorUI::createSmartObjectsFromType @ 0x6c1474
// > EditorUI::createSmartObjectsFromType @ 0x6c1678
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c21ec
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c276c
// > EditorUI::ccTouchEnded @ 0x6c2d40
// > SetupKeyframePopup::onCustomButton @ 0xa3d324
// > SetupKeyframePopup::onCustomButton @ 0xa3d514
// > ??> @ 0x2de70
//
// 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::selectObjects(EditorUI *a1, cocos2d::CCArray *a2, bool a3)
{
unsigned int v3; // w24
GameManager *v6; // x0
unsigned int v7; // w20
int v8; // w22
bool v9; // cf
unsigned int v10; // w1
cocos2d::CCArray *v11; // x0
GameObject *v12; // x0
GameManager *v13; // x0
unsigned int v14; // w20
int v15; // w23
unsigned int v16; // w1
cocos2d::CCArray *v17; // x0
GameObject *v18; // x22
GameObject *m_selectedObject; // x1
unsigned int v20; // w20
cocos2d::CCNode *v21; // x26
cocos2d::CCDictionary *v22; // x25
unsigned int v23; // w1
cocos2d::CCArray *v24; // x0
cocos2d::CCObject *v25; // x22
int m_nTag; // w2
unsigned int v27; // w23
cocos2d::CCArray *v28; // x25
unsigned int v29; // w19
__int64 v30; // x0
cocos2d::CCArray *v31; // x22
unsigned int v32; // w1
cocos2d::CCArray *v33; // x0
cocos2d::CCObject *v34; // x20
GameManager *v35; // x0
GameManager *v36; // x0
GameManager *v37; // x0
unsigned int v38; // w20
int IntGameVariable; // w22
unsigned int v40; // w1
cocos2d::CCArray *v41; // x0
GameObject *v42; // x19
int m_linkedGroup; // w1
cocos2d::CCArray *StickyGroup; // x0
v3 = a3;
if ( a2 && (unsigned int)cocos2d::CCArray::count(a2) )
{
if ( v3 )
goto LABEL_5;
v35 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v35, "0064") )
goto LABEL_5;
v36 = GameManager::sharedState();
if ( GameManager::getIntGameVariable(v36, "0005") != 3 )
goto LABEL_5;
v37 = GameManager::sharedState();
v38 = 0;
IntGameVariable = GameManager::getIntGameVariable(v37, "0006");
while ( 1 )
{
v9 = v38 >= (unsigned int)cocos2d::CCArray::count(a2);
v40 = v38;
v41 = a2;
if ( v9 )
break;
while ( IntGameVariable != *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v41, v40) + 1012) )
{
cocos2d::CCArray::removeObjectAtIndex(a2, v38, 1);
v9 = v38 >= (unsigned int)cocos2d::CCArray::count(a2);
v40 = v38;
v41 = a2;
if ( v9 )
goto LABEL_54;
}
++v38;
}
LABEL_54:
if ( (unsigned int)cocos2d::CCArray::count(v41) )
{
LABEL_5:
v6 = GameManager::sharedState();
v7 = 0;
v8 = GameManager::getIntGameVariable(v6, "0133");
if ( (v8 != 0) <= v3 )
goto LABEL_11;
while ( 1 )
{
v9 = v7 >= (unsigned int)cocos2d::CCArray::count(a2);
v10 = v7;
v11 = a2;
if ( v9 )
break;
while ( 1 )
{
v12 = (GameObject *)cocos2d::CCArray::objectAtIndex(v11, v10);
if ( !GameObject::belongsToGroup(v12, v8) )
break;
v9 = ++v7 >= (unsigned int)cocos2d::CCArray::count(a2);
v10 = v7;
v11 = a2;
if ( v9 )
goto LABEL_10;
}
cocos2d::CCArray::removeObjectAtIndex(a2, v7, 1);
}
LABEL_10:
if ( (unsigned int)cocos2d::CCArray::count(v11) )
{
LABEL_11:
v13 = GameManager::sharedState();
v14 = 0;
v15 = GameManager::getIntGameVariable(v13, "0139");
if ( (v15 != 0) <= v3 )
goto LABEL_18;
while ( 1 )
{
v9 = v14 >= (unsigned int)cocos2d::CCArray::count(a2);
v16 = v14;
v17 = a2;
if ( v9 )
break;
while ( 1 )
{
v18 = (GameObject *)cocos2d::CCArray::objectAtIndex(v17, v16);
if ( v15 == GameObject::getMainColorMode(v18) || v15 == GameObject::getSecondaryColorMode(v18) )
break;
cocos2d::CCArray::removeObjectAtIndex(a2, v14, 1);
v9 = v14 >= (unsigned int)cocos2d::CCArray::count(a2);
v16 = v14;
v17 = a2;
if ( v9 )
goto LABEL_17;
}
++v14;
}
LABEL_17:
if ( (unsigned int)cocos2d::CCArray::count(v17) )
{
LABEL_18:
cocos2d::CCNode::stopActionByTag(a1, 124);
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject && !(unsigned __int8)cocos2d::CCArray::containsObject(a2, m_selectedObject) )
{
if ( (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) )
{
cocos2d::CCArray::addObject(a2, a1->m_selectedObject);
}
else
{
cocos2d::CCArray::addObject(a1->m_selectedObjects, a1->m_selectedObject);
((void (__fastcall *)(GameObject *, __int64))a1->m_selectedObject->selectObject)(
a1->m_selectedObject,
65280);
}
a1->m_canActivateControls = 1;
}
a1->m_selectedObject = nullptr;
v20 = 0;
v21 = nullptr;
v22 = nullptr;
while ( 1 )
{
v9 = v20 >= (unsigned int)cocos2d::CCArray::count(a2);
v23 = v20;
v24 = a2;
++v20;
if ( v9 )
break;
while ( 1 )
{
v25 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v24, v23);
if ( (unsigned __int8)cocos2d::CCArray::containsObject(a1->m_selectedObjects, v25) )
break;
cocos2d::CCArray::addObject(a1->m_selectedObjects, v25);
v25->__vftable[18].setTag(v25, 65280);
a1->m_canActivateControls = 1;
if ( !a1->m_stickyControlsEnabled )
break;
if ( a1->m_linkControlsDisabled )
break;
m_nTag = v25[15].m_nTag;
if ( m_nTag <= 0 )
break;
if ( !v22 )
{
v22 = cocos2d::CCDictionary::create();
v21 = cocos2d::CCNode::create();
m_nTag = v25[15].m_nTag;
}
cocos2d::CCDictionary::setObject(v22, v21, m_nTag);
v9 = v20 >= (unsigned int)cocos2d::CCArray::count(a2);
v23 = v20;
v24 = a2;
++v20;
if ( v9 )
goto LABEL_33;
}
}
LABEL_33:
if ( (unsigned int)cocos2d::CCArray::count(v24) == 1
&& (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) == 1 )
{
v42 = (GameObject *)cocos2d::CCArray::objectAtIndex(a2, 0);
if ( !a1->m_stickyControlsEnabled
|| a1->m_linkControlsDisabled
|| (m_linkedGroup = v42->m_linkedGroup, m_linkedGroup <= 0)
|| (StickyGroup = GJBaseGameLayer::getStickyGroup(a1->m_editorLayer, m_linkedGroup)) == nullptr
|| (unsigned int)cocos2d::CCArray::count(StickyGroup) <= 1 )
{
EditorUI::selectObject(a1, v42, 0);
}
}
if ( (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) && v22 )
{
a1->m_findSnap = 1;
v27 = 0;
v28 = cocos2d::CCDictionary::allKeys(v22);
while ( v27 < (unsigned int)cocos2d::CCArray::count(v28) )
{
v29 = 0;
v30 = cocos2d::CCArray::objectAtIndex(v28, v27);
v31 = GJBaseGameLayer::getStickyGroup(a1->m_editorLayer, *(_DWORD *)(v30 + 56));
if ( v31 )
{
while ( 1 )
{
v9 = v29 >= (unsigned int)cocos2d::CCArray::count(v31);
v32 = v29;
v33 = v31;
++v29;
if ( v9 )
break;
while ( 1 )
{
v34 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v33, v32);
if ( (unsigned __int8)cocos2d::CCArray::containsObject(a1->m_selectedObjects, v34) )
break;
cocos2d::CCArray::addObject(a1->m_selectedObjects, v34);
v34->__vftable[18].setTag(v34, 65280);
v9 = v29 >= (unsigned int)cocos2d::CCArray::count(v31);
v32 = v29;
v33 = v31;
++v29;
if ( v9 )
goto LABEL_43;
}
}
}
LABEL_43:
++v27;
}
}
EditorUI::checkLiveColorSelect(a1);
}
}
}
}
}