//
// ColorSelectPopup::updateCustomColorIdx from 0x14012c250 to 0x14012c2e9 (153 bytes)
//
// 6 xrefs:
// > ColorSelectPopup::onUpdateCustomColor @ 0x14012bc39
// > ColorSelectPopup::textChanged @ 0x14012bd95
// > ColorSelectPopup::colorSelectClosed @ 0x14012c73c
// > ??> @ 0x1408987a0
// > ??> @ 0x1408987b0
// > ??> @ 0x140916c34
//
// 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:27:01 +0000
//
int __fastcall ColorSelectPopup::updateCustomColorIdx(__int64 a1)
{
int result; // eax
__int64 v3; // rcx
cocos2d::CCArray *v4; // rcx
unsigned int v5; // edi
struct cocos2d::CCObject *v6; // rax
result = *(_DWORD *)(a1 + 1152);
if ( result < 1 )
result = 1;
v3 = *(_QWORD *)(a1 + 680);
*(_DWORD *)(a1 + 1152) = result;
if ( v3 )
{
*(_DWORD *)(v3 + 1032) = result;
}
else
{
v4 = *(cocos2d::CCArray **)(a1 + 688);
if ( v4 )
{
v5 = 0;
result = cocos2d::CCArray::count(v4);
if ( result )
{
do
{
v6 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 688), v5++);
*((_DWORD *)v6 + 258) = *(_DWORD *)(a1 + 1152);
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 688));
}
while ( v5 < result );
}
}
}
return result;
}