//
// SetGroupIDLayer::onArrow from 0x1003169b0 to 0x100316d7c (972 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::onArrowLeft @ 0x100316972
// > SetGroupIDLayer::onArrowRight @ 0x1003169a2
//
// 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 SetGroupIDLayer::onArrow(SetGroupIDLayer *a1, int a2, int a3)
{
int v4; // edx
int v5; // eax
int v6; // edx
int v7; // eax
GameObject *v8; // rdi
int m_zOrderValue; // eax
int v10; // eax
int v11; // edx
int v12; // eax
GameObject *m_targetObject; // rdi
int v14; // edx
int v15; // eax
GameObject *v16; // rax
int v17; // edx
int v18; // eax
GameObject *v19; // rax
int v20; // ecx
int v21; // eax
GameObject *v22; // rax
unsigned int v23; // r14d
_DWORD *v24; // r15
unsigned int v25; // r14d
__int64 v26; // rax
unsigned int v27; // r14d
_DWORD *v28; // r15
unsigned int v29; // r14d
unsigned int v30; // r14d
switch ( a2 )
{
case 1:
v4 = a1->m_groupIDValue + a3;
v5 = 0;
if ( v4 > 0 )
v5 = v4;
a1->m_groupIDValue = v5;
SetGroupIDLayer::updateGroupIDLabel(a1);
break;
case 3:
v11 = a1->m_orderValue + a3;
v12 = 0;
if ( v11 > 0 )
v12 = v11;
a1->m_orderValue = v12;
a1->m_channelOrderEdited = 1;
m_targetObject = a1->m_targetObject;
if ( m_targetObject )
{
if ( ((unsigned __int8 (__fastcall *)(GameObject *))m_targetObject->canBeOrdered)(m_targetObject) )
HIDWORD(a1->m_targetObject[1].m_pobTexture) = a1->m_orderValue;
}
else if ( (unsigned int)sub_100720070(a1->m_targetObjects) )
{
v27 = 0;
do
{
v28 = (_DWORD *)sub_1007200C0(a1->m_targetObjects, v27);
if ( (*(unsigned __int8 (__fastcall **)(_DWORD *))(*(_QWORD *)v28 + 1680LL))(v28) )
v28[443] = a1->m_orderValue;
++v27;
}
while ( v27 < (unsigned int)sub_100720070(a1->m_targetObjects) );
}
SetGroupIDLayer::updateEditorOrderLabel(a1);
break;
case 4:
v6 = a1->m_channelValue + a3;
v7 = 0;
if ( v6 > 0 )
v7 = v6;
a1->m_channelValue = v7;
a1->m_channelUpdated = 1;
v8 = a1->m_targetObject;
if ( v8 )
{
if ( ((unsigned __int8 (__fastcall *)(GameObject *))v8->canBeOrdered)(v8) )
LODWORD(a1->m_targetObject[1].m_obRect.origin.x) = a1->m_channelValue;
}
else if ( (unsigned int)sub_100720070(a1->m_targetObjects) )
{
v23 = 0;
do
{
v24 = (_DWORD *)sub_1007200C0(a1->m_targetObjects, v23);
if ( (*(unsigned __int8 (__fastcall **)(_DWORD *))(*(_QWORD *)v24 + 1680LL))(v24) )
v24[444] = a1->m_channelValue;
++v23;
}
while ( v23 < (unsigned int)sub_100720070(a1->m_targetObjects) );
}
SetGroupIDLayer::updateOrderChannelLabel(a1);
break;
case 5:
v14 = a1->m_editorLayerValue + a3;
v15 = 0;
if ( v14 > 0 )
v15 = v14;
a1->m_editorLayerValue = v15;
SetGroupIDLayer::updateEditorLabel(a1);
v16 = a1->m_targetObject;
if ( v16 )
{
v16->m_editorLayer = a1->m_editorLayerValue;
}
else if ( (unsigned int)sub_100720070(a1->m_targetObjects) )
{
v29 = 0;
do
*(_WORD *)(sub_1007200C0(a1->m_targetObjects, v29++) + 1202) = a1->m_editorLayerValue;
while ( v29 < (unsigned int)sub_100720070(a1->m_targetObjects) );
}
break;
case 6:
v17 = a1->m_editorLayer2Value + a3;
v18 = 0;
if ( v17 > 0 )
v18 = v17;
a1->m_editorLayer2Value = v18;
SetGroupIDLayer::updateEditorLabel2(a1);
v19 = a1->m_targetObject;
if ( v19 )
{
v19->m_editorLayer2 = a1->m_editorLayer2Value;
}
else if ( (unsigned int)sub_100720070(a1->m_targetObjects) )
{
v30 = 0;
do
*(_WORD *)(sub_1007200C0(a1->m_targetObjects, v30++) + 1204) = a1->m_editorLayer2Value;
while ( v30 < (unsigned int)sub_100720070(a1->m_targetObjects) );
}
break;
case 7:
m_zOrderValue = a1->m_zOrderValue;
if ( m_zOrderValue == -1000 )
m_zOrderValue = 0;
if ( a3 == 1 )
v10 = (m_zOrderValue == -1) + m_zOrderValue + 1;
else
v10 = m_zOrderValue == 1 ? -1 : m_zOrderValue - 1;
v20 = -100;
if ( v10 >= -99 )
v20 = v10;
v21 = 100;
if ( v20 < 100 )
v21 = v20;
a1->m_zOrderValue = v21;
SetGroupIDLayer::updateZOrderLabel(a1);
v22 = a1->m_targetObject;
if ( v22 )
{
v22->m_zOrder = a1->m_zOrderValue;
v22->m_updateParents = 1;
}
else if ( (unsigned int)sub_100720070(a1->m_targetObjects) )
{
v25 = 0;
do
{
v26 = sub_1007200C0(a1->m_targetObjects, v25);
*(_DWORD *)(v26 + 1128) = a1->m_zOrderValue;
*(_BYTE *)(v26 + 1148) = 1;
++v25;
}
while ( v25 < (unsigned int)sub_100720070(a1->m_targetObjects) );
}
break;
default:
return;
}
}