//
// SetupCountTriggerPopup::textChanged from 0x1002bcce0 to 0x1002bcf04 (548 bytes)
//
// 2 xrefs:
// > sub_1002BCF10 @ 0x1002bcf1c
// > ??> @ 0x100906568
//
// 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 SetupCountTriggerPopup::textChanged(SetupCountTriggerPopup *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int *p_m_targetCount; // r15
EffectGameObject *m_gameObject; // rax
int m_itemID; // eax
char *v7; // r14
int v8; // ecx
int v9; // eax
EffectGameObject *v10; // rcx
char *v11; // r14
cocos2d::CCArray *m_gameObjects; // rdi
unsigned int v13; // r14d
char *v14; // r14
cocos2d::CCArray *v15; // rdi
unsigned int v16; // r14d
_QWORD v17[2]; // [rsp-38h] [rbp-38h] BYREF
char *v18; // [rsp-28h] [rbp-28h]
if ( !a1->m_disableTextDelegate )
{
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) )
{
if ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) == 1 )
{
CCTextInputNode::getString(v17, (__int64)a2, v2);
if ( (v17[0] & 1) != 0 )
{
v11 = v18;
p_m_targetCount = &a1->m_targetCount;
a1->m_targetCount = atoi(v18);
operator delete(v11);
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
goto LABEL_6;
}
else
{
p_m_targetCount = &a1->m_targetCount;
a1->m_targetCount = atoi((const char *)v17 + 1);
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
LABEL_6:
*(_DWORD *)(&m_gameObject->m_canSpawnTriggers + 1) = *p_m_targetCount;
return;
}
}
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects && (unsigned int)sub_100720070(m_gameObjects) )
{
v13 = 0;
do
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v13++) + 1836) = a1->m_targetCount;
while ( v13 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
else
{
CCTextInputNode::getString(v17, (__int64)a2, v2);
if ( (v17[0] & 1) != 0 )
{
v14 = v18;
a1->m_targetID = atoi(v18);
operator delete(v14);
}
else
{
a1->m_targetID = atoi((const char *)v17 + 1);
}
SetupCountTriggerPopup::updateTargetID(a1);
}
}
else
{
CCTextInputNode::getString(v17, (__int64)a2, v2);
if ( (v17[0] & 1) != 0 )
{
v7 = v18;
a1->m_itemID = atoi(v18);
operator delete(v7);
m_itemID = a1->m_itemID;
}
else
{
m_itemID = atoi((const char *)v17 + 1);
}
v8 = 0;
if ( m_itemID > 0 )
v8 = m_itemID;
v9 = 9999;
if ( v8 < 9999 )
v9 = v8;
a1->m_itemID = v9;
v10 = a1->m_gameObject;
if ( v10 )
{
v10->m_itemID = v9;
}
else
{
v15 = a1->m_gameObjects;
if ( v15 && (unsigned int)sub_100720070(v15) )
{
v16 = 0;
do
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v16++) + 1680) = a1->m_itemID;
while ( v16 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
SetupTriggerPopup::updateEditorLabel(a1);
}
}
}