//
// ColorSelectPopup::onPlayerColor1 from 0x100806dc0 to 0x100806e7e (190 bytes)
//
// 1 xrefs:
// > ColorSelectPopup::init @ 0x10080480a
//
// 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::onPlayerColor1(__int64 a1)
{
int v2; // ecx
__int64 result; // rax
__int64 v4; // rdx
__int64 v5; // rdi
unsigned int v6; // r14d
__int64 v7; // rax
__int64 v8; // rcx
CCMenuItemToggler::toggle(*(_QWORD *)(a1 + 1080), 0);
v2 = *(_DWORD *)(a1 + 1132);
result = v2 != 1;
*(_DWORD *)(a1 + 1132) = result;
v4 = *(_QWORD *)(a1 + 680);
if ( v4 )
{
*(_BYTE *)(v4 + 1485) = v2 != 1;
*(_BYTE *)(v4 + 1486) = 0;
}
else
{
v5 = *(_QWORD *)(a1 + 688);
if ( v5 )
{
result = sub_1007FEF90(v5);
if ( (_DWORD)result )
{
v6 = 0;
do
{
v7 = sub_1007FEFE0(*(_QWORD *)(a1 + 688), v6);
*(_BYTE *)(v7 + 1485) = *(_DWORD *)(a1 + 1132) == 1;
*(_BYTE *)(v7 + 1486) = 0;
++v6;
result = sub_1007FEF90(*(_QWORD *)(a1 + 688));
}
while ( v6 < (unsigned int)result );
}
}
else
{
v8 = *(_QWORD *)(a1 + 1144);
if ( v8 )
*(_DWORD *)(v8 + 88) = result;
}
}
return result;
}