//
// cocos2d::CCMenuItemFont::initWithString from 0x1003bf7b0 to 0x1003bf8d9 (297 bytes)
//
// 2 xrefs:
// > cocos2d::CCMenuItemFont::create @ 0x1003bf772
// > cocos2d::CCMenuItemFont::create_1 @ 0x1003bf960
//
// 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
//
bool __fastcall cocos2d::CCMenuItemFont::initWithString(
cocos2d::CCMenuItemFont *a1,
const char *a2,
cocos2d::CCObject *a3,
cocos2d::SEL_MenuHandler a4)
{
void (__cdecl *ptr)(cocos2d::CCObject *); // r15
int v7; // eax
const char *v8; // rsi
cocos2d::CCLabelTTF *v9; // r13
float v11; // [rsp+0h] [rbp-40h] BYREF
size_t adj; // [rsp+8h] [rbp-38h]
_WORD v13[22]; // [rsp+14h] [rbp-2Ch] BYREF
adj = a4.adj;
ptr = a4.ptr;
std::string::operator=((std::string *)&a1[1].m_uIndexInArray, &_str);
v7 = dword_10099C948;
a1[1].m_uAutoReleaseCount = dword_10099C948;
if ( (a1[1].m_uIndexInArray & 1) != 0 )
v8 = *(const char **)&a1[1].m_uOrderOfArrival;
else
v8 = (char *)&a1[1].m_uIndexInArray + 1;
v9 = cocos2d::CCLabelTTF::create_2(a2, v8, (float)v7);
sub_10028CBE0(&v11, 0.5, 0.5);
((void (__fastcall *)(cocos2d::CCMenuItemFont *, float *))a1->setAnchorPoint)(a1, &v11);
a1->m_pListener = a3;
a1->m_pfnSelector.ptr = ptr;
a1->m_pfnSelector.adj = adj;
*(_WORD *)&a1->m_bSelected = 256;
a1[1].m_uReference = 1065353216;
LOWORD(a1[1].m_nTag) = -1;
BYTE2(a1[1].m_nTag) = -1;
memset(v13, 126, 3);
((void (__fastcall *)(cocos2d::CCMenuItemFont *, _WORD *))a1->setDisabledColor)(a1, v13);
((void (__fastcall *)(cocos2d::CCMenuItemFont *, cocos2d::CCLabelTTF *))a1->setLabel)(a1, v9);
((void (__fastcall *)(cocos2d::CCMenuItemFont *, __int64))a1->setCascadeColorEnabled)(a1, 1);
((void (__fastcall *)(cocos2d::CCMenuItemFont *, __int64))a1->setCascadeOpacityEnabled)(a1, 1);
return 1;
}