//
// EditorUI::getCreateMenuItemButton from 0x10002ecd0 to 0x10002ee26 (342 bytes)
//
// 4 xrefs:
// > EditorUI::createCustomItems @ 0x10003187e
// > EditorUI::createCustomItems @ 0x1000318d1
// > EditorUI::createCustomItems @ 0x100031924
// > EditorUI::createCustomItems @ 0x10003197b
//
// 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
//
CreateMenuItem *__fastcall EditorUI::getCreateMenuItemButton(
EditorUI *a1,
cocos2d::CCSprite *a2,
cocos2d::SEL_MenuHandler a3,
cocos2d::CCMenu *a4,
float a5,
int a6,
cocos2d::CCPoint a7)
{
void (__cdecl *ptr)(cocos2d::CCObject *); // r13
unsigned int v9; // r9d
const char *v10; // r8
ButtonSprite *v11; // r15
char *v12; // r14
cocos2d::SEL_MenuHandler v13; // r8
cocos2d::CCPoint v14; // xmm0_8
char v16[8]; // [rsp+0h] [rbp-40h] BYREF
size_t adj; // [rsp+8h] [rbp-38h]
float v18; // [rsp+14h] [rbp-2Ch]
__int64 v19; // [rsp+50h] [rbp+10h]
v18 = a5;
adj = a3.adj;
ptr = a3.ptr;
v9 = a6 - 2;
if ( v9 > 4 )
v10 = "GJ_button_01.png";
else
v10 = off_1008B1FC0[v9];
v11 = ButtonSprite::create(a2, 32, 0, 32.0, 1.0, 1, v10, 1);
v12 = (char *)operator new(0x220u);
CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((CCMenuItemSpriteExtra *)v12);
*(_QWORD *)v12 = off_1008B1AB8;
*((_QWORD *)v12 + 40) = off_1008B1F20;
*(_OWORD *)(v12 + 504) = 0;
*((_QWORD *)v12 + 65) = 0;
*(_QWORD *)(v12 + 532) = 0;
v13.ptr = ptr;
v13.adj = adj;
if ( CCMenuItemSpriteExtra::init((CCMenuItemSpriteExtra *)v12, v11, nullptr, a1, v13) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v12);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v12 + 16LL))(v12);
v12 = nullptr;
}
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v12 + 160LL))(v12, v18);
*((float *)v12 + 101) = v18;
if ( a4 )
((void (__fastcall *)(cocos2d::CCMenu *, char *))a4->addChild)(a4, v12);
*(double *)&v14 = sub_10028CC60(v16, v19);
ButtonSprite::updateSpriteOffset(v11, v14);
return (CreateMenuItem *)v12;
}