//
// EditorUI::selectObjects from 0x1005b89e0 to 0x1005b8ee9 (1289 bytes)
//
// 13 xrefs:
// > EditorUI::createSmartObjectsFromTemplate @ 0x1000144e3
// > EditorUI::createSmartObjectsFromType @ 0x1000152b2
// > EditorUI::createNewKeyframeAnim @ 0x10001683e
// > LevelEditorLayer::handleAction @ 0x1000b26d1
// > LevelEditorLayer::handleAction @ 0x1000b2721
// > LevelEditorLayer::breakApartTextObject @ 0x1000c521b
// > SetupKeyframePopup::onCustomButton @ 0x1001e4393
// > SetupKeyframePopup::onCustomButton @ 0x1001e4582
// > EditorUI::selectObject @ 0x1005b87d8
// > EditorUI::processSelectObjects @ 0x1005b9137
// > EditorUI::changeSelectedObjects @ 0x1005b9c7e
// > EditorUI::ccTouchEnded @ 0x10060ae25
// > EditorUI::ccTouchEnded @ 0x10060b1c1
//
// This function is hookable on this platform (idp: pc, 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 12:32:42 +0000
//
__int64 __fastcall EditorUI::selectObjects(__int64 a1, __int64 a2, unsigned __int8 a3, double a4)
{
__int64 result; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
int IntGameVariable; // r12d
unsigned int v12; // r13d
__int64 v13; // rax
unsigned int v14; // r12d
unsigned int v15; // r13d
__int64 v16; // rax
__int64 v17; // rax
int v18; // r12d
unsigned int v19; // r15d
__int64 v20; // r13
__int64 v21; // rsi
unsigned int v22; // r12d
_QWORD *v23; // r15
_DWORD *v24; // r13
int v25; // eax
int *v26; // rax
int *v27; // r14
__int64 StickyGroup; // rdi
unsigned int v29; // ecx
__int64 v30; // r14
unsigned int v31; // r15d
__int64 v32; // rax
__int64 v33; // r12
unsigned int v34; // r13d
__int64 v35; // r14
void *v36; // [rsp+0h] [rbp-30h]
__int64 v37; // [rsp+0h] [rbp-30h]
if ( a2 )
{
result = sub_1007FEF90(a2);
if ( (_DWORD)result )
{
if ( a3 )
goto LABEL_12;
v8 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getGameVariable(v8, "0064") )
goto LABEL_12;
v9 = GameManager::sharedState();
if ( (unsigned int)GameManager::getIntGameVariable(v9, "0005") != 3 )
goto LABEL_12;
v10 = GameManager::sharedState();
IntGameVariable = GameManager::getIntGameVariable(v10, "0006");
if ( (unsigned int)sub_1007FEF90(a2) )
{
v12 = 0;
do
{
while ( *(_DWORD *)(sub_1007FEFE0(a2, v12) + 1028) == IntGameVariable )
{
if ( ++v12 >= (unsigned int)sub_1007FEF90(a2) )
goto LABEL_11;
}
sub_1007FF150(a2, v12, 1);
}
while ( v12 < (unsigned int)sub_1007FEF90(a2) );
}
LABEL_11:
result = sub_1007FEF90(a2);
if ( (_DWORD)result )
{
LABEL_12:
v13 = GameManager::sharedState();
v14 = GameManager::getIntGameVariable(v13, "0133");
if ( a3 | (v14 == 0) )
goto LABEL_19;
if ( (unsigned int)sub_1007FEF90(a2) )
{
v15 = 0;
do
{
while ( 1 )
{
v16 = sub_1007FEFE0(a2, v15);
if ( !(unsigned __int8)GameObject::belongsToGroup(v16, v14) )
break;
if ( ++v15 >= (unsigned int)sub_1007FEF90(a2) )
goto LABEL_18;
}
sub_1007FF150(a2, v15, 1);
}
while ( v15 < (unsigned int)sub_1007FEF90(a2) );
}
LABEL_18:
result = sub_1007FEF90(a2);
if ( (_DWORD)result )
{
LABEL_19:
v17 = GameManager::sharedState();
v18 = GameManager::getIntGameVariable(v17, "0139");
if ( (v18 == 0) | a3 )
goto LABEL_27;
if ( (unsigned int)sub_1007FEF90(a2) )
{
v19 = 0;
do
{
while ( 1 )
{
v20 = sub_1007FEFE0(a2, v19);
if ( (unsigned int)GameObject::getMainColorMode(v20) != v18
&& (unsigned int)GameObject::getSecondaryColorMode(v20, a4) != v18 )
{
break;
}
if ( ++v19 >= (unsigned int)sub_1007FEF90(a2) )
goto LABEL_26;
}
sub_1007FF150(a2, v19, 1);
}
while ( v19 < (unsigned int)sub_1007FEF90(a2) );
}
LABEL_26:
result = sub_1007FEF90(a2);
if ( (_DWORD)result )
{
LABEL_27:
cocos2d::CCNode::stopActionByTag(a1, 124);
v21 = *(_QWORD *)(a1 + 1496);
if ( v21 && !(unsigned __int8)sub_1007FF080(a2, v21) )
{
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) )
{
sub_1007FEBF0(a2, *(_QWORD *)(a1 + 1496));
}
else
{
sub_1007FEBF0(*(_QWORD *)(a1 + 896), *(_QWORD *)(a1 + 1496));
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1496) + 1528LL))(
*(_QWORD *)(a1 + 1496),
65280);
}
*(_BYTE *)(a1 + 776) = 1;
}
*(_QWORD *)(a1 + 1496) = 0;
v22 = 0;
v23 = nullptr;
if ( (unsigned int)sub_1007FEF90(a2) )
{
v36 = nullptr;
do
{
v24 = (_DWORD *)sub_1007FEFE0(a2, v22);
if ( !(unsigned __int8)sub_1007FF080(*(_QWORD *)(a1 + 896), v24) )
{
sub_1007FEBF0(*(_QWORD *)(a1 + 896), v24);
(*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v24 + 1528LL))(v24, 65280);
*(_BYTE *)(a1 + 776) = 1;
if ( *(_BYTE *)(a1 + 867) == 1 && !*(_BYTE *)(a1 + 868) )
{
v25 = v24[218];
if ( v25 > 0 )
{
if ( v23 )
{
cocos2d::CCDictionary::setObject_1((__int64)v23, (__int64)v36, v25);
}
else
{
v23 = cocos2d::CCDictionary::create();
v36 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject_1((__int64)v23, (__int64)v36, (int)v24[218]);
}
}
}
}
++v22;
}
while ( v22 < (unsigned int)sub_1007FEF90(a2) );
}
if ( (unsigned int)sub_1007FEF90(a2) == 1 && (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) == 1 )
{
v26 = (int *)sub_1007FEFE0(a2, 0);
if ( *(_BYTE *)(a1 + 867) != 1
|| *(_BYTE *)(a1 + 868)
|| v26[218] <= 0
|| (v27 = v26,
StickyGroup = GJBaseGameLayer::getStickyGroup(*(_QWORD *)(a1 + 1440)),
v26 = v27,
!StickyGroup)
|| (v29 = sub_1007FEF90(StickyGroup), v26 = v27, v29 <= 1) )
{
EditorUI::selectObject(a1, v26, 0);
}
}
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) != 0 && v23 != nullptr )
{
*(_BYTE *)(a1 + 1514) = 1;
v30 = cocos2d::CCDictionary::allKeys((__int64)v23);
if ( (unsigned int)sub_1007FEF90(v30) )
{
v31 = 0;
v37 = v30;
do
{
sub_1007FEFE0(v30, v31);
v32 = GJBaseGameLayer::getStickyGroup(*(_QWORD *)(a1 + 1440));
if ( v32 )
{
v33 = v32;
if ( (unsigned int)sub_1007FEF90(v32) )
{
v34 = 0;
do
{
v35 = sub_1007FEFE0(v33, v34);
if ( !(unsigned __int8)sub_1007FF080(*(_QWORD *)(a1 + 896), v35) )
{
sub_1007FEBF0(*(_QWORD *)(a1 + 896), v35);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v35 + 1528LL))(v35, 65280);
}
++v34;
}
while ( v34 < (unsigned int)sub_1007FEF90(v33) );
}
}
++v31;
v30 = v37;
}
while ( v31 < (unsigned int)sub_1007FEF90(v37) );
}
}
return EditorUI::checkLiveColorSelect(a1);
}
}
}
}
}
return result;
}