//
// ColorSelectLiveOverlay::updateColorLabel from 0x1000f63f0 to 0x1000f6538 (328 bytes)
//
// 2 xrefs:
// > ColorSelectLiveOverlay::init @ 0x1000f5dac
// > ColorSelectLiveOverlay::onSelectTab @ 0x1000f63ec
//
// 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 ColorSelectLiveOverlay::updateColorLabel(ColorSelectLiveOverlay *a1)
{
__int64 v2; // x8
__int64 v3; // x21
unsigned int *p_m_targetColor; // x8
EffectGameObject *m_effectGameObject; // x8
unsigned int v6; // w20
cocos2d::CCString *v7; // x0
const char *CString; // x1
std::string *v9; // x1
unsigned int v10; // w8
std::string v11; // [xsp+8h] [xbp-38h] BYREF
v2 = 656;
if ( a1->m_detailColorSelected )
v2 = 664;
v3 = *(__int64 *)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v2);
if ( v3 )
{
p_m_targetColor = (unsigned int *)(v3 + 92);
}
else
{
m_effectGameObject = a1->m_effectGameObject;
if ( !m_effectGameObject )
{
LABEL_10:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_colorLabel->setString)(a1->m_colorLabel, " ");
return;
}
p_m_targetColor = (unsigned int *)&m_effectGameObject->m_targetColor;
}
v6 = *p_m_targetColor;
if ( (int)*p_m_targetColor < 1 )
goto LABEL_10;
sub_100009900(&v11, "");
if ( v6 > 0x3E7 )
{
CString = GJSpecialColorSelect::textForColorIdx(v6);
}
else
{
v7 = (cocos2d::CCString *)sub_100268F4C("%i", v6);
CString = cocos2d::CCString::getCString(v7);
}
std::string::assign(&v11, CString);
if ( (v11.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v9 = &v11;
else
v9 = (std::string *)v11.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))a1->m_colorLabel->setString)(a1->m_colorLabel, v9);
if ( v3 )
{
if ( v6 < 0x3ED )
{
LOBYTE(v10) = 1;
}
else if ( v6 - 1009 >= 6 )
{
LOBYTE(v10) = 0;
}
else
{
v10 = 0x31u >> (v6 + 15);
}
ColorSelectLiveOverlay::toggleControls(a1, v10 & 1);
}
if ( SHIBYTE(v11.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v11.__r_.__value_.__l.__data_);
}