//
// ColorSelectPopup::onPlayerColor1 from 0x140090c60 to 0x140090d3e (222 bytes)
//
// 3 xrefs:
// > ColorSelectPopup::init @ 0x14008ea47
// > ??> @ 0x1406c6f78
// > ??> @ 0x1406c6f84
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void ColorSelectPopup::onPlayerColor1(ColorSelectPopup *a1, cocos2d::CCObject *a2)
{
int m_playerColor; // eax
unsigned int v4; // edi
EffectGameObject *m_gameObject; // rcx
_BOOL8 v6; // rdx
cocos2d::CCArray *m_gameObjects; // rcx
struct cocos2d::CCObject *v8; // rax
ColorAction *m_colorAction; // rax
CCMenuItemToggler::toggle(a1->m_playerColor2Toggle, 0);
m_playerColor = a1->m_playerColor;
v4 = 0;
m_gameObject = a1->m_gameObject;
v6 = m_playerColor != 1;
a1->m_playerColor = v6;
if ( m_gameObject )
{
m_gameObject->m_usesPlayerColor1 = m_playerColor != 1;
a1->m_gameObject->m_usesPlayerColor2 = 0;
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
{
if ( cocos2d::CCArray::count(m_gameObjects) )
{
do
{
v8 = cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, v4++);
BYTE1(v8[26].m_nZOrder) = a1->m_playerColor == 1;
BYTE2(v8[26].m_nZOrder) = 0;
}
while ( v4 < cocos2d::CCArray::count(a1->m_gameObjects) );
}
}
else
{
m_colorAction = a1->m_colorAction;
if ( m_colorAction )
m_colorAction->m_playerColor = v6;
}
}
}