//
// EditorUI::onTargetIDChange from 0x68f0f8 to 0x68f230 (312 bytes)
//
// 3 xrefs:
// > EditorUI::keyDown @ 0x6c5848
// > EditorUI::keyDown @ 0x6c5ecc
// > ??> @ 0x83d48
//
// 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 EditorUI::onTargetIDChange(EditorUI *a1, int a2)
{
GameObject *m_selectedObject; // x1
cocos2d::CCArray *m_selectedObjects; // x20
unsigned int v5; // w19
GameObject *v6; // x0
bool v7; // cf
unsigned int v8; // w1
unsigned int v9; // w19
unsigned int v10; // w1
cocos2d::CCArray *v11; // x0
EffectGameObject *v12; // x21
int m_targetGroupID; // w2
__int64 v14; // x22
cocos2d::CCString *v15; // x0
const char *CString; // x0
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject )
m_selectedObjects = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(
(cocos2d::CCArray *)a1->m_selectedObject,
m_selectedObject);
else
m_selectedObjects = a1->m_selectedObjects;
v5 = 0;
if ( (unsigned int)cocos2d::CCArray::count(m_selectedObjects) )
{
while ( 1 )
{
v7 = v5 >= (unsigned int)cocos2d::CCArray::count(m_selectedObjects);
v8 = v5++;
if ( v7 )
break;
v6 = (GameObject *)cocos2d::CCArray::objectAtIndex(m_selectedObjects, v8);
if ( !GameObject::isTrigger(v6) )
return;
}
v9 = 0;
while ( 1 )
{
v7 = v9 >= (unsigned int)cocos2d::CCArray::count(m_selectedObjects);
v10 = v9;
v11 = m_selectedObjects;
++v9;
if ( v7 )
break;
while ( 1 )
{
v12 = (EffectGameObject *)cocos2d::CCArray::objectAtIndex(v11, v10);
if ( !GameObject::isTrigger(v12) )
break;
m_targetGroupID = v12->m_targetGroupID;
if ( m_targetGroupID <= 0 )
break;
EffectGameObject::setTargetID(v12, m_targetGroupID + a2);
v14 = (__int64)v12->getChildByTag(v12, 999);
if ( !v14 )
break;
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)v12->m_targetGroupID);
CString = cocos2d::CCString::getCString(v15);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v14 + 912LL))(v14, CString);
v7 = v9 >= (unsigned int)cocos2d::CCArray::count(m_selectedObjects);
v10 = v9;
v11 = m_selectedObjects;
++v9;
if ( v7 )
return;
}
}
}
}