//
// EditorUI::getEditColorTargets from 0x7c56cc to 0x7c5980 (692 bytes)
//
// 4 xrefs:
// > EditorUI::updateEditColorButton @ 0x7c5ab0
// > EditorUI::editColor @ 0x7c5cdc
// > EditorUI::editHSV @ 0x7c5f54
// > ??> @ 0xe9770
//
// 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 12:54:08 +0000
//
ColorAction *__fastcall EditorUI::getEditColorTargets(
EditorUI *this,
ColorAction **a2,
ColorAction **a3,
EffectGameObject **a4)
{
GameObject *v5; // x1
ColorAction *result; // x0
__int64 v9; // x0
int v10; // w19
unsigned __int64 ColorAction; // x0
__int64 v12; // x0
int *v13; // x0
int v14; // w23
int v15; // w0
__int64 v16; // x0
__int64 v17; // x0
unsigned int *v18; // x1
GameObject **v19; // x24
GameObject **v20; // x25
GameObject *v21; // x22
__int64 v22; // x0
int *MainColor; // x0
int v24; // w1
int v25; // w0
int v26; // w26
int *SecondaryColor; // x0
int v28; // w1
v5 = *((GameObject **)this + 187);
if ( !v5 )
{
if ( !(unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
goto LABEL_4;
v17 = *((_QWORD *)this + 112);
if ( !v17 )
goto LABEL_4;
v18 = *(unsigned int **)(v17 + 56);
if ( !*v18 )
goto LABEL_4;
v19 = *((GameObject ***)v18 + 2);
v20 = &v19[*v18 - 1];
if ( v19 > v20 )
goto LABEL_4;
v21 = *v19;
if ( !*v19 )
goto LABEL_4;
v10 = -2;
v14 = -2;
while ( 1 )
{
if ( !GameObject::canChangeCustomColor(v21) )
goto LABEL_4;
if ( GameObject::canChangeMainColor(v21) )
{
MainColor = (int *)GameObject::getMainColor(v21);
v24 = *MainColor;
v25 = MainColor[1];
if ( v24 == v25 || !v24 )
v24 = v25;
if ( v14 == -2 )
{
v14 = v24;
}
else if ( v14 != v24 )
{
if ( !GameObject::canChangeSecondaryColor(v21) )
goto LABEL_4;
v26 = 1;
goto LABEL_45;
}
}
ColorAction = GameObject::canChangeSecondaryColor(v21);
if ( !(_BYTE)ColorAction )
goto LABEL_28;
v26 = 0;
LABEL_45:
SecondaryColor = (int *)GameObject::getSecondaryColor(v21);
v28 = *SecondaryColor;
ColorAction = (unsigned int)SecondaryColor[1];
if ( v28 == (_DWORD)ColorAction || !v28 )
v28 = ColorAction;
if ( v10 != -2 && v10 != v28 || v26 )
goto LABEL_4;
v10 = v28;
LABEL_28:
if ( v20 >= ++v19 )
{
v21 = *v19;
if ( *v19 )
continue;
}
goto LABEL_30;
}
}
if ( (unsigned __int8)EditorUI::isLiveColorSelectTrigger(this, v5) )
{
*a4 = *((EffectGameObject **)this + 187);
goto LABEL_4;
}
if ( GameObject::canChangeMainColor(*((GameObject **)this + 187)) )
{
v13 = (int *)GameObject::getMainColor(*((GameObject **)this + 187));
v14 = *v13;
v15 = v13[1];
if ( v14 == v15 || !v14 )
v14 = v15;
ColorAction = GameObject::canChangeSecondaryColor(*((GameObject **)this + 187));
if ( !(_BYTE)ColorAction )
{
v10 = -1;
if ( v14 < 0 )
goto LABEL_4;
goto LABEL_18;
}
v22 = GameObject::getSecondaryColor(*((GameObject **)this + 187));
v10 = *(_DWORD *)v22;
ColorAction = *(unsigned int *)(v22 + 4);
if ( v10 != (_DWORD)ColorAction && v10 )
{
LABEL_30:
if ( v14 < 0 )
goto LABEL_10;
LABEL_18:
v16 = GameManager::sharedState((GameManager *)ColorAction);
ColorAction = GJEffectManager::getColorAction(
*(GJEffectManager **)(*(_QWORD *)(*(_QWORD *)(v16 + 552) + 3272LL) + 320LL),
v14);
*a2 = (ColorAction *)ColorAction;
goto LABEL_10;
}
v10 = ColorAction;
}
else
{
if ( !GameObject::canChangeSecondaryColor(*((GameObject **)this + 187)) )
goto LABEL_4;
v9 = GameObject::getSecondaryColor(*((GameObject **)this + 187));
v10 = *(_DWORD *)v9;
ColorAction = *(unsigned int *)(v9 + 4);
if ( v10 != (_DWORD)ColorAction && v10 )
goto LABEL_10;
v14 = -1;
v10 = ColorAction;
}
if ( (v14 & 0x80000000) == 0 )
goto LABEL_18;
LABEL_10:
if ( (v10 & 0x80000000) == 0 )
{
v12 = GameManager::sharedState((GameManager *)ColorAction);
*a3 = (ColorAction *)GJEffectManager::getColorAction(
*(GJEffectManager **)(*(_QWORD *)(*(_QWORD *)(v12 + 552) + 3272LL) + 320LL),
v10);
result = *a2;
if ( *a2 )
return result;
goto LABEL_12;
}
LABEL_4:
result = *a2;
if ( *a2 )
return result;
LABEL_12:
result = *a3;
if ( *a3 )
{
*a2 = result;
*a3 = nullptr;
}
return result;
}