//
// ColorSelectPopup::textChanged from 0x742058 to 0x7424ec (1172 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'ColorSelectPopup::textChanged @ 0x7424f0
// > ??> @ 0x806a0
// > ??> @ 0x1161258
//
// 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 ColorSelectPopup::textChanged(ColorSelectPopup *a1, CCTextInputNode *a2)
{
char *v4; // x21
size_t v5; // x24
char *v6; // x0
unsigned __int64 v7; // x0
char *v8; // x23
int v9; // w22
char *v10; // x0
int v11; // w0
float v12; // s0
char *v13; // x0
const char *v14; // x1
cocos2d::CCString *v15; // x0
Slider *m_fadeTimeSlider; // x0
float v17; // s0
char *v18; // x21
int m_copyColorID; // w0
char *v20; // x2
int v21; // w1
char *v22; // x21
int m_colorID; // w0
char *v24; // x2
int v25; // w1
unsigned int *v26; // x21
int v27; // w1
unsigned int *v28; // x21
int v29; // w0
unsigned int *v30; // x2
unsigned int *v31; // x23
int v32; // w1
unsigned int *v33; // x21
int v34; // w0
float v35; // [xsp+40h] [xbp+40h]
char *v36; // [xsp+60h] [xbp+60h] BYREF
if ( !a1->m_disableTextDelegate )
{
switch ( a2->getTag(a2) )
{
case 3:
CCTextInputNode::getString(a2, (__int64)&v36);
v22 = v36;
m_colorID = atoi(v36);
a1->m_colorID = m_colorID;
v24 = v22 - 24;
if ( v22 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v22 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *((_DWORD *)v22 - 2);
*((_DWORD *)v22 - 2) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v24);
m_colorID = a1->m_colorID;
}
if ( m_colorID < 0 )
v25 = 0;
else
v25 = m_colorID;
if ( v25 > 999 )
v25 = 999;
a1->m_colorID = v25;
ColorSelectPopup::updateCustomColorIdx(a1);
SetupTriggerPopup::updateEditorLabel(a1);
return;
case 4:
CCTextInputNode::getString(a2, (__int64)&v36);
v18 = v36;
m_copyColorID = atoi(v36);
a1->m_copyColorID = m_copyColorID;
v20 = v18 - 24;
if ( v18 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v18 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *((_DWORD *)v18 - 2);
*((_DWORD *)v18 - 2) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v20);
m_copyColorID = a1->m_copyColorID;
}
if ( m_copyColorID < 0 )
v21 = 0;
else
v21 = m_copyColorID;
if ( v21 > 999 )
v21 = 999;
a1->m_copyColorID = v21;
ColorSelectPopup::updateCopyColor(a1);
return;
case 5:
CCTextInputNode::getString(a2, (__int64)&v36);
v12 = atof(v36);
v13 = v36 - 24;
v14 = (const char *)&qword_124B6B0;
if ( v36 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)(v36 - 8);
do
v14 = (const char *)__ldaxr(v30);
while ( __stlxr((_DWORD)v14 - 1, v30) );
}
else
{
v14 = (const char *)*((unsigned int *)v36 - 2);
*((_DWORD *)v36 - 2) = (_DWORD)v14 - 1;
}
if ( (int)v14 <= 0 )
{
v35 = v12;
operator delete(v13);
v12 = v35;
}
}
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.02f", v14, v12);
a1->m_fadeTime = cocos2d::CCString::floatValue(v15);
ColorSelectPopup::updateDuration(a1);
m_fadeTimeSlider = a1->m_fadeTimeSlider;
v17 = a1->m_fadeTime / 10.0;
if ( v17 < 1.0 )
{
if ( v17 <= 0.0 )
{
Slider::setValue(m_fadeTimeSlider, 0.0);
return;
}
}
else
{
v17 = 1.0;
}
Slider::setValue(m_fadeTimeSlider, v17);
return;
case 8:
case 9:
case 0xA:
CCTextInputNode::getString(a2, (__int64)&v36);
v8 = v36;
v9 = atoi(v36);
v10 = v8 - 24;
if ( v8 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = (unsigned int *)(v8 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *((_DWORD *)v8 - 2);
*((_DWORD *)v8 - 2) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v10);
}
if ( v9 < 0 )
v9 = 0;
if ( v9 > 255 )
LOBYTE(v9) = -1;
v11 = a2->getTag(a2);
switch ( v11 )
{
case 9:
a1->m_currentColor.g = v9;
break;
case 10:
a1->m_currentColor.b = v9;
break;
case 8:
a1->m_currentColor.r = v9;
break;
}
goto LABEL_17;
case 0xB:
CCTextInputNode::getString(a1->m_hexInput, (__int64)&v36);
v4 = v36;
v5 = strlen(v36);
v6 = v4 - 24;
if ( v4 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v4 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *((_DWORD *)v4 - 2);
*((_DWORD *)v4 - 2) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v6);
}
if ( v5 == 6 )
{
CCTextInputNode::getString(a1->m_hexInput, (__int64)&v36);
v7 = ColorSelectPopup::hexToColor((const char **)&v36);
*(_WORD *)&a1->m_currentColor.r = v7;
a1->m_currentColor.b = BYTE2(v7);
if ( v36 - 24 != (char *)&qword_124B6B0 )
sub_73BBC8(v36 - 24);
LABEL_17:
ColorSelectPopup::selectColor(a1, (cocos2d::ccColor3B)*(_QWORD *)&a1->m_currentColor.r);
}
return;
default:
return;
}
}
}