//
// EditLevelLayer::setupLevelInfo from 0x3b6288 to 0x3b684a (1474 bytes)
//
// 1 xrefs:
// > EditLevelLayer::init @ 0x3b7174
//
// 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 EditLevelLayer::setupLevelInfo(EditLevelLayer *a1)
{
cocos2d::CCDirector *v2; // r0
cocos2d::CCSize *WinSize; // r0
cocos2d::CCArray *v4; // r5
cocos2d::CCNode *v5; // r11
cocos2d::CCNode *v6; // r8
cocos2d::CCNode *v7; // r9
cocos2d::CCLabelBMFont *v8; // r6
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r7
float v10; // s15
cocos2d::CCLabelBMFont *v11; // r7
void (__fastcall *v12)(cocos2d::CCLabelBMFont *__hidden, float); // r10
float v13; // s15
GJGameLevel *m_level; // r2
char *v15; // r1
int v16; // r3
GJGameLevel *v17; // r1
GJGameLevel *v18; // r1
float v19; // s17
cocos2d::CCDirector *v20; // r0
float v21; // r0
cocos2d::CCString *v22; // r0
cocos2d::CCLabelBMFont *v23; // r6
GJGameLevel *v24; // r3
int random; // r1
int seed; // r3
cocos2d::CCString *v27; // r0
const char *CString; // r1
GJGameLevel *v29; // r3
int v30; // r2
int v31; // r3
cocos2d::CCString *v32; // r0
cocos2d::CCLabelBMFont *v33; // r5
float v34; // s16
cocos2d::CCDirector *v35; // r0
float v36; // r0
void (__fastcall *v37)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v38)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *v39)(cocos2d::CCLabelBMFont *__hidden, float); // r4
void (__fastcall *v40)(cocos2d::CCLabelBMFont *__hidden, float); // r4
float *v41; // r0
int v42; // r1
bool v43; // [sp+0h] [bp-4Ch]
bool v44; // [sp+0h] [bp-4Ch]
bool v45; // [sp+0h] [bp-4Ch]
bool v46; // [sp+0h] [bp-4Ch]
cocos2d::CCSprite *v47; // [sp+4h] [bp-48h]
cocos2d::CCLabelBMFont *v48; // [sp+8h] [bp-44h]
cocos2d::CCSprite *v49; // [sp+Ch] [bp-40h]
cocos2d::CCSprite *v50; // [sp+10h] [bp-3Ch]
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+18h] [bp-34h]
int v52; // [sp+1Ch] [bp-30h]
cocos2d::CCLabelBMFont *v53; // [sp+20h] [bp-2Ch] BYREF
cocos2d::CCSize v54; // [sp+24h] [bp-28h] BYREF
cocos2d::CCPoint v55; // [sp+2Ch] [bp-20h] BYREF
cocos2d::CCPoint v56; // [sp+34h] [bp-18h] BYREF
cocos2d::CCPoint v57; // [sp+3Ch] [bp-10h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
WinSize = cocos2d::CCDirector::getWinSize(&v54, v2);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)WinSize);
v5 = cocos2d::CCNode::create();
a1->addChild(a1, v5);
v6 = cocos2d::CCNode::create();
a1->addChild(a1, v6);
v7 = cocos2d::CCNode::create();
a1->addChild(a1, v7);
v49 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
v5->addChild(v5, v49);
v50 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_noteIcon_001.png");
v6->addChild(v6, v50);
v47 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v7->addChild(v7, v47);
GJGameLevel::lengthKeyToString((GJGameLevel *)&v57, a1->m_level->m_levelLength);
v8 = cocos2d::CCLabelBMFont::create();
sub_774008(&v57);
v5->addChild(v5, v8);
setScale = v8->setScale;
if ( (float)(100.0 / v8->getContentSize(v8)->width) > 0.5 )
v10 = 0.5;
else
v10 = 100.0 / v8->getContentSize(v8)->width;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(v8, LODWORD(v10));
GJGameLevel::getSongName((GJGameLevel *)&v57);
v11 = cocos2d::CCLabelBMFont::create();
sub_774008(&v57);
v6->addChild(v6, v11);
v12 = v11->setScale;
if ( (float)(100.0 / v11->getContentSize(v11)->width) > 0.5 )
v13 = 0.5;
else
v13 = 100.0 / v11->getContentSize(v11)->width;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))v12)(v11, LODWORD(v13));
sub_776584((int)&v53, (char *)&unk_939830);
m_level = a1->m_level;
if ( m_level->m_isUploaded )
{
v15 = "Uploaded";
LABEL_9:
sub_7753D4((int)&v53, v15);
goto LABEL_10;
}
if ( m_level->m_isVerified.random - m_level->m_isVerified.seed == 1 )
{
v15 = "Verified";
goto LABEL_9;
}
sub_7753D4((int)&v53, "Unverified");
if ( a1->m_level->m_coins > 0 )
{
sub_7753D4((int)&v53, "Unverified\nReq. Coins: ");
v16 = a1->m_level->m_firstCoinVerified.random - a1->m_level->m_firstCoinVerified.seed;
if ( v16 != 1 )
{
sub_774544((int)&v53, (char *)&aO1i2r3e45s7t89[1]);
v16 = 0;
}
v17 = a1->m_level;
if ( v17->m_coins > 1 && v17->m_secondCoinVerified.random - v17->m_secondCoinVerified.seed != 1 )
{
if ( !v16 )
sub_774544((int)&v53, ", ");
sub_774544((int)&v53, (char *)&aO1i2r3e45s7t89[3]);
v16 = 0;
}
v18 = a1->m_level;
if ( v18->m_coins > 2 && v18->m_thirdCoinVerified.random - v18->m_thirdCoinVerified.seed != 1 )
{
if ( !v16 )
sub_774544((int)&v53, ", ");
sub_774544((int)&v53, (char *)&aO1i2r3e45s7t89[5]);
}
}
LABEL_10:
v48 = cocos2d::CCLabelBMFont::create();
v7->addChild(v7, v48);
cocos2d::CCLabelBMFont::limitLabelWidth(v48, 100.0, 0.5, 0.0);
setPosition = v47->setPosition;
v52 = (int)v47->getPosition(v47);
cocos2d::CCPoint::CCPoint(&v56, 0.0, 2.0);
cocos2d::CCPoint::operator+(&v57, v52, &v56);
setPosition(v47, &v57);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v49);
cocos2d::CCArray::addObject(v4, v8);
cocos2d::CCPoint::CCPoint(&v57, &stru_AC5EB0);
GameToolbox::alignItemsHorisontally(v4, 4.0, (cocos2d::CCPoint)(unsigned int)&v57, v43);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v50);
cocos2d::CCArray::addObject(v4, v11);
cocos2d::CCPoint::CCPoint(&v57, &stru_AC5EB0);
GameToolbox::alignItemsHorisontally(v4, 4.0, (cocos2d::CCPoint)(unsigned int)&v57, v44);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v47);
cocos2d::CCArray::addObject(v4, v48);
cocos2d::CCPoint::CCPoint(&v57, &stru_AC5EB0);
GameToolbox::alignItemsHorisontally(v4, 4.0, (cocos2d::CCPoint)(unsigned int)&v57, v45);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v5);
cocos2d::CCArray::addObject(v4, v6);
cocos2d::CCArray::addObject(v4, v7);
v19 = v54.width * 0.5;
v20 = cocos2d::CCDirector::sharedDirector();
v21 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v20));
cocos2d::CCPoint::CCPoint(&v57, v19, v21 + 55.0);
GameToolbox::alignItemsHorisontally(v4, 140.0, (cocos2d::CCPoint)(unsigned int)&v57, v46);
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Version: %i",
(const char *)a1->m_level->m_levelVersion);
cocos2d::CCString::getCString(v22);
v23 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v23);
v24 = a1->m_level;
random = v24->m_levelID.random;
seed = v24->m_levelID.seed;
if ( random == seed )
{
CString = "ID: na";
}
else
{
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ID: %i",
(const char *)(random - seed));
CString = cocos2d::CCString::getCString(v27);
}
v29 = a1->m_level;
v30 = v29->m_originalLevel.random;
v31 = v29->m_originalLevel.seed;
if ( v30 != v31 )
{
v32 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s (%i)", CString, v30 - v31);
cocos2d::CCString::getCString(v32);
}
v33 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v33);
v34 = v54.width * 0.5;
v35 = cocos2d::CCDirector::sharedDirector();
v36 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v35));
cocos2d::CCPoint::CCPoint(&v55, v34, v36 + 14.0);
v37 = v23->setPosition;
cocos2d::CCPoint::CCPoint(&v56, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v57, &v55, &v56);
v37(v23, &v57);
v38 = v33->setPosition;
cocos2d::CCPoint::CCPoint(&v56, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v57, &v55, &v56);
v38(v33, &v57);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v23->setScale)(v23, 1058642330);
if ( v33->getContentSize(v33)->width > 150.0 )
{
v40 = v33->setScale;
v41 = (float *)v33->getContentSize(v33);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))v40)(v33, 150.0 / *v41);
}
v39 = v33->setScale;
if ( v33->getScale(v33) < 0.6 )
v42 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))v33->getScale)(v33);
else
v42 = 1058642330;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v39)(v33, v42);
sub_774008(&v53);
}