//
// EditorUI::createCustomItems from 0x1003e8c20 to 0x1003e8e94 (628 bytes)
//
// 2 xrefs:
// > EditorUI::setupCreateMenu @ 0x1003e3b90
// > EditorUI::reloadCustomItems @ 0x1003e8af4
//
// 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
//
cocos2d::CCArray *__fastcall EditorUI::createCustomItems(EditorUI *a1)
{
cocos2d::CCArray *v2; // x19
GameManager *v3; // x0
cocos2d::CCArray *OrderedCustomObjectKeys; // x21
int v5; // w0
int v6; // w22
unsigned int v7; // w23
cocos2d::CCString *v8; // x0
__int64 v9; // x24
GameManager *v10; // x0
char *v11; // x1
cocos2d::CCArray *m_customTabControls; // x1
cocos2d::CCArray *v13; // x0
cocos2d::CCSprite *v14; // x22
cocos2d::CCSprite *v15; // x22
cocos2d::CCSprite *v16; // x22
cocos2d::CCSprite *v17; // x22
void *__p[2]; // [xsp+0h] [xbp-70h] BYREF
char v20; // [xsp+17h] [xbp-59h]
char *__s[2]; // [xsp+18h] [xbp-58h] BYREF
char v22; // [xsp+2Fh] [xbp-41h]
cocos2d::SEL_MenuHandler v23; // 0:x2.16
cocos2d::SEL_MenuHandler v24; // 0:x2.16
cocos2d::SEL_MenuHandler v25; // 0:x2.16
cocos2d::SEL_MenuHandler v26; // 0:x2.16
cocos2d::CCPoint v27; // 0:s1.4,4:s2.4
cocos2d::CCPoint v28; // 0:s1.4,4:s2.4
cocos2d::CCPoint v29; // 0:s1.4,4:s2.4
cocos2d::CCPoint v30; // 0:s1.4,4:s2.4
sub_10024A45C((__int64)a1->m_customObjectButtonArray);
v2 = (cocos2d::CCArray *)sub_10024A15C();
v3 = GameManager::sharedState();
OrderedCustomObjectKeys = GameManager::getOrderedCustomObjectKeys(v3);
v5 = sub_10024A36C((__int64)OrderedCustomObjectKeys);
if ( v5 >= 1 )
{
v6 = v5;
v7 = 0;
while ( 1 )
{
v8 = cocos2d::CCArray::stringAtIndex(OrderedCustomObjectKeys, v7);
v9 = cocos2d::CCString::intValue(v8);
v10 = GameManager::sharedState();
GameManager::stringForCustomObject((__int64)v10, v9, __s);
if ( v22 < 0 )
break;
if ( v22 )
{
v11 = (char *)__s;
LABEL_8:
sub_100009900(__p, v11);
EditorUI::menuItemFromObjectString(a1, __p, v9);
sub_10024A2D0((__int64)v2);
if ( v20 < 0 )
operator delete(__p[0]);
if ( (v22 & 0x80000000) == 0 )
goto LABEL_12;
goto LABEL_11;
}
LABEL_12:
if ( v6 == ++v7 )
goto LABEL_13;
}
if ( __s[1] )
{
v11 = __s[0];
goto LABEL_8;
}
LABEL_11:
operator delete(__s[0]);
goto LABEL_12;
}
LABEL_13:
m_customTabControls = a1->m_customTabControls;
if ( !m_customTabControls )
{
v13 = (cocos2d::CCArray *)sub_10024A15C();
a1->m_customTabControls = v13;
cocos2d::CCObject::retain(v13);
v14 = cocos2d::CCSprite::createWithSpriteFrameName("edit_upBtn_001.png");
sub_1000229B8((__int64 *)__s, (__int64 *)&dword_10086E8B0);
v23.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::orderUpCustomItem;
v23.adj = 0;
EditorUI::getCreateMenuItemButton(a1, v14, v23, nullptr, 0.9, 5, v27);
sub_10024A2D0((__int64)a1->m_customTabControls);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("edit_downBtn_001.png");
sub_1000229B8((__int64 *)__s, (__int64 *)&dword_10086E8B0);
v24.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::orderDownCustomItem;
v24.adj = 0;
EditorUI::getCreateMenuItemButton(a1, v15, v24, nullptr, 0.9, 5, v28);
sub_10024A2D0((__int64)a1->m_customTabControls);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("edit_addCBtn_001.png");
sub_1000229B8((__int64 *)__s, (__int64 *)&dword_10086E8B0);
v25.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::onNewCustomItem;
v25.adj = 0;
EditorUI::getCreateMenuItemButton(a1, v16, v25, nullptr, 0.9, 1, v29);
sub_10024A2D0((__int64)a1->m_customTabControls);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("edit_delCBtn_001.png");
sub_1000229B8((__int64 *)__s, (__int64 *)&dword_10086E8B0);
v26.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::onDeleteCustomItem;
v26.adj = 0;
EditorUI::getCreateMenuItemButton(a1, v17, v26, nullptr, 0.9, 6, v30);
sub_10024A2D0((__int64)a1->m_customTabControls);
m_customTabControls = a1->m_customTabControls;
}
sub_10024A360((__int64)v2, (__int64)m_customTabControls);
return v2;
}