//
// EditorUI::onDeleteCustomItem from 0x1401f5fa0 to 0x1401f60ea (330 bytes)
//
// 2 xrefs:
// > EditorUI::createCustomItems @ 0x1401f66ac
// > ??> @ 0x14091aa80
//
// 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 11:28:09 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall EditorUI::onDeleteCustomItem(__int64 a1)
{
__int64 v2; // rdi
cocos2d::CCString *v3; // rax
const char *CString; // rax
size_t v5; // r8
void *v6; // rcx
void *v7; // [rsp+30h] [rbp-38h]
void *Block[2]; // [rsp+38h] [rbp-30h] BYREF
__int64 v9; // [rsp+48h] [rbp-20h]
unsigned __int64 v10; // [rsp+50h] [rbp-18h]
if ( *(int *)(a1 + 1392) < 0 )
{
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v7 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
v3 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, *(unsigned int *)(a1 + 1392));
CString = cocos2d::CCString::getCString(v3);
*(_OWORD *)Block = 0;
v9 = 0;
v10 = 0;
v5 = -1;
do
++v5;
while ( CString[v5] );
sub_14003D230(Block, CString, v5);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v2 + 464), Block);
if ( v10 > 0xF )
{
v6 = Block[0];
if ( v10 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
*(_DWORD *)(a1 + 1392) = 0;
EditorUI::reloadCustomItems(a1);
}
}