//
// EditorUI::createNewKeyframeAnim from 0x3a34c8 to 0x3a3622 (346 bytes)
//
// 1 xrefs:
// > SetGroupIDLayer::onAnim @ 0x508a82
//
// 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::createNewKeyframeAnim(EditorUI *a1)
{
EditorUI *v1; // r4
cocos2d::CCArray *v2; // r0
cocos2d::CCObject *m_selectedObject; // r1
cocos2d::CCArray *v4; // r5
cocos2d::CCArray *v5; // r0
cocos2d::CCArray *v6; // r9
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r7
int v9; // r5
int v10; // t1
cocos2d::CCObject *v11; // r0
cocos2d::CCObject_vtbl *v12; // r3
int v13; // r6
bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r3
unsigned int v15; // r12
bool (__fastcall *v16)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r8
int v17; // r3
int v18; // t1
const cocos2d::CCPoint *v19; // r0
cocos2d::CCPoint v20; // r2
KeyframeGameObject *Object; // r6
cocos2d::CCArray *NewKeyframeAnim; // r0
int v23; // r0
cocos2d::CCObject **v24; // [sp+4h] [bp-20h]
int v25; // [sp+8h] [bp-1Ch]
unsigned int v26; // [sp+Ch] [bp-18h]
cocos2d::CCPoint v27; // [sp+14h] [bp-10h] BYREF
v1 = a1;
if ( a1->m_selectedObject || (a1 = (EditorUI *)cocos2d::CCArray::count(a1->m_selectedObjects)) != nullptr )
{
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
m_selectedObject = v1->m_selectedObject;
v4 = v2;
if ( m_selectedObject )
cocos2d::CCArray::addObject(v2, m_selectedObject);
else
cocos2d::CCArray::addObjectsFromArray(v2, v1->m_selectedObjects);
EditorUI::deselectAll(v1);
v5 = (cocos2d::CCArray *)((int (__fastcall *)(LevelEditorLayer *, _DWORD))v1->m_editorLayer->updateVisibility)(
v1->m_editorLayer,
0);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
if ( v4 )
{
data = v4->data;
if ( data->num )
{
arr = data->arr;
v24 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v24 )
{
v10 = (int)*arr++;
v9 = v10;
if ( !v10 )
break;
if ( *(_BYTE *)(v9 + 1014) )
{
v11 = cocos2d::CCDictionary::objectForKey(v1->m_editorLayer->m_parentGroupIDs, *(_DWORD *)(v9 + 772));
if ( v11 )
{
v12 = v11[1].__vftable;
if ( v12->copyWithZone )
{
v13 = (int)v12->copyWithZone + 0x40000000;
isEqual = v12->isEqual;
v15 = (unsigned int)isEqual + 4 * v13 - 4;
v16 = isEqual;
while ( (unsigned int)v16 <= v15 )
{
v18 = *(_DWORD *)v16;
v16 = (bool (__fastcall *)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *))((char *)v16 + 4);
v17 = v18;
if ( !v18 )
break;
v26 = v15;
v25 = *(_DWORD *)(v17 + 52);
v19 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(int))(*(_DWORD *)v9 + 96))(v9);
cocos2d::CCPoint::CCPoint(&v27, v19);
LODWORD(v20.x) = &v27;
Object = (KeyframeGameObject *)EditorUI::createObject(v1, 3032, v20);
LevelEditorLayer::removeSpecial(v1->m_editorLayer, Object);
cocos2d::CCArray::addObject(v6, Object);
EffectGameObject::setTargetID(Object, v25);
KeyframeGameObject::updateShadowObjects(Object, v1->m_editorLayer, v1);
NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(v1->m_editorLayer);
v23 = NewKeyframeAnim->getTag(NewKeyframeAnim);
Object->m_keyframeIndex = 0;
Object->m_keyframeGroup = v23;
LevelEditorLayer::addSpecial(v1->m_editorLayer, Object);
v15 = v26;
}
}
}
}
}
}
}
EditorUI::selectObjects(v1, v6, 0);
}
}