//
// InfoLayer::setupLevelInfo from 0x100351468 to 0x100351660 (504 bytes)
//
// 1 xrefs:
// > InfoLayer::init @ 0x1003504c8
//
// 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
//
void __fastcall InfoLayer::setupLevelInfo(InfoLayer *a1)
{
cocos2d::CCDirector *v2; // x0
GJLevelList *m_levelList; // x9
int *p_m_listVersion; // x8
int m_listID; // w22
GJGameLevel *m_level; // x9
cocos2d::CCString *v7; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v9; // x21
cocos2d::CCMenu *v10; // x20
cocos2d::CCString *v11; // x0
const char *v12; // x0
cocos2d::CCLabelBMFont *v13; // x22
__n128 v14; // q0
__n128 v15; // q1
__n128 v16; // q0
__n128 v17; // q1
double v18; // d0
CCMenuItemSpriteExtra *v19; // x0
__n128 v20; // q0
__n128 v21; // q1
double v22; // d0
float32x2_t v23; // [xsp+10h] [xbp-50h] BYREF
float32x2_t v24; // [xsp+18h] [xbp-48h] BYREF
float32x2_t v25; // [xsp+20h] [xbp-40h] BYREF
float v26; // [xsp+28h] [xbp-38h]
float v27; // [xsp+2Ch] [xbp-34h]
cocos2d::SEL_MenuHandler v28; // 0:x3.16
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
m_levelList = a1->m_levelList;
if ( m_levelList )
{
p_m_listVersion = &m_levelList->m_listVersion;
m_listID = m_levelList->m_listID;
}
else
{
m_level = a1->m_level;
p_m_listVersion = &m_level->m_levelVersion;
m_listID = m_level->m_levelID.random - m_level->m_levelID.seed;
}
v7 = (cocos2d::CCString *)sub_100268F4C("Version: %i", *p_m_listVersion);
CString = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v9,
2);
v10 = cocos2d::CCMenu::create();
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v10,
2);
if ( m_listID )
{
v11 = (cocos2d::CCString *)sub_100268F4C("ID: %i", m_listID);
v12 = cocos2d::CCString::getCString(v11);
}
else
{
v12 = "ID: na";
}
v13 = cocos2d::CCLabelBMFont::create_1(v12, "goldFont.fnt");
v14.n128_f32[0] = v26 * 0.5;
v15.n128_f32[0] = (float)((float)(v27 * 0.5) + -145.0) + 14.0;
sub_100022980(v14, v15, &v25);
v16.n128_u32[0] = -1035468800;
v17.n128_u32[0] = 0;
sub_100022980(v16, v17, &v23);
*(float32x2_t *)&v18 = sub_1000229DC(&v25, &v23, &v24);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v9->setPosition)(v9, &v24, v18);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v9->setScale)(v9, 0.6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v13->setScale)(v13, 0.6);
v28.ptr = (void (__cdecl *)(cocos2d::CCObject *))InfoLayer::onCopyLevelID;
v28.adj = 0;
v19 = CCMenuItemSpriteExtra::create(v13, nullptr, a1, v28);
v20 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v10->addChild)(v10, v19);
v20.n128_u32[0] = 1112014848;
v21.n128_u32[0] = 0;
sub_100022980(v20, v21, &v23);
*(float32x2_t *)&v22 = sub_1000229DC(&v25, &v23, &v24);
((void (__fastcall *)(cocos2d::CCMenu *, float32x2_t *, double))v10->setPosition)(v10, &v24, v22);
}