//
// CustomizeObjectLayer::colorSetupClosed from 0x1001f89c0 to 0x1001f8ac9 (265 bytes)
//
// 2 xrefs:
// > sub_1001F8E10 @ 0x1001f8e1c
// > ??> @ 0x1008d98c0
//
// 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::colorSetupClosed(CustomizeObjectLayer *a1, int a2)
{
char v2; // al
int v4; // r15d
ButtonSprite *v5; // rsi
unsigned int v6; // r12d
__int64 v7; // r13
const char *CString; // rax
cocos2d::CCString *v9; // rax
const std::string::value_type *v10; // rsi
char v11; // [rsp-8h] [rbp-30h]
v11 = v2;
CustomizeObjectLayer::updateSelected(a1, a2);
v4 = a2;
if ( (unsigned int)(a2 - 10) <= 0x3DD )
{
a1->m_customColorChannel = a2;
a1->m_disableTextDelegate = 1;
CustomizeObjectLayer::updateCustomColorLabels(a1);
a1->m_disableTextDelegate = 0;
v4 = 1008;
}
v5 = nullptr;
if ( (unsigned int)sub_100720070(a1->m_colorButtons) )
{
v6 = 0;
while ( 1 )
{
v7 = sub_1007200C0(a1->m_colorButtons, v6);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v7 + 64LL))(v7) == v4 )
break;
if ( ++v6 >= (unsigned int)sub_100720070(a1->m_colorButtons) )
{
v5 = nullptr;
goto LABEL_9;
}
}
v5 = (ButtonSprite *)v7;
}
LABEL_9:
CustomizeObjectLayer::highlightSelected(a1, v5);
CustomizeObjectLayer::updateColorSprite(a1);
if ( a2 < 1000 )
{
if ( a2 <= 0 )
{
v10 = " ";
goto LABEL_14;
}
v9 = (cocos2d::CCString *)sub_1007AB580("%i", v11);
CString = cocos2d::CCString::getCString(v9);
}
else
{
CString = GJSpecialColorSelect::textForColorIdx(a2);
}
v10 = CString;
LABEL_14:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const std::string::value_type *))a1->m_selectedColorLabel->setString)(
a1->m_selectedColorLabel,
v10);
}