//
// ColorSelectPopup::onPlayerColor2 from 0x862748 to 0x862800 (184 bytes)
//
// 3 xrefs:
// > ??> @ 0xe9620
// > ColorSelectPopup::init @ 0x865848
// > ??> @ 0x15470c8
//
// This function is hookable on this platform (idp: arm, 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:55:37 +0000
//
__int64 __fastcall ColorSelectPopup::onPlayerColor2(CCMenuItemToggler **this, cocos2d::CCObject *a2)
{
__int64 v3; // x0
int v4; // w1
__int64 result; // x0
cocos2d::CCArray *v6; // x0
unsigned int v7; // w20
__int64 v8; // x0
int v9; // w1
bool v10; // cf
unsigned int v11; // w1
CCMenuItemToggler::toggle(*(this + 134), 0);
v3 = (__int64)*(this + 85);
if ( *((_DWORD *)this + 283) == 2 )
v4 = 0;
else
v4 = 2;
*((_DWORD *)this + 283) = v4;
if ( v3 )
{
*(_BYTE *)(v3 + 1486) = v4 == 2;
result = (__int64)*(this + 85);
*(_BYTE *)(result + 1485) = 0;
}
else
{
v6 = *(this + 86);
if ( v6 )
{
v7 = 0;
while ( 1 )
{
result = cocos2d::CCArray::count(v6);
v10 = v7 >= (unsigned int)result;
v11 = v7++;
if ( v10 )
break;
v8 = cocos2d::CCArray::objectAtIndex(*(this + 86), v11);
v9 = *((_DWORD *)this + 283);
*(_BYTE *)(v8 + 1485) = 0;
*(_BYTE *)(v8 + 1486) = v9 == 2;
v6 = *(this + 86);
}
}
else
{
result = (__int64)*(this + 143);
if ( result )
*(_DWORD *)(result + 88) = v4;
}
}
return result;
}