//
// EditorUI::selectObjects from 0x1001a5cf8 to 0x1001a6174 (1148 bytes)
//
// 13 xrefs:
// > EditorUI::ccTouchEnded @ 0x100161ed4
// > EditorUI::ccTouchEnded @ 0x100162330
// > EditorUI::selectObject @ 0x1001a5b40
// > EditorUI::processSelectObjects @ 0x1001a63a8
// > sub_1001A6BC4 @ 0x1001a6bfc
// > SetupKeyframePopup::onCustomButton @ 0x10024a8d0
// > SetupKeyframePopup::onCustomButton @ 0x10024a9dc
// > LevelEditorLayer::handleAction @ 0x1003fbda4
// > LevelEditorLayer::handleAction @ 0x1003fbf0c
// > sub_100403E28 @ 0x1004041c4
// > EditorUI::createSmartObjectsFromTemplate @ 0x100479530
// > EditorUI::createSmartObjectsFromType @ 0x100479e14
// > sub_10047AA1C @ 0x10047abb8
//
// 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 11:00:03 +0000
//
__int64 __fastcall EditorUI::selectObjects(__int64 result, __int64 a2, char a3)
{
unsigned __int64 IntGameVariable; // x22
unsigned __int64 v4; // x24
__int64 v7; // x19
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x23
__int64 v12; // x0
__int64 v13; // x23
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x0
__int64 v17; // x21
__int64 v18; // x23
int v19; // w0
__n128 v20; // q0
__int64 v21; // x21
__int64 v22; // x23
_DWORD *v23; // x25
__n128 v24; // q0
__int64 v25; // x0
int v26; // w8
__int64 v27; // x0
unsigned int *v28; // x20
__int64 v29; // x1
__int64 StickyGroup; // x0
__int64 v31; // x20
__int64 v32; // x21
__int64 v33; // x0
__int64 v34; // x0
__int64 v35; // x23
__int64 v36; // x24
__int64 v37; // x25
__n128 v38; // q0
if ( a2 )
{
v7 = result;
result = sub_1002E757C(a2);
if ( (_DWORD)result )
{
if ( (a3 & 1) != 0 )
goto LABEL_13;
v8 = GameManager::sharedState(result);
GameManager::getGameVariable(v8, "0064");
if ( !(_DWORD)result )
goto LABEL_13;
v9 = GameManager::sharedState(result);
result = GameManager::getIntGameVariable(v9, "0005");
if ( (_DWORD)result != 3 )
goto LABEL_13;
v10 = GameManager::sharedState(result);
IntGameVariable = GameManager::getIntGameVariable(v10, "0006");
if ( (unsigned int)sub_1002E757C(a2) )
{
v11 = 0;
do
{
if ( *(_DWORD *)(sub_1002E75A0(a2, v11) + 1028) == (_DWORD)IntGameVariable )
v11 = (unsigned int)(v11 + 1);
else
sub_1002E7664(a2, v11, 1);
}
while ( (unsigned int)v11 < (unsigned int)sub_1002E757C(a2) );
}
result = sub_1002E757C(a2);
if ( (_DWORD)result )
{
LABEL_13:
v12 = GameManager::sharedState(result);
result = GameManager::getIntGameVariable(v12, "0133");
if ( (a3 & 1) != 0 )
goto LABEL_22;
IntGameVariable = result;
if ( !(_DWORD)result )
goto LABEL_22;
if ( (unsigned int)sub_1002E757C(a2) )
{
v13 = 0;
do
{
v14 = sub_1002E75A0(a2, v13);
if ( (sub_1002FA758(v14, IntGameVariable) & 1) != 0 )
v13 = (unsigned int)(v13 + 1);
else
sub_1002E7664(a2, v13, 1);
}
while ( (unsigned int)v13 < (unsigned int)sub_1002E757C(a2) );
}
result = sub_1002E757C(a2);
if ( (_DWORD)result )
{
LABEL_22:
v15 = GameManager::sharedState(result);
v16 = GameManager::getIntGameVariable(v15, "0139");
if ( (a3 & 1) != 0 )
goto LABEL_32;
IntGameVariable = v16;
if ( !(_DWORD)v16 )
goto LABEL_32;
if ( (unsigned int)sub_1002E757C(a2) )
{
v17 = 0;
do
{
v18 = sub_1002E75A0(a2, v17);
if ( (unsigned int)GameObject::getMainColorMode(v18) == (_DWORD)IntGameVariable
|| (sub_1002FB234(v18), v19 == (_DWORD)IntGameVariable) )
{
v17 = (unsigned int)(v17 + 1);
}
else
{
sub_1002E7664(a2, v17, 1);
}
}
while ( (unsigned int)v17 < (unsigned int)sub_1002E757C(a2) );
}
result = sub_1002E757C(a2);
if ( (_DWORD)result )
{
LABEL_32:
cocos2d::CCNode::stopActionByTag(v7, 124);
if ( *(_QWORD *)(v7 + 1496) && (sub_1002E7638(a2) & 1) == 0 )
{
if ( (unsigned int)sub_1002E757C(*(_QWORD *)(v7 + 896)) )
{
sub_1002E74E0(a2, *(_QWORD *)(v7 + 1496));
}
else
{
v20 = sub_1002E74E0(*(_QWORD *)(v7 + 896), *(_QWORD *)(v7 + 1496));
(*(void (__fastcall **)(_QWORD, __int64, __n128))(**(_QWORD **)(v7 + 1496) + 1528LL))(
*(_QWORD *)(v7 + 1496),
65280,
v20);
}
*(_BYTE *)(v7 + 776) = 1;
}
*(_QWORD *)(v7 + 1496) = 0;
v21 = 0;
if ( (unsigned int)sub_1002E757C(a2) )
{
v22 = 0;
IntGameVariable = 0;
do
{
v23 = (_DWORD *)sub_1002E75A0(a2, IntGameVariable);
if ( (sub_1002E7638(*(_QWORD *)(v7 + 896)) & 1) == 0 )
{
v24 = sub_1002E74E0(*(_QWORD *)(v7 + 896), v23);
v4 = v4 & 0xFFFFFFFFFF000000LL | 0xFF00;
v25 = (*(__int64 (__fastcall **)(_DWORD *, unsigned __int64, __n128))(*(_QWORD *)v23 + 1528LL))(
v23,
v4,
v24);
*(_BYTE *)(v7 + 776) = 1;
if ( *(_BYTE *)(v7 + 867) == 1 && (*(_BYTE *)(v7 + 868) & 1) == 0 )
{
v26 = v23[218];
if ( v26 >= 1 )
{
if ( !v21 )
{
v21 = cocos2d::CCDictionary::create(v25);
v22 = cocos2d::CCNode::create(v21);
v26 = v23[218];
}
cocos2d::CCDictionary::setObject_1(v21, v22, v26);
}
}
}
IntGameVariable = (unsigned int)(IntGameVariable + 1);
}
while ( (unsigned int)IntGameVariable < (unsigned int)sub_1002E757C(a2) );
}
if ( (unsigned int)sub_1002E757C(a2) == 1 && (unsigned int)sub_1002E757C(*(_QWORD *)(v7 + 896)) == 1 )
{
v27 = sub_1002E75A0(a2, 0);
v28 = (unsigned int *)v27;
if ( *(_BYTE *)(v7 + 867) != 1
|| (*(_BYTE *)(v7 + 868) & 1) != 0
|| (v29 = *(unsigned int *)(v27 + 872), (int)v29 < 1)
|| (StickyGroup = GJBaseGameLayer::getStickyGroup(*(_QWORD *)(v7 + 1440), v29)) == 0
|| (unsigned int)sub_1002E757C(StickyGroup) <= 1 )
{
EditorUI::selectObject(v7, v28, 0);
}
}
if ( (unsigned int)sub_1002E757C(*(_QWORD *)(v7 + 896)) )
{
if ( v21 )
{
*(_BYTE *)(v7 + 1514) = 1;
v31 = cocos2d::CCDictionary::allKeys(v21);
if ( (unsigned int)sub_1002E757C(v31) )
{
v32 = 0;
do
{
v33 = sub_1002E75A0(v31, v32);
v34 = GJBaseGameLayer::getStickyGroup(*(_QWORD *)(v7 + 1440), *(unsigned int *)(v33 + 56));
if ( v34 )
{
v35 = v34;
if ( (unsigned int)sub_1002E757C(v34) )
{
v36 = 0;
do
{
v37 = sub_1002E75A0(v35, v36);
if ( (sub_1002E7638(*(_QWORD *)(v7 + 896)) & 1) == 0 )
{
v38 = sub_1002E74E0(*(_QWORD *)(v7 + 896), v37);
IntGameVariable = IntGameVariable & 0xFFFFFFFFFF000000LL | 0xFF00;
(*(void (__fastcall **)(__int64, unsigned __int64, __n128))(*(_QWORD *)v37 + 1528LL))(
v37,
IntGameVariable,
v38);
}
v36 = (unsigned int)(v36 + 1);
}
while ( (unsigned int)v36 < (unsigned int)sub_1002E757C(v35) );
}
}
v32 = (unsigned int)(v32 + 1);
}
while ( (unsigned int)v32 < (unsigned int)sub_1002E757C(v31) );
}
}
}
return EditorUI::checkLiveColorSelect(v7);
}
}
}
}
}
return result;
}