//
// EditorUI::onCreate from 0x100474498 to 0x1004745c4 (300 bytes)
//
// 1 xrefs:
// > EditorUI::clickOnPosition @ 0x100474050
//
// This function is hookable on this platform (idp: arm, 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 11:05:40 +0000
//
bool __fastcall EditorUI::onCreate(__int64 a1)
{
int v1; // w20
int locked; // w0
__int64 v5; // x8
int v6; // w10
int v7; // w9
__n128 v8; // q0
__int64 Object; // x0
v1 = *(_DWORD *)(a1 + 1344);
if ( !v1 )
return v1 != 0;
locked = LevelEditorLayer::lockedLayerForObject(
*(_QWORD *)(a1 + 1440),
*(__int16 *)(*(_QWORD *)(a1 + 1440) + 14210LL),
0);
if ( locked != -1 )
{
EditorUI::showLockedLayerAlert(a1, locked);
return v1 != 0;
}
v5 = *(_QWORD *)(a1 + 1440);
v6 = *(_DWORD *)(v5 + 14272) - *(_DWORD *)(v5 + 14276);
if ( v6 < 80000 )
{
v7 = *(_DWORD *)(a1 + 1344);
if ( v6 < 40000 )
goto LABEL_12;
if ( v7 != 31 )
{
LABEL_11:
if ( (*(_BYTE *)(*(_QWORD *)(v5 + 1936) + 1200LL) & 1) == 0 )
{
EditorUI::showMaxBasicError(a1);
return v1 != 0;
}
LABEL_12:
if ( v7 == 1329 && *(_DWORD *)(v5 + 14156) - *(_DWORD *)(v5 + 14160) >= 3 )
{
EditorUI::showMaxCoinError(a1);
return v1 != 0;
}
}
}
else
{
v7 = *(_DWORD *)(a1 + 1344);
if ( v7 != 31 )
{
if ( (*(_BYTE *)(*(_QWORD *)(v5 + 1936) + 1201LL) & 1) == 0 )
{
EditorUI::showMaxError(a1);
return v1 != 0;
}
goto LABEL_11;
}
}
if ( *(_QWORD *)(a1 + 1496) || (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 896)) )
v8.n128_f64[0] = EditorUI::createUndoSelectObject(a1, 1);
Object = EditorUI::onCreateObject(a1, *(unsigned int *)(a1 + 1344), v8);
if ( Object )
EditorUI::playSoundForCreatedObject(Object, Object);
return v1 != 0;
}