//
// CustomizeObjectLayer::updateColorSprite from 0x1000501bc to 0x10005028c (208 bytes)
//
// 9 xrefs:
// > CustomizeObjectLayer::onSelectMode @ 0x10004f6c4
// > CustomizeObjectLayer::onSelectColor @ 0x10004fab8
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x10004fb4c
// > CustomizeObjectLayer::onNextColorChannel @ 0x10004ff9c
// > CustomizeObjectLayer::onPaste @ 0x100050010
// > CustomizeObjectLayer::colorSetupClosed @ 0x1000504e0
// > CustomizeObjectLayer::colorSelectClosed @ 0x1000507a8
// > sub_1000507AC @ 0x1000507b0
// > CustomizeObjectLayer::textChanged @ 0x100050c30
//
// 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 CustomizeObjectLayer::updateColorSprite(CustomizeObjectLayer *a1)
{
unsigned int v2; // w8
int ActiveMode; // w20
GameManager *v4; // x0
GameManager *v5; // x0
ColorAction *ColorAction; // x1
LOBYTE(v2) = 1;
if ( a1->m_selectedMode != 3 )
{
ActiveMode = CustomizeObjectLayer::getActiveMode(a1, 1);
if ( ActiveMode >= 1
&& (v4 = GameManager::sharedState(),
GJEffectManager::colorExists(v4->m_levelEditorLayer->m_levelSettings->m_effectManager, ActiveMode)) )
{
v5 = GameManager::sharedState();
ColorAction = GJEffectManager::getColorAction(
v5->m_levelEditorLayer->m_levelSettings->m_effectManager,
ActiveMode);
}
else
{
ColorAction = nullptr;
}
ColorChannelSprite::updateValues(a1->m_colorSprite, ColorAction);
if ( (unsigned int)(ActiveMode - 1005) <= 7 )
v2 = (ActiveMode < 1) | (0xE7u >> (ActiveMode + 19));
else
LOBYTE(v2) = ActiveMode < 1;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_colorSpriteButton->setVisible)(
a1->m_colorSpriteButton,
(v2 & 1) == 0);
}