//
// EditorUI::selectObjects from 0xbdcc04 to 0xbdd0e0 (1244 bytes)
//
// 16 xrefs:
// > LevelEditorLayer::breakApartTextObject @ 0x7a1ab8
// > LevelEditorLayer::handleAction @ 0x7a1f04
// > LevelEditorLayer::handleAction @ 0x7a2324
// > EditorUI::createSmartObjectsFromType @ 0x7c3784
// > EditorUI::createSmartObjectsFromType @ 0x7c397c
// > EditorUI::createNewKeyframeAnim @ 0x7c3d4c
// > EditorUI::createSmartObjectsFromTemplate @ 0x7cb6ac
// > EditorUI::createSmartObjectsFromTemplate @ 0x7cb9f8
// > SetupKeyframePopup::onCustomButton @ 0xb6ba8c
// > SetupKeyframePopup::onCustomButton @ 0xb6bb28
// > EditorUI::ccTouchEnded @ 0xbd65b0
// > EditorUI::ccTouchEnded @ 0xbd66b0
// > EditorUI::selectObject @ 0xbdcb94
// > EditorUI::processSelectObjects @ 0xbdd158
// > EditorUI::changeSelectedObjects @ 0xbdd4c0
// > ??> @ 0x450b8
//
// This function is hookable on this platform (idp: arm, 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 13:03:44 +0000
//
__int64 __fastcall EditorUI::selectObjects(__int64 this, cocos2d::CCArray *a2, unsigned __int8 a3)
{
unsigned int v3; // w24
__int64 v4; // x21
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
cocos2d::CCObject *v19; // x1
unsigned int v20; // w20
cocos2d::CCObject *v21; // x26
cocos2d::CCNode *v22; // x25
unsigned int v23; // w1
cocos2d::CCArray *v24; // x0
cocos2d::CCObject *v25; // x22
int v26; // 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 v43; // w1
cocos2d::CCArray *StickyGroup; // x0
v3 = a3;
if ( a2 )
{
v4 = this;
this = cocos2d::CCArray::count(a2);
if ( (_DWORD)this )
{
if ( v3 )
goto LABEL_5;
v35 = (GameManager *)GameManager::sharedState((GameManager *)this);
this = (unsigned __int8)GameManager::getGameVariable(v35, "0064");
if ( !(_BYTE)this )
goto LABEL_5;
v36 = (GameManager *)GameManager::sharedState((GameManager *)this);
this = GameManager::getIntGameVariable(v36, "0005");
if ( (_DWORD)this != 3 )
goto LABEL_5;
v37 = (GameManager *)GameManager::sharedState((GameManager *)this);
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) + 1028) )
{
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:
this = cocos2d::CCArray::count(v41);
if ( (_DWORD)this )
{
LABEL_5:
v6 = (GameManager *)GameManager::sharedState((GameManager *)this);
v7 = 0;
v8 = GameManager::getIntGameVariable(v6, "0133");
this = v8 != 0;
if ( (unsigned int)this <= 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 ( !(unsigned __int8)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:
this = cocos2d::CCArray::count(v11);
if ( (_DWORD)this )
{
LABEL_11:
v13 = (GameManager *)GameManager::sharedState((GameManager *)this);
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 == (unsigned int)GameObject::getMainColorMode(v18)
|| v15 == (unsigned int)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:
this = cocos2d::CCArray::count(v17);
if ( (_DWORD)this )
{
LABEL_18:
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)v4, 124);
v19 = *(cocos2d::CCObject **)(v4 + 1496);
if ( v19 && !(unsigned __int8)cocos2d::CCArray::containsObject(a2, v19) )
{
if ( (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(v4 + 896)) )
{
cocos2d::CCArray::addObject(a2, *(cocos2d::CCObject **)(v4 + 1496));
}
else
{
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(v4 + 896), *(cocos2d::CCObject **)(v4 + 1496));
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v4 + 1496) + 1528LL))(
*(_QWORD *)(v4 + 1496),
65280);
}
*(_BYTE *)(v4 + 776) = 1;
}
*(_QWORD *)(v4 + 1496) = 0;
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(*(cocos2d::CCArray **)(v4 + 896), v25) )
break;
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(v4 + 896), v25);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v25 + 1528LL))(v25, 65280);
*(_BYTE *)(v4 + 776) = 1;
if ( !*(_BYTE *)(v4 + 867) )
break;
if ( *(_BYTE *)(v4 + 868) )
break;
v26 = *((_DWORD *)v25 + 218);
if ( v26 <= 0 )
break;
if ( !v22 )
{
v22 = (cocos2d::CCNode *)cocos2d::CCDictionary::create((cocos2d::CCDictionary *)*(unsigned __int8 *)(v4 + 868));
v21 = (cocos2d::CCObject *)cocos2d::CCNode::create(v22);
v26 = *((_DWORD *)v25 + 218);
}
cocos2d::CCDictionary::setObject(v22, v21, v26);
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(*(cocos2d::CCArray **)(v4 + 896)) == 1 )
{
v42 = (GameObject *)cocos2d::CCArray::objectAtIndex(a2, 0);
if ( !*(_BYTE *)(v4 + 867)
|| *(_BYTE *)(v4 + 868)
|| (v43 = *((_DWORD *)v42 + 218), v43 <= 0)
|| (StickyGroup = (cocos2d::CCArray *)GJBaseGameLayer::getStickyGroup(
*(cocos2d::CCDictionary ***)(v4 + 1440),
v43)) == nullptr
|| (unsigned int)cocos2d::CCArray::count(StickyGroup) <= 1 )
{
EditorUI::selectObject((EditorUI *)v4, v42, 0);
}
}
if ( (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(v4 + 896)) && v22 )
{
*(_BYTE *)(v4 + 1514) = 1;
v27 = 0;
v28 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v22);
while ( v27 < (unsigned int)cocos2d::CCArray::count(v28) )
{
v29 = 0;
v30 = cocos2d::CCArray::objectAtIndex(v28, v27);
v31 = (cocos2d::CCArray *)GJBaseGameLayer::getStickyGroup(
*(cocos2d::CCDictionary ***)(v4 + 1440),
*(_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(*(cocos2d::CCArray **)(v4 + 896), v34) )
break;
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(v4 + 896), v34);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v34 + 1528LL))(v34, 65280);
v9 = v29 >= (unsigned int)cocos2d::CCArray::count(v31);
v32 = v29;
v33 = v31;
++v29;
if ( v9 )
goto LABEL_43;
}
}
}
LABEL_43:
++v27;
}
}
return EditorUI::checkLiveColorSelect(v4);
}
}
}
}
}
return this;
}