//
// SetupCollisionTriggerPopup::textChanged from 0x100396d70 to 0x100397016 (678 bytes)
//
// 2 xrefs:
// > sub_100397020 @ 0x10039702c
// > ??> @ 0x100920b48
//
// 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 SetupCollisionTriggerPopup::textChanged(SetupCollisionTriggerPopup *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int m_blockBID; // eax
int m_blockAID; // eax
int m_targetID; // eax
char *v7; // r14
int v8; // ecx
int v9; // eax
EffectGameObject *v10; // rcx
char *v11; // r14
int v12; // ecx
int v13; // eax
EffectGameObject *m_gameObject; // rcx
char *v15; // r14
int v16; // ecx
int v17; // esi
EffectGameObject *v18; // rdi
cocos2d::CCArray *v19; // rdi
unsigned int v20; // r14d
cocos2d::CCArray *m_gameObjects; // rdi
unsigned int v22; // r14d
cocos2d::CCArray *v23; // rdi
unsigned int v24; // r14d
EffectGameObject *v25; // rax
_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) )
{
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) == 1 )
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v11 = v27;
a1->m_blockBID = atoi(v27);
operator delete(v11);
m_blockBID = a1->m_blockBID;
}
else
{
m_blockBID = atoi((const char *)v26 + 1);
}
v12 = 0;
if ( m_blockBID > 0 )
v12 = m_blockBID;
v13 = 9999;
if ( v12 < 9999 )
v13 = v12;
a1->m_blockBID = v13;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
m_gameObject->m_itemID2 = v13;
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects && (unsigned int)sub_100720070(m_gameObjects) )
{
v22 = 0;
do
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v22++) + 1668) = a1->m_blockBID;
while ( v22 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
}
else
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v15 = v27;
a1->m_targetID = atoi(v27);
operator delete(v15);
m_targetID = a1->m_targetID;
}
else
{
m_targetID = atoi((const char *)v26 + 1);
}
v16 = 0;
if ( m_targetID > 0 )
v16 = m_targetID;
v17 = 9999;
if ( v16 < 9999 )
v17 = v16;
a1->m_targetID = v17;
v18 = a1->m_gameObject;
if ( v18 )
{
EffectGameObject::setTargetID(v18, v17);
}
else
{
v23 = a1->m_gameObjects;
if ( v23 && (unsigned int)sub_100720070(v23) )
{
v24 = 0;
do
{
v25 = (EffectGameObject *)sub_1007200C0(a1->m_gameObjects, v24);
EffectGameObject::setTargetID(v25, a1->m_targetID);
++v24;
}
while ( v24 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
SetupTriggerPopup::updateEditorLabel(a1);
}
}
else
{
CCTextInputNode::getString(v26, (__int64)a2, v2);
if ( (v26[0] & 1) != 0 )
{
v7 = v27;
a1->m_blockAID = atoi(v27);
operator delete(v7);
m_blockAID = a1->m_blockAID;
}
else
{
m_blockAID = atoi((const char *)v26 + 1);
}
v8 = 0;
if ( m_blockAID > 0 )
v8 = m_blockAID;
v9 = 9999;
if ( v8 < 9999 )
v9 = v8;
a1->m_blockAID = v9;
v10 = a1->m_gameObject;
if ( v10 )
{
v10->m_itemID = v9;
}
else
{
v19 = a1->m_gameObjects;
if ( v19 && (unsigned int)sub_100720070(v19) )
{
v20 = 0;
do
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v20++) + 1680) = a1->m_blockAID;
while ( v20 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
}
}
}