//
// EditorUI::editObjectSpecial from 0x37f734 to 0x37fa62 (814 bytes)
//
// 2 xrefs:
// > EditorUI::editObject2 @ 0x37fa6a
// > EditorUI::editObject3 @ 0x37fa70
//
// 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::editObjectSpecial(EditorUI *a1, int a2)
{
GameObject *m_selectedObject; // r0
unsigned int v5; // r0
unsigned int i; // r5
int v7; // r0
int v8; // r6
GameObject *v9; // r3
cocos2d::CCArray *m_selectedObjects; // r5
unsigned int v11; // r6
cocos2d::CCObject *v12; // r1
SmartGameObject *v13; // r0
cocos2d::CCArray *v14; // r1
LevelEditorLayer *m_editorLayer; // r3
cocos2d::CCArray *v16; // r2
void *v17; // r0
EffectGameObject *v18; // r0
unsigned int j; // r5
int v20; // r0
GameObject *v21; // r5
unsigned int k; // r5
int v23; // r0
unsigned int m; // r5
int v25; // r0
EffectGameObject *v26; // r0
cocos2d::CCArray *v27; // r1
cocos2d::CCArray *v28; // [sp+8h] [bp-10h] BYREF
int v29; // [sp+Ch] [bp-Ch] BYREF
int v30; // [sp+10h] [bp-8h] BYREF
v28 = (cocos2d::CCArray *)-1;
v29 = -1;
v30 = -1;
EditorUI::getGroupInfo(a1, a1->m_selectedObject, a1->m_selectedObjects, (int *)&v28, &v29, &v30);
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject )
{
v5 = ((int (__fastcall *)(GameObject *))m_selectedObject->getHasRotateAction)(m_selectedObject);
LABEL_8:
v8 = v5;
}
else
{
for ( i = 0; ; ++i )
{
v5 = cocos2d::CCArray::count(a1->m_selectedObjects);
if ( i >= v5 )
break;
v7 = cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, i);
v5 = (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 860))(v7);
if ( !v5 )
goto LABEL_8;
}
v8 = 1;
}
if ( v28 != (cocos2d::CCArray *)-1 || v29 != -1 )
{
if ( v29 == 5 )
{
LABEL_18:
m_selectedObjects = a1->m_selectedObjects;
if ( m_selectedObjects )
{
v11 = 0;
m_selectedObjects = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v5);
while ( v11 < cocos2d::CCArray::count(a1->m_selectedObjects) )
{
v12 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, v11);
if ( v12[20].m_unknown2 == 5 )
cocos2d::CCArray::addObject(m_selectedObjects, v12);
++v11;
}
}
v13 = (SmartGameObject *)a1->m_selectedObject;
v14 = m_selectedObjects;
goto LABEL_75;
}
LABEL_15:
v9 = a1->m_selectedObject;
if ( v9 && v9->m_classType == Smart )
goto LABEL_18;
v5 = EditorUI::arrayContainsClass(a1, a1->m_selectedObjects, 5);
if ( v5 )
goto LABEL_18;
m_editorLayer = a1->m_editorLayer;
v16 = v28;
if ( m_editorLayer->m_isPlatformer
&& (v28 == (cocos2d::CCArray *)&stru_69C.st_info || v28 == (cocos2d::CCArray *)((char *)&stru_6CC.st_size + 3)) )
{
v17 = SetupDashRingPopup::create((DashRingObject *)a1->m_selectedObject, a1->m_selectedObjects);
LABEL_80:
(*(void (__fastcall **)(void *))(*(_DWORD *)v17 + 644))(v17);
return;
}
if ( v28 == (cocos2d::CCArray *)((char *)&stru_B4C.st_size + 3) )
{
v17 = SetupGradientPopup::create((GradientTriggerObject *)a1->m_selectedObject, a1->m_selectedObjects);
goto LABEL_80;
}
if ( v28 == (cocos2d::CCArray *)&stru_B4C.st_info )
return;
if ( v28 == (cocos2d::CCArray *)((char *)&stru_80C.st_name + 3) )
{
v17 = SetupCheckpointPopup::create((CheckpointGameObject *)a1->m_selectedObject, a1->m_selectedObjects);
goto LABEL_80;
}
if ( v28 == (cocos2d::CCArray *)((char *)&stru_2DC.st_shndx + 1)
|| v28 == (cocos2d::CCArray *)((char *)&stru_B4C.st_size + 2)
|| v28 == (cocos2d::CCArray *)((char *)&stru_BCC.st_value + 3) )
{
v17 = SetupTeleportPopup::create(
(TeleportPortalObject *)a1->m_selectedObject,
a1->m_selectedObjects,
(int)v28,
m_editorLayer->m_levelSettings->m_platformerMode);
goto LABEL_80;
}
if ( v28 == (cocos2d::CCArray *)((char *)&stru_64C.st_name + 3) )
{
v17 = SetItemIDLayer::create((EffectGameObject *)a1->m_selectedObject, a1->m_selectedObjects);
goto LABEL_80;
}
if ( v28 != (cocos2d::CCArray *)((char *)&stru_80C.st_value + 1) )
{
if ( v28 == (cocos2d::CCArray *)&stru_62C.st_shndx )
{
v17 = SetupObjectTogglePopup::create(
(EffectGameObject *)a1->m_selectedObject,
a1->m_selectedObjects,
m_editorLayer->m_levelSettings->m_platformerMode);
goto LABEL_80;
}
if ( EditorUI::canAllowMultiActivate(a1, a1->m_selectedObject, a1->m_selectedObjects) )
{
v17 = EditGameObjectPopup::create(
(EffectGameObject *)a1->m_selectedObject,
a1->m_selectedObjects,
a1->m_editorLayer->m_levelSettings->m_platformerMode);
goto LABEL_80;
}
if ( v8 )
{
LABEL_79:
v17 = SetupRotatePopup::create((EnhancedGameObject *)a1->m_selectedObject, a1->m_selectedObjects);
goto LABEL_80;
}
v18 = (EffectGameObject *)a1->m_selectedObject;
if ( v30 == 30 && a2 != 1 )
{
LABEL_73:
v17 = SetupInteractObjectPopup::create(v18, a1->m_selectedObjects);
goto LABEL_80;
}
if ( v18 && ((int (__fastcall *)(EffectGameObject *))v18->getHasSyncedAnimation)(v18) )
{
v26 = (EffectGameObject *)a1->m_selectedObject;
v27 = nullptr;
LABEL_78:
v17 = SetupAnimSettingsPopup::create(v26, v27);
goto LABEL_80;
}
if ( !cocos2d::CCArray::count(a1->m_selectedObjects) )
return;
if ( a2 != 1 )
{
for ( j = 0; j < cocos2d::CCArray::count(a1->m_selectedObjects); ++j )
{
v20 = cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, j);
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v20 + 892))(v20) != 30 )
goto LABEL_56;
}
v18 = (EffectGameObject *)a1->m_selectedObject;
goto LABEL_73;
}
LABEL_56:
if ( v29 == 5 )
goto LABEL_74;
v21 = a1->m_selectedObject;
if ( !v21 )
goto LABEL_60;
if ( v21->m_classType == Smart )
{
LABEL_74:
v13 = (SmartGameObject *)a1->m_selectedObject;
v14 = a1->m_selectedObjects;
LABEL_75:
v17 = SetupSmartBlockLayer::create(v13, v14);
goto LABEL_80;
}
v21 = nullptr;
LABEL_60:
while ( (unsigned int)v21 < cocos2d::CCArray::count(a1->m_selectedObjects) )
{
if ( *(_DWORD *)(cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, (unsigned int)v21) + 884) != 2065 )
{
for ( k = 0; ; ++k )
{
if ( k >= cocos2d::CCArray::count(a1->m_selectedObjects) )
{
v26 = (EffectGameObject *)a1->m_selectedObject;
v27 = a1->m_selectedObjects;
goto LABEL_78;
}
v23 = cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, k);
if ( !(*(int (__fastcall **)(int))(*(_DWORD *)v23 + 856))(v23) )
break;
}
for ( m = 0; m < cocos2d::CCArray::count(a1->m_selectedObjects); ++m )
{
v25 = cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, m);
if ( !(*(int (__fastcall **)(int))(*(_DWORD *)v25 + 860))(v25) )
return;
}
goto LABEL_79;
}
v21 = (GameObject *)((char *)v21 + 1);
}
}
v17 = (void *)CreateParticlePopup::create(
(CreateParticlePopup *)a1->m_selectedObject,
(ParticleGameObject *)a1->m_selectedObjects,
v16);
goto LABEL_80;
}
if ( v30 != -1 || v8 )
goto LABEL_15;
}