//
// EditorUI::onCreate from 0x10000ce30 to 0x10000cf77 (327 bytes)
//
// 1 xrefs:
// > EditorUI::clickOnPosition @ 0x10000c750
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:18:50 +0000
//
bool __fastcall EditorUI::onCreate(__int64 a1)
{
int v1; // r14d
unsigned int locked; // eax
__int64 v4; // rax
int v5; // edx
int v6; // ecx
__int64 SelectedObjects; // rax
__int64 v8; // rax
__int64 Object; // rax
v1 = *(_DWORD *)(a1 + 1344);
if ( !v1 )
return v1 != 0;
locked = LevelEditorLayer::lockedLayerForObject(
*(_QWORD *)(a1 + 1440),
(unsigned int)*(__int16 *)(*(_QWORD *)(a1 + 1440) + 14210LL),
0);
if ( locked != -1 )
{
EditorUI::showLockedLayerAlert(a1, locked);
return v1 != 0;
}
v4 = *(_QWORD *)(a1 + 1440);
v5 = *(_DWORD *)(v4 + 14272) - *(_DWORD *)(v4 + 14276);
if ( v5 < 80000 )
{
v6 = *(_DWORD *)(a1 + 1344);
if ( v5 < 40000 )
goto LABEL_12;
if ( v6 != 31 )
{
LABEL_11:
if ( !*(_BYTE *)(*(_QWORD *)(v4 + 1936) + 1200LL) )
{
EditorUI::showMaxBasicError(a1);
return v1 != 0;
}
LABEL_12:
if ( v6 == 1329 && *(_DWORD *)(v4 + 14156) - *(_DWORD *)(v4 + 14160) >= 3 )
{
EditorUI::showMaxCoinError(a1);
return v1 != 0;
}
}
}
else
{
v6 = *(_DWORD *)(a1 + 1344);
if ( v6 != 31 )
{
if ( !*(_BYTE *)(*(_QWORD *)(v4 + 1936) + 1201LL) )
{
EditorUI::showMaxError(a1);
return v1 != 0;
}
goto LABEL_11;
}
}
if ( *(_QWORD *)(a1 + 1496) || (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 896)) )
{
SelectedObjects = EditorUI::getSelectedObjects(a1);
v8 = UndoObject::createWithArray(SelectedObjects, 6);
*(_BYTE *)(v8 + 80) = 1;
LevelEditorLayer::addToUndoList(*(_QWORD *)(a1 + 1440), v8, 0);
}
Object = EditorUI::onCreateObject(a1, *(unsigned int *)(a1 + 1344));
if ( Object )
EditorUI::playSoundForCreatedObject(a1, Object);
return v1 != 0;
}