//
// CustomizeObjectLayer::updateSelected from 0x841238 to 0x84135c (292 bytes)
//
// 6 xrefs:
// > CustomizeObjectLayer::textChanged @ 0x8414bc
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x841640
// > CustomizeObjectLayer::onSelectColor @ 0x8417d8
// > CustomizeObjectLayer::colorSetupClosed @ 0x841834
// > CustomizeObjectLayer::onNextColorChannel @ 0x8418f4
// > ??> @ 0x5d8a0
//
// 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 CustomizeObjectLayer::updateSelected(CustomizeObjectLayer *a1, int a2)
{
GameObject *m_targetObject; // x0
int v4; // w20
_BOOL4 v5; // w22
GJSpriteColor *RelativeSpriteColor; // x0
int v7; // w1
int m_defaultColorID; // w1
int v9; // w2
cocos2d::CCArray *m_targetObjects; // x0
int v11; // w24
unsigned int i; // w20
GameObject *v13; // x21
GJSpriteColor *v14; // x0
int v15; // w1
int v16; // w2
m_targetObject = a1->m_targetObject;
v4 = a2;
v5 = a2 == 0;
if ( m_targetObject )
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor(m_targetObject, a1->m_selectedMode);
if ( RelativeSpriteColor )
{
if ( v5 )
{
m_defaultColorID = RelativeSpriteColor->m_defaultColorID;
v9 = 1101;
if ( m_defaultColorID <= 1100 )
{
if ( m_defaultColorID < 0 )
v9 = 0;
else
v9 = RelativeSpriteColor->m_defaultColorID;
}
RelativeSpriteColor->m_defaultColorID = v9;
RelativeSpriteColor->m_colorID = 0;
}
else
{
v7 = 1101;
if ( v4 <= 1100 )
{
if ( v4 < 0 )
v7 = 0;
else
v7 = v4;
}
RelativeSpriteColor->m_colorID = v7;
}
a1->m_targetObject->m_updateParents = 1;
}
}
else
{
m_targetObjects = a1->m_targetObjects;
if ( m_targetObjects )
{
if ( a2 < 0 )
a2 = 0;
if ( v4 > 1100 )
v11 = 1101;
else
v11 = a2;
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(m_targetObjects); ++i )
{
v13 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, i);
v14 = GameObject::getRelativeSpriteColor(v13, a1->m_selectedMode);
v15 = 1101;
if ( v14 )
{
if ( v5 )
{
v16 = v14->m_defaultColorID;
if ( v16 <= 1100 )
{
if ( v16 < 0 )
v15 = 0;
else
v15 = v14->m_defaultColorID;
}
v14->m_defaultColorID = v15;
v14->m_colorID = 0;
}
else
{
v14->m_colorID = v11;
}
v13->m_updateParents = 1;
}
m_targetObjects = a1->m_targetObjects;
}
}
}
}