//
// EditorUI::selectObjects from 0x10003c150 to 0x10003c659 (1289 bytes)
//
// 13 xrefs:
// > EditorUI::selectObject @ 0x10002e7f8
// > EditorUI::changeSelectedObjects @ 0x10003cb2e
// > EditorUI::selectObjectsInRect @ 0x10003cc4c
// > EditorUI::processSelectObjects @ 0x10003d277
// > EditorUI::createSmartObjectsFromTemplate @ 0x100043304
// > EditorUI::createSmartObjectsFromType @ 0x1000441c3
// > EditorUI::createNewKeyframeAnim @ 0x10004575e
// > EditorUI::ccTouchEnded @ 0x10004feb3
// > LevelEditorLayer::handleAction @ 0x1000e2e7d
// > LevelEditorLayer::handleAction @ 0x1000e2ed5
// > LevelEditorLayer::breakApartTextObject @ 0x1000f1929
// > SetupKeyframePopup::onCustomButton @ 0x100201b53
// > SetupKeyframePopup::onCustomButton @ 0x100201d42
//
// 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::selectObjects(EditorUI *a1, cocos2d::CCArray *a2, bool a3)
{
GameManager *v6; // rax
GameManager *v7; // rax
GameManager *v8; // rax
int IntGameVariable; // r12d
unsigned int v10; // r13d
GameManager *v11; // rax
int v12; // r12d
unsigned int v13; // r13d
GameObject *v14; // rax
GameManager *v15; // rax
int v16; // r12d
unsigned int v17; // r15d
GameObject *v18; // r13
GameObject *m_selectedObject; // rsi
unsigned int v20; // r12d
cocos2d::CCDictionary *v21; // r15
_DWORD *v22; // r13
int v23; // eax
GameObject *v24; // rax
int m_linkedGroup; // esi
GameObject *v26; // r14
cocos2d::CCArray *StickyGroup; // rdi
unsigned int v28; // ecx
cocos2d::CCArray *v29; // r14
unsigned int v30; // r15d
__int64 v31; // rax
cocos2d::CCArray *v32; // rax
cocos2d::CCArray *v33; // r12
unsigned int v34; // r13d
__int64 v35; // r14
cocos2d::CCNode *v36; // [rsp+0h] [rbp-30h]
cocos2d::CCArray *v37; // [rsp+0h] [rbp-30h]
if ( a2 && (unsigned int)sub_100720070(a2) )
{
if ( a3 )
goto LABEL_12;
v6 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v6, "0064") )
goto LABEL_12;
v7 = GameManager::sharedState();
if ( GameManager::getIntGameVariable(v7, "0005") != 3 )
goto LABEL_12;
v8 = GameManager::sharedState();
IntGameVariable = GameManager::getIntGameVariable(v8, "0006");
if ( (unsigned int)sub_100720070(a2) )
{
v10 = 0;
do
{
while ( *(_DWORD *)(sub_1007200C0(a2, v10) + 1028) == IntGameVariable )
{
if ( ++v10 >= (unsigned int)sub_100720070(a2) )
goto LABEL_11;
}
sub_100720230(a2, v10, 1);
}
while ( v10 < (unsigned int)sub_100720070(a2) );
}
LABEL_11:
if ( (unsigned int)sub_100720070(a2) )
{
LABEL_12:
v11 = GameManager::sharedState();
v12 = GameManager::getIntGameVariable(v11, "0133");
if ( a3 || v12 == 0 )
goto LABEL_19;
if ( (unsigned int)sub_100720070(a2) )
{
v13 = 0;
do
{
while ( 1 )
{
v14 = (GameObject *)sub_1007200C0(a2, v13);
if ( !GameObject::belongsToGroup(v14, v12) )
break;
if ( ++v13 >= (unsigned int)sub_100720070(a2) )
goto LABEL_18;
}
sub_100720230(a2, v13, 1);
}
while ( v13 < (unsigned int)sub_100720070(a2) );
}
LABEL_18:
if ( (unsigned int)sub_100720070(a2) )
{
LABEL_19:
v15 = GameManager::sharedState();
v16 = GameManager::getIntGameVariable(v15, "0139");
if ( v16 == 0 || a3 )
goto LABEL_27;
if ( (unsigned int)sub_100720070(a2) )
{
v17 = 0;
do
{
while ( 1 )
{
v18 = (GameObject *)sub_1007200C0(a2, v17);
if ( GameObject::getMainColorMode(v18) != v16 && GameObject::getSecondaryColorMode(v18) != v16 )
break;
if ( ++v17 >= (unsigned int)sub_100720070(a2) )
goto LABEL_26;
}
sub_100720230(a2, v17, 1);
}
while ( v17 < (unsigned int)sub_100720070(a2) );
}
LABEL_26:
if ( (unsigned int)sub_100720070(a2) )
{
LABEL_27:
cocos2d::CCNode::stopActionByTag(a1, 124);
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject && !(unsigned __int8)sub_100720160(a2, m_selectedObject) )
{
if ( (unsigned int)sub_100720070(a1->m_selectedObjects) )
{
sub_10071FCD0(a2, a1->m_selectedObject);
}
else
{
sub_10071FCD0(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;
if ( (unsigned int)sub_100720070(a2) )
{
v36 = nullptr;
do
{
v22 = (_DWORD *)sub_1007200C0(a2, v20);
if ( !(unsigned __int8)sub_100720160(a1->m_selectedObjects, v22) )
{
sub_10071FCD0(a1->m_selectedObjects, v22);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v22 + 1512LL))(v22, 65280);
a1->m_canActivateControls = 1;
if ( a1->m_stickyControlsEnabled && !a1->m_linkControlsDisabled )
{
v23 = v22[218];
if ( v23 > 0 )
{
if ( v21 )
{
cocos2d::CCDictionary::setObject(v21, v36, v23);
}
else
{
v21 = cocos2d::CCDictionary::create();
v36 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v21, v36, (int)v22[218]);
}
}
}
}
++v20;
}
while ( v20 < (unsigned int)sub_100720070(a2) );
}
if ( (unsigned int)sub_100720070(a2) == 1 && (unsigned int)sub_100720070(a1->m_selectedObjects) == 1 )
{
v24 = (GameObject *)sub_1007200C0(a2, 0);
if ( !a1->m_stickyControlsEnabled
|| a1->m_linkControlsDisabled
|| (m_linkedGroup = v24->m_linkedGroup, m_linkedGroup <= 0)
|| (v26 = v24,
StickyGroup = GJBaseGameLayer::getStickyGroup(a1->m_editorLayer, m_linkedGroup),
v24 = v26,
!StickyGroup)
|| (v28 = sub_100720070(StickyGroup), v24 = v26, v28 <= 1) )
{
EditorUI::selectObject(a1, v24, 0);
}
}
if ( (unsigned int)sub_100720070(a1->m_selectedObjects) != 0 && v21 != nullptr )
{
a1->m_findSnap = 1;
v29 = cocos2d::CCDictionary::allKeys(v21);
if ( (unsigned int)sub_100720070(v29) )
{
v30 = 0;
v37 = v29;
do
{
v31 = sub_1007200C0(v29, v30);
v32 = GJBaseGameLayer::getStickyGroup(a1->m_editorLayer, *(_DWORD *)(v31 + 56));
if ( v32 )
{
v33 = v32;
if ( (unsigned int)sub_100720070(v32) )
{
v34 = 0;
do
{
v35 = sub_1007200C0(v33, v34);
if ( !(unsigned __int8)sub_100720160(a1->m_selectedObjects, v35) )
{
sub_10071FCD0(a1->m_selectedObjects, v35);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v35 + 1512LL))(v35, 65280);
}
++v34;
}
while ( v34 < (unsigned int)sub_100720070(v33) );
}
}
++v30;
v29 = v37;
}
while ( v30 < (unsigned int)sub_100720070(v37) );
}
}
EditorUI::checkLiveColorSelect(a1);
}
}
}
}
}