//
// EditorUI::menuItemFromObjectString from 0x387f14 to 0x38804c (312 bytes)
//
// 1 xrefs:
// > EditorUI::createCustomItems @ 0x3880d6
//
// 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::CCObject *__fastcall EditorUI::menuItemFromObjectString(EditorUI *a1, int a2, bool a3)
{
ButtonSprite *v4; // r4
float width; // s16
int v6; // r0
const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // r3
float height; // s15
ButtonSprite *v9; // r0
cocos2d::CCNode *v10; // r11
int v11; // r9
CreateMenuItem *v12; // r0
cocos2d::CCObject *v13; // r4
cocos2d::CCArray *m_customObjectButtonArray; // r0
bool v17[4]; // [sp+10h] [bp-24h]
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-20h]
cocos2d::CCPoint v19; // [sp+1Ch] [bp-18h] BYREF
_DWORD v20[2]; // [sp+24h] [bp-10h] BYREF
cocos2d::SEL_MenuHandler v21; // 0:r3.4,4:^0.4
sub_775C20(v20, a2);
v4 = (ButtonSprite *)EditorUI::spriteFromObjectString(a1, v20, COERCE_FLOAT(1), 0, 100, 0, nullptr, 0);
sub_774008(v20);
width = v4->getContentSize(v4)->width;
v6 = (int)v4->getContentSize(v4);
getContentSize = v4->getContentSize;
if ( width <= *(float *)(v6 + 4) )
height = getContentSize(v4)->height;
else
height = getContentSize(v4)->width;
((void (__fastcall *)(ButtonSprite *, _DWORD))v4->setScale)(v4, 40.0 / height);
v9 = ButtonSprite::create(v4, (cocos2d::CCSprite *)&dword_20, 0, 32.0, 1.0, 1, "GJ_button_04.png", nullptr, a3);
setPosition = v4->setPosition;
v10 = v9;
v11 = (int)v4->getPosition(v4);
cocos2d::CCPoint::CCPoint(&v19, 0.0, -1.0);
cocos2d::CCPoint::operator+(v20, v11, &v19);
setPosition(v4, (const cocos2d::CCPoint *)v20);
v21.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::onCreateButton;
v21.adj = 0;
v20[0] = EditorUI::onCreateButton;
v20[1] = 0;
v12 = CreateMenuItem::create(v10, nullptr, a1, v21);
v12->m_objectID = *(_DWORD *)v17;
v13 = v12;
((void (__fastcall *)(CreateMenuItem *, int))v12->setScale)(v12, 1063675494);
m_customObjectButtonArray = a1->m_customObjectButtonArray;
v13[6].m_uID = 1063675494;
cocos2d::CCArray::addObject(m_customObjectButtonArray, v13);
return v13;
}