//
// ColorSelectLiveOverlay::updateColorLabel from 0x90b0e8 to 0x90b308 (544 bytes)
//
// 3 xrefs:
// > ColorSelectLiveOverlay::init @ 0x90c058
// > ColorSelectLiveOverlay::onSelectTab @ 0x90c3b0
// > ??> @ 0x9e280
//
// 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 ColorSelectLiveOverlay::updateColorLabel(ColorSelectLiveOverlay *a1)
{
_BOOL4 m_detailColorSelected; // w2
ColorAction *m_baseColorAction; // x0
ColorAction *m_detailColorAction; // x20
int m_colorID; // w22
const char *CString; // x0
size_t v7; // x0
long double v8; // q0
void *v9; // x0
cocos2d::CCString *v10; // x0
EffectGameObject *m_effectGameObject; // x0
unsigned int *v12; // x2
int v13; // w1
const char *v14; // [xsp+48h] [xbp+48h]
__int64 v15; // [xsp+60h] [xbp+60h] BYREF
m_detailColorSelected = a1->m_detailColorSelected;
m_baseColorAction = a1->m_baseColorAction;
m_detailColorAction = a1->m_detailColorAction;
if ( !m_detailColorSelected )
m_detailColorAction = m_baseColorAction;
if ( m_detailColorAction )
{
m_colorID = m_detailColorAction->m_colorID;
}
else
{
m_effectGameObject = a1->m_effectGameObject;
if ( !m_effectGameObject )
goto LABEL_18;
m_colorID = m_effectGameObject->m_targetColor;
}
if ( m_colorID <= 0 )
{
LABEL_18:
a1->m_colorLabel->setString(a1->m_colorLabel, (const unsigned __int8 *)" ");
return;
}
sub_D153B8((int)&v15, &byte_F288A0);
if ( m_colorID <= 999 )
{
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)m_colorID);
CString = cocos2d::CCString::getCString(v10);
}
else
{
CString = GJSpecialColorSelect::textForColorIdx(m_colorID);
}
v14 = CString;
v7 = strlen(CString);
*(__n128 *)&v8 = sub_D1798C(&v15, v14, v7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64, long double))a1->m_colorLabel->setString)(
a1->m_colorLabel,
v15,
v8);
if ( m_detailColorAction )
{
if ( m_colorID <= 1004 || m_colorID == 1009 || m_colorID >= 1009 && (unsigned int)(m_colorID - 1013) <= 1 )
ColorSelectLiveOverlay::toggleControls(a1, 1);
else
ColorSelectLiveOverlay::toggleControls(a1, 0);
}
v9 = (void *)(v15 - 24);
if ( (__int64 *)(v15 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v15 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v15 - 8);
*(_DWORD *)(v15 - 8) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v9);
}
}