//
// EditorUI::onCreate from 0x14010f3f0 to 0x14010f5e5 (501 bytes)
//
// 2 xrefs:
// > EditorUI::clickOnPosition @ 0x1400e2759
// > ??> @ 0x1406c8e5c
//
// 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
//
// Hidden C++ exception states: #wind=1
bool EditorUI::onCreate(EditorUI *a1)
{
int m_selectedObjectIndex; // edx
LevelEditorLayer *m_editorLayer; // rcx
int v5; // eax
cocos2d::CCString *v6; // rax
int v7; // edi
const char *CString; // rax
size_t v9; // r8
__int64 v10; // rax
FLAlertLayer *v11; // rbx
__int128 v12; // [rsp+50h] [rbp-48h] BYREF
__int64 v13; // [rsp+60h] [rbp-38h]
__int64 v14; // [rsp+68h] [rbp-30h]
_BYTE v15[32]; // [rsp+70h] [rbp-28h] BYREF
m_selectedObjectIndex = a1->m_selectedObjectIndex;
if ( !m_selectedObjectIndex )
return 0;
m_editorLayer = a1->m_editorLayer;
v5 = m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed;
if ( v5 < 80000 )
{
if ( v5 < 40000 )
{
LABEL_11:
if ( m_selectedObjectIndex == 1329 && m_editorLayer->m_coinCount.random - m_editorLayer->m_coinCount.seed >= 3 )
{
if ( !a1->m_alertShown )
{
a1->m_alertShown = 1;
v6 = cocos2d::CCString::createWithFormat("You cannot add more than 3 coins in a single level.");
v7 = (_DWORD)a1 + 408;
if ( !a1 )
v7 = 0;
CString = cocos2d::CCString::getCString(v6);
v12 = 0;
v13 = 0;
v14 = 0;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003A930(&v12, CString, v9);
v10 = sub_14003BDB0((__int64)v15, (__int64)&v12);
v11 = FLAlertLayer::create(v7, (int)"Max Coins", v10, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003A830((__int64)&v12);
v11->setTag(v11, 122);
v11->show(v11);
}
return 1;
}
LABEL_19:
if ( a1->m_selectedObject || cocos2d::CCArray::count(a1->m_selectedObjects) )
EditorUI::createUndoSelectObject(a1, 1);
EditorUI::onCreateObject(a1, a1->m_selectedObjectIndex);
return 1;
}
if ( m_selectedObjectIndex == 31 )
goto LABEL_19;
LABEL_9:
if ( !m_editorLayer->m_level->m_highObjectsEnabled )
{
EditorUI::showMaxBasicError(a1);
return 1;
}
goto LABEL_11;
}
if ( m_selectedObjectIndex == 31 )
goto LABEL_19;
if ( m_editorLayer->m_level->m_unlimitedObjectsEnabled )
goto LABEL_9;
EditorUI::showMaxError(a1);
return 1;
}