//
// SetGroupIDLayer::onArrow from 0x140591290 to 0x1405915c0 (816 bytes)
//
// 6 xrefs:
// > SetGroupIDLayer::onArrowLeft @ 0x140591252
// > SetGroupIDLayer::onArrowRight @ 0x140591282
// > ??> @ 0x1408dd7ec
// > ??> @ 0x1408dd800
// > ??> @ 0x1408dd834
// > ??> @ 0x14092ccd8
//
// 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 11:34:32 +0000
//
unsigned int __fastcall SetGroupIDLayer::onArrow(__int64 a1, int a2, int a3)
{
unsigned int result; // eax
int v6; // edi
int v7; // ecx
int v8; // edi
int v9; // ecx
int v10; // edi
int v11; // ecx
int v12; // edi
int v13; // ecx
int v14; // edi
int v15; // ecx
int *v16; // rax
int v17; // edi
size_t v18; // rsi
int v19; // eax
cocos2d::CCArray *v20; // rcx
unsigned int v21; // edi
struct cocos2d::CCObject *v22; // rax
int v23; // ecx
int v24; // ecx
bool v25; // zf
int v26; // ecx
int v27; // edi
int *v28; // rcx
cocos2d::CCString *v29; // rax
const char *CString; // rax
__int128 v31; // [rsp+20h] [rbp-28h] BYREF
__int64 v32; // [rsp+30h] [rbp-18h]
__int64 v33; // [rsp+38h] [rbp-10h]
result = a2 - 1;
switch ( a2 )
{
case 1:
v6 = 0;
v7 = a3 + *(_DWORD *)(a1 + 764);
if ( v7 >= 0 )
v6 = v7;
*(_DWORD *)(a1 + 764) = v6;
return SetGroupIDLayer::updateGroupIDLabel(a1);
case 3:
v12 = 0;
v13 = a3 + *(_DWORD *)(a1 + 792);
if ( v13 >= 0 )
v12 = v13;
*(_DWORD *)(a1 + 792) = v12;
SetGroupIDLayer::updateEditorOrder(a1);
return SetGroupIDLayer::updateEditorOrderLabel(a1);
case 4:
v14 = 0;
v15 = a3 + *(_DWORD *)(a1 + 756);
if ( v15 >= 0 )
v14 = v15;
*(_DWORD *)(a1 + 756) = v14;
SetGroupIDLayer::updateOrderChannel(a1);
return SetGroupIDLayer::updateOrderChannelLabel(a1);
case 5:
v8 = 0;
v9 = a3 + *(_DWORD *)(a1 + 768);
if ( v9 >= 0 )
v8 = v9;
*(_DWORD *)(a1 + 768) = v8;
SetGroupIDLayer::updateEditorLabel(a1);
return SetGroupIDLayer::updateEditorLayerID(a1);
case 6:
v10 = 0;
v11 = a3 + *(_DWORD *)(a1 + 772);
if ( v11 >= 0 )
v10 = v11;
*(_DWORD *)(a1 + 772) = v10;
SetGroupIDLayer::updateEditorLabel2(a1);
return SetGroupIDLayer::updateEditorLayerID2(a1);
case 7:
v16 = (int *)(a1 + 776);
v17 = *(_DWORD *)(a1 + 776);
v18 = -1;
if ( v17 != -1000 )
{
if ( a3 == 1 )
{
v25 = v17 == -1;
v27 = v17 + 1;
*v16 = v27;
if ( v25 )
{
*v16 = 1;
v27 = 1;
v16 = (int *)(a1 + 776);
}
}
else
{
v27 = v17 - 1;
*v16 = v27;
if ( !v27 )
{
*v16 = -1;
v27 = -1;
goto LABEL_40;
}
}
v28 = v16;
if ( v27 < -100 )
{
v27 = -100;
*v16 = -100;
goto LABEL_37;
}
LABEL_40:
*v16 = v27;
v28 = v16;
if ( v27 > 100 )
{
*(_BYTE *)(a1 + 797) = 1;
*v16 = 100;
v29 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 100);
LABEL_42:
CString = cocos2d::CCString::getCString(v29);
v31 = 0;
v32 = 0;
v33 = 0;
do
++v18;
while ( CString[v18] );
sub_14003D230(&v31, CString, v18);
CCTextInputNode::setString(*(_QWORD **)(a1 + 720), &v31);
*(_BYTE *)(a1 + 797) = 0;
return SetGroupIDLayer::updateZOrder(a1);
}
LABEL_37:
*v28 = v27;
*(_BYTE *)(a1 + 797) = 1;
v29 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v27);
goto LABEL_42;
}
v19 = 1;
if ( a3 != 1 )
v19 = -1;
*(_DWORD *)(a1 + 780) += v19;
result = SetGroupIDLayer::updateZOrderLabel(a1);
v20 = *(cocos2d::CCArray **)(a1 + 680);
if ( v20 )
{
if ( a3 == 1 )
LODWORD(v18) = 1;
v21 = 0;
result = cocos2d::CCArray::count(v20);
if ( result )
{
do
{
v22 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 680), v21);
if ( *(_BYTE *)(a1 + 784) )
{
v23 = *((_DWORD *)v22 + 284);
if ( !v23 )
v23 = *((_DWORD *)v22 + 264);
*((_DWORD *)v22 + 284) = v23;
}
v24 = *((_DWORD *)v22 + 284);
v25 = (_DWORD)v18 + v24 == 0;
v26 = v18 + v24;
*((_BYTE *)v22 + 1156) = 1;
if ( v25 )
v26 = v18;
++v21;
*((_DWORD *)v22 + 284) = v26;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 680));
}
while ( v21 < result );
}
}
*(_BYTE *)(a1 + 784) = 0;
return result;
default:
return result;
}
}