//
// SetupShakePopup::textChanged from 0x95a49c to 0x95a7dc (832 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'SetupShakePopup::textChanged @ 0x95a7ec
// > ??> @ 0x5aff0
// > ??> @ 0x11baa18
//
// 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 SetupShakePopup::textChanged(SetupShakePopup *a1, CCTextInputNode *a2)
{
float v3; // s0
char *v4; // x0
const char *v5; // x1
cocos2d::CCString *v6; // x0
float v7; // s0
Slider *m_durationSlider; // x0
float v9; // s1
float v10; // s0
bool v11; // nf
float v12; // s0
char *v13; // x0
const char *v14; // x1
cocos2d::CCString *v15; // x0
float v16; // s0
float v17; // s0
char *v18; // x0
const char *v19; // x1
cocos2d::CCString *v20; // x0
float v21; // s0
unsigned int *v22; // x2
unsigned int *v23; // x2
unsigned int *v24; // x2
float v26; // [xsp+20h] [xbp+20h]
float v27; // [xsp+20h] [xbp+20h]
float v28; // [xsp+20h] [xbp+20h]
char *v29; // [xsp+40h] [xbp+40h] BYREF
if ( !a1->m_disableTextDelegate )
{
if ( a2->getTag(a2) == 5 )
{
CCTextInputNode::getString(a2, (__int64)&v29);
v12 = atof(v29);
v13 = v29 - 24;
v14 = (const char *)&qword_124B6B0;
if ( v29 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v29 - 8);
do
v14 = (const char *)__ldaxr(v23);
while ( __stlxr((_DWORD)v14 - 1, v23) );
}
else
{
v14 = (const char *)*((unsigned int *)v29 - 2);
*((_DWORD *)v29 - 2) = (_DWORD)v14 - 1;
}
if ( (int)v14 <= 0 )
{
v27 = v12;
operator delete(v13);
v12 = v27;
}
}
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.02f", v14, v12);
v16 = cocos2d::CCString::floatValue(v15);
if ( v16 <= 0.0 )
{
v16 = 0.0;
}
else if ( v16 >= 10.0 )
{
v16 = 10.0;
}
a1->m_duration = v16;
SetupShakePopup::updateDuration(a1);
m_durationSlider = a1->m_durationSlider;
v9 = 1.0;
v10 = a1->m_duration / 10.0;
v11 = v10 < 1.0;
if ( v10 >= 1.0 )
{
LABEL_9:
if ( v11 )
{
LABEL_11:
Slider::setValue(m_durationSlider, v10);
return;
}
LABEL_10:
v10 = v9;
goto LABEL_11;
}
}
else if ( a2->getTag(a2) == 8 )
{
CCTextInputNode::getString(a2, (__int64)&v29);
v17 = atof(v29);
v18 = v29 - 24;
v19 = (const char *)&qword_124B6B0;
if ( v29 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v29 - 8);
do
v19 = (const char *)__ldaxr(v24);
while ( __stlxr((_DWORD)v19 - 1, v24) );
}
else
{
v19 = (const char *)*((unsigned int *)v29 - 2);
*((_DWORD *)v29 - 2) = (_DWORD)v19 - 1;
}
if ( (int)v19 <= 0 )
{
v28 = v17;
operator delete(v18);
v17 = v28;
}
}
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.02f", v19, v17);
v21 = cocos2d::CCString::floatValue(v20);
if ( v21 <= 0.0 )
{
v21 = 0.0;
}
else if ( v21 >= 0.2 )
{
v21 = 0.2;
}
a1->m_interval = v21;
SetupShakePopup::updateInterval(a1);
m_durationSlider = a1->m_intervalSlider;
v9 = 1.0;
v10 = a1->m_duration / 0.1;
if ( v10 >= 1.0 )
goto LABEL_10;
}
else
{
CCTextInputNode::getString(a2, (__int64)&v29);
v3 = atof(v29);
v4 = v29 - 24;
v5 = (const char *)&qword_124B6B0;
if ( v29 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v29 - 8);
do
v5 = (const char *)__ldaxr(v22);
while ( __stlxr((_DWORD)v5 - 1, v22) );
}
else
{
v5 = (const char *)*((unsigned int *)v29 - 2);
*((_DWORD *)v29 - 2) = (_DWORD)v5 - 1;
}
if ( (int)v5 <= 0 )
{
v26 = v3;
operator delete(v4);
v3 = v26;
}
}
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.02f", v5, v3);
v7 = cocos2d::CCString::floatValue(v6);
if ( v7 <= 0.0 )
{
v7 = 0.0;
}
else if ( v7 >= 100.0 )
{
v7 = 100.0;
}
a1->m_strength = v7;
SetupShakePopup::updateShake(a1);
m_durationSlider = a1->m_strengthSlider;
v9 = 1.0;
v10 = a1->m_strength / 5.0;
v11 = v10 < 1.0;
if ( v10 >= 1.0 )
goto LABEL_9;
}
if ( v10 > 0.0 )
goto LABEL_11;
Slider::setValue(m_durationSlider, 0.0);
}
}