//
// SetupRandTriggerPopup::textChanged from 0x1005e6950 to 0x1005e6c18 (712 bytes)
//
// 2 xrefs:
// > sub_1005E6C20 @ 0x1005e6c2c
// > ??> @ 0x1009776a0
//
// 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 SetupRandTriggerPopup::textChanged(SetupRandTriggerPopup *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int m_groupID1; // eax
int m_groupID2; // eax
char *v6; // r14
int v7; // ecx
int v8; // esi
EffectGameObject *m_gameObject; // rdi
cocos2d::CCArray *m_gameObjects; // rdi
unsigned int v11; // r14d
EffectGameObject *v12; // rax
char *v13; // r14
int v14; // ecx
int v15; // esi
EffectGameObject *v16; // rdi
cocos2d::CCArray *v17; // rdi
unsigned int v18; // r14d
EffectGameObject *v19; // rax
char *v20; // r14
cocos2d::CCString *v21; // rax
float v22; // xmm0_4
EffectGameObject *v23; // rax
unsigned int v24; // r14d
char v25; // [rsp-38h] [rbp-38h]
_QWORD v26[2]; // [rsp-30h] [rbp-30h] BYREF
char *v27; // [rsp-20h] [rbp-20h]
if ( !a1->m_disableTextDelegate )
{
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) == 3 )
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v6 = v27;
a1->m_groupID1 = atoi(v27);
operator delete(v6);
m_groupID1 = a1->m_groupID1;
}
else
{
m_groupID1 = atoi((const char *)v26 + 1);
}
v7 = 0;
if ( m_groupID1 > 0 )
v7 = m_groupID1;
v8 = 9999;
if ( v7 < 9999 )
v8 = v7;
a1->m_groupID1 = v8;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
EffectGameObject::setTargetID(m_gameObject, v8);
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects && (unsigned int)sub_100720070(m_gameObjects) )
{
v11 = 0;
do
{
v12 = (EffectGameObject *)sub_1007200C0(a1->m_gameObjects, v11);
EffectGameObject::setTargetID(v12, a1->m_groupID1);
++v11;
}
while ( v11 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
LABEL_30:
SetupTriggerPopup::updateEditorLabel(a1);
return;
}
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) == 5 )
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v13 = v27;
a1->m_groupID2 = atoi(v27);
operator delete(v13);
m_groupID2 = a1->m_groupID2;
}
else
{
m_groupID2 = atoi((const char *)v26 + 1);
}
v14 = 0;
if ( m_groupID2 > 0 )
v14 = m_groupID2;
v15 = 9999;
if ( v14 < 9999 )
v15 = v14;
a1->m_groupID2 = v15;
v16 = a1->m_gameObject;
if ( v16 )
{
EffectGameObject::setTargetID2(v16, v15);
}
else
{
v17 = a1->m_gameObjects;
if ( v17 && (unsigned int)sub_100720070(v17) )
{
v18 = 0;
do
{
v19 = (EffectGameObject *)sub_1007200C0(a1->m_gameObjects, v18);
EffectGameObject::setTargetID2(v19, a1->m_groupID2);
++v18;
}
while ( v18 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
goto LABEL_30;
}
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) == 4 )
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v20 = v27;
v25 = COERCE_UNSIGNED_INT64(atof(v27));
operator delete(v20);
}
else
{
atof((const char *)v26 + 1);
}
v21 = (cocos2d::CCString *)sub_1007AB580("%.04f", v25);
v22 = cocos2d::CCString::floatValue(v21);
a1->m_chancePercent = v22;
v23 = a1->m_gameObject;
if ( v23 )
{
v23->m_duration = v22;
}
else if ( (unsigned int)sub_100720070(a1->m_gameObjects) )
{
v24 = 0;
do
*(float *)(sub_1007200C0(a1->m_gameObjects, v24++) + 1452) = a1->m_chancePercent;
while ( v24 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
}
}