//
// EditorUI::createNewKeyframeAnim from 0x1003f34d4 to 0x1003f3694 (448 bytes)
//
// 1 xrefs:
// > SetGroupIDLayer::onAnim @ 0x10003e464
//
// 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 EditorUI::createNewKeyframeAnim(EditorUI *a1)
{
cocos2d::CCObject *v2; // x0
cocos2d::CCObject *v3; // x21
cocos2d::CCArray *v4; // x20
cocos2d::CCObject_vtbl *v5; // x9
__int64 copyWithZone_low; // x8
void (__cdecl *v7)(cocos2d::CCObject *__hidden); // x24
unsigned __int64 v8; // x25
__int64 v9; // x21
cocos2d::CCObject *v10; // x0
cocos2d::CCObject_vtbl *v11; // x9
__int64 v12; // x8
unsigned __int64 v13; // x26
unsigned __int64 v14; // x27
int v15; // w22
__int64 *v16; // x0
KeyframeGameObject *Object; // x23
cocos2d::CCArray *NewKeyframeAnim; // x0
__int64 v19; // [xsp+8h] [xbp-58h] BYREF
cocos2d::CCPoint v20; // 0:s0.4,4:s1.4
if ( a1->m_selectedObject || (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )
{
v2 = sub_10024A15C();
v3 = v2;
if ( a1->m_selectedObject )
sub_10024A2D0((__int64)v2);
else
sub_10024A360((__int64)v2, (__int64)a1->m_selectedObjects);
EditorUI::deselectAll(a1);
((void (__fastcall *)(LevelEditorLayer *, float))a1->m_editorLayer->updateVisibility)(a1->m_editorLayer, 0.0);
v4 = (cocos2d::CCArray *)sub_10024A15C();
if ( v3 )
{
v5 = v3[1].__vftable;
copyWithZone_low = LODWORD(v5->copyWithZone);
if ( (_DWORD)copyWithZone_low )
{
v7 = v5->~CCObject_0;
v8 = (unsigned __int64)v7 + 8 * copyWithZone_low - 8;
do
{
v9 = *(_QWORD *)v7;
if ( !*(_QWORD *)v7 )
break;
if ( *(_BYTE *)(v9 + 1170) == 1 )
{
v10 = cocos2d::CCDictionary::objectForKey(a1->m_editorLayer->m_parentGroupIDs, *(unsigned int *)(v9 + 916));
if ( v10 )
{
v11 = v10[1].__vftable;
v12 = LODWORD(v11->copyWithZone);
if ( (_DWORD)v12 )
{
v13 = (unsigned __int64)v11->~CCObject_0;
v14 = v13 + 8 * v12 - 8;
do
{
if ( !*(_QWORD *)v13 )
break;
v15 = *(_DWORD *)(*(_QWORD *)v13 + 56LL);
v16 = (__int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 192LL))(v9);
v20.x = sub_1000229B8(&v19, v16);
Object = (KeyframeGameObject *)EditorUI::createObject(a1, 3032, v20);
LevelEditorLayer::removeSpecial(a1->m_editorLayer, Object);
sub_10024A2D0((__int64)v4);
EffectGameObject::setTargetID(Object, v15);
KeyframeGameObject::updateShadowObjects(Object, a1->m_editorLayer, a1);
NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(a1->m_editorLayer);
Object->m_keyframeGroup = ((__int64 (__fastcall *)(cocos2d::CCArray *))NewKeyframeAnim->getTag)(NewKeyframeAnim);
Object->m_keyframeIndex = 0;
LevelEditorLayer::addSpecial(a1->m_editorLayer, Object);
v13 += 8LL;
}
while ( v13 <= v14 );
}
}
}
v7 = (void (__cdecl *)(cocos2d::CCObject *__hidden))((char *)v7 + 8);
}
while ( (unsigned __int64)v7 <= v8 );
}
}
EditorUI::selectObjects(a1, v4, 0);
}
}