//
// EditorUI::replaceGroupID from 0x100045080 to 0x10004530b (651 bytes)
//
// 1 xrefs:
// > EditorUI::dynamicGroupUpdate @ 0x100044d22
//
// 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 __fastcall EditorUI::replaceGroupID(EditorUI *a1, GameObject *a2, int a3, int a4)
{
char v4; // al
int v7; // r12d
float height; // r13d
int m_objectID; // eax
__int64 v10; // rax
__int64 v11; // r12
const char *v12; // rax
cocos2d::CCString *v13; // rax
const char *CString; // rax
int v15; // eax
char v16; // [rsp-8h] [rbp-30h]
v16 = v4;
if ( a2->m_groupCount <= 0 )
{
LABEL_5:
if ( a2->m_classType != Effect )
return;
}
else
{
v7 = 0;
while ( GameObject::getGroupID(a2, v7) != a3 )
{
if ( ++v7 >= a2->m_groupCount )
goto LABEL_5;
}
((void (__fastcall *)(GameObject *, _QWORD))a2->removeFromGroup)(a2, (unsigned int)a3);
((void (__fastcall *)(GameObject *, _QWORD))a2->addToGroup)(a2, (unsigned int)a4);
if ( a2->m_classType != Effect )
return;
}
height = a2[1].m_obContentSize.height;
if ( LODWORD(height) == a3 )
{
EffectGameObject::setTargetID((EffectGameObject *)a2, a4);
if ( LODWORD(a2[1].m_sAdditionalTransform.a) != a3 )
{
LABEL_10:
if ( *(_DWORD *)&a2[1]._displayedOpacity != a3 )
goto LABEL_11;
goto LABEL_16;
}
}
else if ( LODWORD(a2[1].m_sAdditionalTransform.a) != a3 )
{
goto LABEL_10;
}
EffectGameObject::setTargetID2((EffectGameObject *)a2, a4);
if ( *(_DWORD *)&a2[1]._displayedOpacity != a3 )
{
LABEL_11:
if ( *(_DWORD *)(&a2[1].m_bUnkBool2 + 3) != a3 )
goto LABEL_12;
goto LABEL_17;
}
LABEL_16:
*(_DWORD *)&a2[1]._displayedOpacity = a4;
if ( *(_DWORD *)(&a2[1].m_bUnkBool2 + 3) != a3 )
{
LABEL_12:
m_objectID = a2->m_objectID;
if ( m_objectID == 899 )
return;
goto LABEL_18;
}
LABEL_17:
*(_DWORD *)(&a2[1].m_bUnkBool2 + 3) = a4;
m_objectID = a2->m_objectID;
if ( m_objectID == 899 )
return;
LABEL_18:
if ( m_objectID == 1615 )
return;
v10 = ((__int64 (__fastcall *)(GameObject *, __int64))a2->getChildByTag)(a2, 999);
if ( v10 )
{
v11 = v10;
v12 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 928LL))(v10);
if ( atoi(v12) == LODWORD(height) && LODWORD(a2[1].m_obContentSize.height) != LODWORD(height) )
{
v13 = (cocos2d::CCString *)sub_1007AB580("%i", v16);
CString = cocos2d::CCString::getCString(v13);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v11 + 912LL))(v11, CString);
}
}
v15 = a2->m_objectID;
if ( v15 <= 2067 )
{
if ( v15 == 901 )
{
if ( LODWORD(a2[1].m_sInverse.d) == a3 )
LODWORD(a2[1].m_sInverse.d) = a4;
}
else if ( v15 == 1268 )
{
SpawnTriggerGameObject::changeRemap((SpawnTriggerGameObject *)a2, a3, a4, 0);
SpawnTriggerGameObject::changeRemap((SpawnTriggerGameObject *)a2, a3, a4, 1);
}
return;
}
if ( v15 == 2068 )
{
ChanceTriggerGameObject::editChanceObject((ChanceTriggerGameObject *)a2, a3, a4);
return;
}
if ( v15 == 2903 )
{
if ( *(_DWORD *)&a2[1].m_sQuad.bl.colors == a3 )
{
a2[1].m_sQuad.bl.colors = (cocos2d::ccColor4B)a4;
if ( LODWORD(a2[1].m_sQuad.bl.texCoords.u) != a3 )
{
LABEL_31:
if ( LODWORD(a2[1].m_sQuad.bl.texCoords.v) != a3 )
goto LABEL_32;
goto LABEL_39;
}
}
else if ( LODWORD(a2[1].m_sQuad.bl.texCoords.u) != a3 )
{
goto LABEL_31;
}
LODWORD(a2[1].m_sQuad.bl.texCoords.u) = a4;
if ( LODWORD(a2[1].m_sQuad.bl.texCoords.v) != a3 )
{
LABEL_32:
if ( LODWORD(a2[1].m_sQuad.tr.vertices.x) != a3 )
return;
goto LABEL_40;
}
LABEL_39:
LODWORD(a2[1].m_sQuad.bl.texCoords.v) = a4;
if ( LODWORD(a2[1].m_sQuad.tr.vertices.x) != a3 )
return;
LABEL_40:
LODWORD(a2[1].m_sQuad.tr.vertices.x) = a4;
}
}