//
// EditorUI::onDeleteCustomItem from 0x1400e4520 to 0x1400e4656 (310 bytes)
//
// 2 xrefs:
// > EditorUI::createCustomItems @ 0x1400e4bdd
// > ??> @ 0x1406c8c64
//
// 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=2
void EditorUI::onDeleteCustomItem(EditorUI *a1, cocos2d::CCObject *a2)
{
__int64 v3; // rdi
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
void *v7; // rcx
void *v8; // [rsp+20h] [rbp-38h]
void *Block[2]; // [rsp+28h] [rbp-30h] BYREF
__int64 v10; // [rsp+38h] [rbp-20h]
unsigned __int64 v11; // [rsp+40h] [rbp-18h]
if ( a1->m_selectedObjectIndex < 0 )
{
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v8 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
v4 = cocos2d::CCString::createWithFormat("%i", a1->m_selectedObjectIndex);
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Block = 0;
v10 = 0;
v11 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003A930(Block, CString, v6);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v3 + 424), Block);
if ( v11 > 0xF )
{
v7 = Block[0];
if ( v11 + 1 >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
a1->m_selectedObjectIndex = 0;
EditorUI::reloadCustomItems(a1);
}
}