//
// EditorUI::menuItemFromObjectString from 0x100031a00 to 0x100031c1b (539 bytes)
//
// 1 xrefs:
// > EditorUI::createCustomItems @ 0x1000317d8
//
// 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
//
char *__fastcall EditorUI::menuItemFromObjectString(cocos2d::CCObject *a1, __int128 *a2, int a3, double a4)
{
cocos2d::CCSprite *v5; // r15
__int64 v6; // rax
_BOOL8 v7; // rbx
__int64 v8; // rax
ButtonSprite *v9; // r12
__int64 v10; // r13
char *v11; // r15
cocos2d::CCObject *v12; // rbx
bool v13; // al
int v14; // r14d
char v16[8]; // [rsp+18h] [rbp-68h] BYREF
char v17[8]; // [rsp+20h] [rbp-60h] BYREF
cocos2d::CCObject *v18; // [rsp+28h] [rbp-58h]
__int128 v19; // [rsp+30h] [rbp-50h] BYREF
void *__p; // [rsp+40h] [rbp-40h]
float v21; // [rsp+50h] [rbp-30h]
int v22; // [rsp+54h] [rbp-2Ch]
if ( (*(_BYTE *)a2 & 1) != 0 )
{
sub_100006B70(&v19, *((const void **)a2 + 2), *((_QWORD *)a2 + 1), a4);
}
else
{
__p = *((void **)a2 + 2);
v19 = *a2;
}
v5 = (cocos2d::CCSprite *)EditorUI::spriteFromObjectString((_DWORD)a1, (unsigned int)&v19, 1, 0, 100, 0, 0, 0);
v22 = a3;
v18 = a1;
if ( (v19 & 1) != 0 )
operator delete(__p);
v21 = *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v5->getContentSize)(v5);
v6 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v5->getContentSize)(v5);
v7 = v21 <= *(float *)(v6 + 4);
v8 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v5->getContentSize)(v5);
((void (__fastcall *)(cocos2d::CCSprite *, float))v5->setScale)(v5, 40.0 / *(float *)(v8 + 4 * v7));
v9 = ButtonSprite::create(v5, 32, 0, 32.0, 1.0, 1, "GJ_button_04.png", 0);
v10 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v5->getPosition)(v5);
sub_10028CBE0(v17, 0.0, -1.0);
sub_10028CCE0(v16, v10);
((void (__fastcall *)(cocos2d::CCSprite *, char *))v5->setPosition)(v5, v16);
v11 = (char *)operator new(0x220u);
CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((CCMenuItemSpriteExtra *)v11);
*(_QWORD *)v11 = off_1008B1AB8;
*((_QWORD *)v11 + 40) = off_1008B1F20;
*(_OWORD *)(v11 + 504) = 0;
*((_QWORD *)v11 + 65) = 0;
*(_QWORD *)(v11 + 532) = 0;
v12 = v18;
v13 = CCMenuItemSpriteExtra::init(
(CCMenuItemSpriteExtra *)v11,
v9,
nullptr,
v18,
(cocos2d::SEL_MenuHandler)(unsigned __int64)EditorUI::onCreateButton);
v14 = v22;
if ( v13 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v11);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v11 + 16LL))(v11);
v11 = nullptr;
}
*((_DWORD *)v11 + 132) = v14;
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v11 + 160LL))(v11, 0.89999998);
*((_DWORD *)v11 + 101) = 1063675494;
sub_10071FCD0(v12[22].__vftable, v11);
return v11;
}