//
// ColorSelectPopup::onUpdateCustomColor from 0x100807240 to 0x100807311 (209 bytes)
//
// 1 xrefs:
// > ColorSelectPopup::init @ 0x10080554a
//
// 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 12:36:40 +0000
//
__int64 __fastcall ColorSelectPopup::onUpdateCustomColor(__int64 a1, __int64 a2)
{
int v3; // eax
int v4; // ecx
int v5; // eax
int v6; // eax
__int64 v7; // rcx
__int64 v9; // rdi
unsigned int v10; // r14d
if ( *(int *)(a1 + 1168) >= 1000 )
*(_DWORD *)(a1 + 1168) = 0;
v3 = *(_DWORD *)(a1 + 1168) + 2 * ((*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 1) - 1;
v4 = 0;
if ( v3 > 0 )
v4 = v3;
v5 = 999;
if ( v4 < 999 )
v5 = v4;
v6 = (v5 == 0) + v5;
*(_DWORD *)(a1 + 1168) = v6;
v7 = *(_QWORD *)(a1 + 680);
if ( v7 )
{
*(_DWORD *)(v7 + 1024) = v6;
}
else
{
v9 = *(_QWORD *)(a1 + 688);
if ( v9 && (unsigned int)sub_1007FEF90(v9) )
{
v10 = 0;
do
*(_DWORD *)(sub_1007FEFE0(*(_QWORD *)(a1 + 688), v10++) + 1024) = *(_DWORD *)(a1 + 1168);
while ( v10 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 688)) );
}
}
SetupTriggerPopup::updateEditorLabel(a1);
return ColorSelectPopup::updateTextInputLabel(a1);
}