//
// EditorUI::onCreate from 0x7ca794 to 0x7ca8ec (344 bytes)
//
// 2 xrefs:
// > EditorUI::clickOnPosition @ 0x7d1c44
// > ??> @ 0x1015a8
//
// 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 12:54:11 +0000
//
__int64 __fastcall EditorUI::onCreate(EditorUI *this)
{
unsigned int v1; // w1
int locked; // w1
__int64 v5; // x1
int v6; // w0
bool v7; // cc
int v8; // w0
__int64 v9; // x2
float *Object; // x1
v1 = 0;
if ( !*((_DWORD *)this + 336) )
return v1;
locked = LevelEditorLayer::lockedLayerForObject(
*((LevelEditorLayer **)this + 180),
*(__int16 *)(*((_QWORD *)this + 180) + 14210LL),
0);
if ( locked == -1 )
{
v5 = *((_QWORD *)this + 180);
v6 = *(_DWORD *)(v5 + 14272) - *(_DWORD *)(v5 + 14276);
if ( v6 > 79999 )
{
v8 = *((_DWORD *)this + 336);
if ( v8 == 31 )
goto LABEL_10;
v9 = *(_QWORD *)(v5 + 1936);
if ( !*(_BYTE *)(v9 + 1201) )
{
EditorUI::showMaxError(this);
return 1;
}
}
else
{
v7 = v6 <= 39999;
v8 = *((_DWORD *)this + 336);
if ( v7 )
{
LABEL_9:
if ( v8 == 1329 && *(_DWORD *)(v5 + 14156) - *(_DWORD *)(v5 + 14160) > 2 )
{
EditorUI::showMaxCoinError(this);
return 1;
}
LABEL_10:
if ( *((_QWORD *)this + 187) || (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
EditorUI::createUndoSelectObject((cocos2d::CCArray ***)this, 1);
Object = EditorUI::onCreateObject(this, *((_DWORD *)this + 336));
if ( Object )
{
EditorUI::playSoundForCreatedObject(this, (GameObject *)Object);
return 1;
}
return 1;
}
if ( v8 == 31 )
goto LABEL_10;
v9 = *(_QWORD *)(v5 + 1936);
}
if ( !*(_BYTE *)(v9 + 1200) )
{
EditorUI::showMaxBasicError(this);
return 1;
}
goto LABEL_9;
}
EditorUI::showLockedLayerAlert(this, locked);
return 1;
}