//
// SetupMGTrigger::textChanged from 0x1404285b0 to 0x140428842 (658 bytes)
//
// 4 xrefs:
// > ??> @ 0x1405e7ab8
// > ??> @ 0x1406a0c20
// > ??> @ 0x1406a0c30
// > ??> @ 0x1406d9818
//
// 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 SetupMGTrigger::textChanged(SetupMGTrigger *a1, CCTextInputNode *a2)
{
int v4; // eax
const char *v5; // rax
size_t v6; // r8
const char *v7; // rcx
float v8; // xmm6_4
char *v9; // rcx
cocos2d::CCString *v10; // rax
float v11; // xmm1_4
float v12; // xmm2_4
cocos2d::CCTouchScriptHandlerEntry *m_pScriptTouchHandlerEntry; // rcx
const char *v14; // rax
size_t v15; // r8
const char *v16; // rcx
int v17; // edi
char *v18; // rcx
float v19; // xmm2_4
char *String[2]; // [rsp+28h] [rbp-40h] BYREF
__int128 v21; // [rsp+38h] [rbp-30h]
if ( !LOBYTE(a1->m_fSkewX) )
{
v4 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) - 1;
if ( v4 )
{
if ( v4 != 2 )
return;
v5 = a2->m_textField->getString(&a2->m_textField->cocos2d::CCLabelProtocol);
*(_OWORD *)String = 0;
v6 = -1;
v21 = 0;
do
++v6;
while ( v5[v6] );
sub_14003A930(String, v5, v6);
v7 = (const char *)String;
if ( *((_QWORD *)&v21 + 1) > 0xFu )
v7 = String[0];
v8 = atof(v7);
if ( *((_QWORD *)&v21 + 1) > 0xFu )
{
v9 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v21 + 1) + 1LL) >= 0x1000 )
{
v9 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
v10 = cocos2d::CCString::createWithFormat("%.02f", v8);
*(float *)&a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = cocos2d::CCString::floatValue(v10);
GJFollowCommandLayer::updateDuration((__int64)&a1[-1].m_pScriptAccelerateHandlerEntry);
v11 = 0.0;
v12 = fminf(
1.0,
*(float *)&a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable
/ 10.0);
if ( v12 >= 0.0 )
v11 = v12;
m_pScriptTouchHandlerEntry = *(cocos2d::CCTouchScriptHandlerEntry **)&a1->m_bUseChildIndex;
goto LABEL_31;
}
v14 = a2->m_textField->getString(&a2->m_textField->cocos2d::CCLabelProtocol);
*(_OWORD *)String = 0;
v15 = -1;
v21 = 0;
do
++v15;
while ( v14[v15] );
sub_14003A930(String, v14, v15);
v16 = (const char *)String;
if ( *((_QWORD *)&v21 + 1) > 0xFu )
v16 = String[0];
v17 = atoi(v16);
if ( *((_QWORD *)&v21 + 1) > 0xFu )
{
v18 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v21 + 1) + 1LL) >= 0x1000 )
{
v18 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v18 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v18);
}
LODWORD(a1->m_pScriptKeypadHandlerEntry) = (int)(float)((float)v17 * 3.0);
SetupMGTrigger::updateMoveCommandPosY((SetupMGTrigger *)((char *)a1 - 632));
v11 = 1.0;
v19 = fminf(1.0, (float)(floorf((float)SLODWORD(a1->m_pScriptKeypadHandlerEntry) / 3.0) / 200.0) + 0.5);
if ( v19 >= 0.0 )
{
if ( v19 > 1.0 )
{
LABEL_30:
m_pScriptTouchHandlerEntry = a1->m_pScriptTouchHandlerEntry;
LABEL_31:
Slider::setValue((Slider *)m_pScriptTouchHandlerEntry, v11);
return;
}
if ( v19 >= 0.0 )
{
v11 = v19;
goto LABEL_30;
}
}
v11 = 0.0;
goto LABEL_30;
}
}