//
// SetupPulsePopup::textChanged from 0x1003b7818 to 0x1003b7c3c (1060 bytes)
//
// 2 xrefs:
// > sub_1003B7C58 @ 0x1003b7c5c
// > ??> @ 0x10080f360
//
// 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 SetupPulsePopup::textChanged(SetupPulsePopup *a1, CCTextInputNode *a2)
{
int v4; // w0
int v5; // w21
int m_copyColorID; // w0
float m_holdTime; // s0
char *v8; // x22
GLubyte v9; // w21
int v10; // w0
int m_targetGroupID; // w0
float m_fadeInTime; // s0
float m_fadeOutTime; // s0
__int16 v14; // w8
char *v15; // x20
int v16; // w8
char *v17; // x20
float v18; // s0
Slider *m_fadeOutSlider; // x0
float v20; // s0
char *v21; // x20
unsigned int v22; // w8
unsigned int v23; // w9
char *v24; // x20
float v25; // s0
size_t v26; // x21
__int64 v27; // x0
char *v28; // x20
float v29; // s0
float v30; // s0
float v31; // s1
_BOOL4 v32; // w8
_BOOL4 v33; // w9
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
char v35; // [xsp+17h] [xbp-49h]
char __s[8]; // [xsp+18h] [xbp-48h] BYREF
char v37; // [xsp+2Fh] [xbp-31h]
if ( a1->m_disableTextDelegate )
return;
v4 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
if ( v4 > 9 )
{
if ( (unsigned int)(v4 - 11) < 3 )
{
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v8 = *(char **)__s;
v5 = atoi(*(const char **)__s);
operator delete(v8);
}
else
{
v5 = atoi(__s);
}
if ( (v5 & ~(v5 >> 31)) >= 255 )
v9 = -1;
else
v9 = v5 & ~(v5 >> 31);
v10 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
switch ( v10 )
{
case 13:
a1->m_currentColor.b = v9;
break;
case 12:
a1->m_currentColor.g = v9;
break;
case 11:
a1->m_currentColor.r = v9;
break;
}
v14 = *(_WORD *)&a1->m_currentColor.r;
__s[2] = a1->m_currentColor.b;
*(_WORD *)__s = v14;
LABEL_36:
((void (__fastcall *)(cocos2d::extension::CCControlColourPicker *, char *))a1->m_colorPicker->setColorValue)(
a1->m_colorPicker,
__s);
return;
}
if ( v4 != 10 )
{
if ( v4 != 14 )
return;
CCTextInputNode::getString((__int64)a1->m_hexInput, __s);
if ( v37 < 0 )
{
v26 = strlen(*(const char **)__s);
operator delete(*(void **)__s);
if ( v26 != 6 )
return;
}
else if ( strlen(__s) != 6 )
{
return;
}
CCTextInputNode::getString((__int64)a1->m_hexInput, __p);
v27 = ColorSelectPopup::hexToColor(__p);
*(_WORD *)&a1->m_currentColor.r = v27;
a1->m_currentColor.b = BYTE2(v27);
if ( v35 < 0 )
{
operator delete(__p[0]);
LODWORD(v27) = *(unsigned __int16 *)&a1->m_currentColor.r | (a1->m_currentColor.b << 16);
}
*(_WORD *)__s = v27;
__s[2] = BYTE2(v27);
goto LABEL_36;
}
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v28 = *(char **)__s;
v29 = atof(*(const char **)__s);
a1->m_fadeOutTime = v29;
operator delete(v28);
m_fadeOutTime = a1->m_fadeOutTime;
}
else
{
m_fadeOutTime = atof(__s);
a1->m_fadeOutTime = m_fadeOutTime;
}
a1->m_fadeOutTime = fmaxf(m_fadeOutTime, 0.0);
SetupPulsePopup::updateFadeOutTime(a1);
m_fadeOutSlider = a1->m_fadeOutSlider;
v20 = a1->m_fadeOutTime;
goto LABEL_61;
}
if ( v4 > 7 )
{
if ( v4 == 8 )
{
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v24 = *(char **)__s;
v25 = atof(*(const char **)__s);
a1->m_fadeInTime = v25;
operator delete(v24);
m_fadeInTime = a1->m_fadeInTime;
}
else
{
m_fadeInTime = atof(__s);
a1->m_fadeInTime = m_fadeInTime;
}
a1->m_fadeInTime = fmaxf(m_fadeInTime, 0.0);
SetupPulsePopup::updateFadeInTime(a1);
m_fadeOutSlider = a1->m_fadeInSlider;
v20 = a1->m_fadeInTime;
}
else
{
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v17 = *(char **)__s;
v18 = atof(*(const char **)__s);
a1->m_holdTime = v18;
operator delete(v17);
m_holdTime = a1->m_holdTime;
}
else
{
m_holdTime = atof(__s);
a1->m_holdTime = m_holdTime;
}
a1->m_holdTime = fmaxf(m_holdTime, 0.0);
SetupPulsePopup::updateHoldTime(a1);
m_fadeOutSlider = a1->m_holdSlider;
v20 = a1->m_holdTime;
}
LABEL_61:
v30 = v20 / 10.0;
v31 = 1.0;
v32 = v30 >= 1.0;
v33 = v30 > 0.0 || v30 >= 1.0;
if ( v30 <= 0.0 )
v32 = 1;
if ( !v33 )
v31 = 0.0;
if ( v32 )
v30 = v31;
Slider::setValue(m_fadeOutSlider, v30);
return;
}
if ( v4 == 4 )
{
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v21 = *(char **)__s;
a1->m_targetGroupID = atoi(*(const char **)__s);
operator delete(v21);
m_targetGroupID = a1->m_targetGroupID;
}
else
{
m_targetGroupID = atoi(__s);
a1->m_targetGroupID = m_targetGroupID;
}
if ( m_targetGroupID <= 1 )
v22 = 1;
else
v22 = m_targetGroupID;
if ( a1->m_pulseTargetType == 1 )
v23 = 9999;
else
v23 = 999;
if ( v23 < v22 )
v22 = v23;
a1->m_targetGroupID = v22;
SetupPulsePopup::updateTargetID(a1);
SetupTriggerPopup::updateEditorLabel(a1);
}
else if ( v4 == 5 )
{
CCTextInputNode::getString((__int64)a2, __s);
if ( v37 < 0 )
{
v15 = *(char **)__s;
a1->m_copyColorID = atoi(*(const char **)__s);
operator delete(v15);
m_copyColorID = a1->m_copyColorID;
}
else
{
m_copyColorID = atoi(__s);
a1->m_copyColorID = m_copyColorID;
}
v16 = m_copyColorID & ~(m_copyColorID >> 31);
if ( v16 >= 999 )
v16 = 999;
a1->m_copyColorID = v16;
SetupPulsePopup::updateCopyColor(a1);
}
}