//
// ColorSelectPopup::onPlayerColor1 from 0x10041ec3c to 0x10041ece8 (172 bytes)
//
// 1 xrefs:
// > ColorSelectPopup::init @ 0x10041ced0
//
// 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 __fastcall ColorSelectPopup::onPlayerColor1(ColorSelectPopup *a1, cocos2d::CCObject *a2)
{
int m_playerColor; // w10
_BOOL4 v4; // w8
EffectGameObject *m_gameObject; // x9
cocos2d::CCArray *m_gameObjects; // x0
unsigned int v7; // w20
__int64 v8; // x0
ColorAction *m_colorAction; // x9
CCMenuItemToggler::toggle(a1->m_playerColor2Toggle, 0);
m_playerColor = a1->m_playerColor;
v4 = m_playerColor != 1;
a1->m_playerColor = v4;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
m_gameObject->m_usesPlayerColor1 = m_playerColor != 1;
m_gameObject->m_usesPlayerColor2 = 0;
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects )
{
if ( (unsigned int)sub_10024A36C((__int64)m_gameObjects) )
{
v7 = 0;
do
{
v8 = sub_10024A388((__int64)a1->m_gameObjects, v7);
*(_BYTE *)(v8 + 1485) = a1->m_playerColor == 1;
*(_BYTE *)(v8 + 1486) = 0;
++v7;
}
while ( v7 < (unsigned int)sub_10024A36C((__int64)a1->m_gameObjects) );
}
}
else
{
m_colorAction = a1->m_colorAction;
if ( m_colorAction )
m_colorAction->m_playerColor = v4;
}
}
}