//
// EditLevelLayer::setupLevelInfo from 0x6df33c to 0x6dfc3c (2304 bytes)
//
// 2 xrefs:
// > EditLevelLayer::init @ 0x6e0bf0
// > ??> @ 0x3b9d0
//
// 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; // x0
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x20
cocos2d::CCNode *v5; // x22
cocos2d::CCNode *v6; // x23
cocos2d::CCNode *v7; // x24
cocos2d::CCSprite *v8; // x0
cocos2d::CCNode_vtbl *v9; // x2
cocos2d::CCSprite *v10; // x0
cocos2d::CCNode_vtbl *v11; // x2
cocos2d::CCSprite *v12; // x28
int v13; // w1
cocos2d::CCLabelBMFont *v14; // x26
cocos2d::CCArray **p_m_pTargetArray; // x0
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // x25
cocos2d::CCLabelBMFont *v17; // x27
cocos2d::CCArray **v18; // x0
const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x2
GJGameLevel *m_level; // x0
GJGameLevel *v21; // x0
int v22; // w1
int m_coins; // w2
cocos2d::CCLabelBMFont *v24; // x0
cocos2d::CCNode_vtbl *v25; // x2
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x2
float v27; // s8
cocos2d::CCDirector *v28; // x0
float v29; // s0
cocos2d::CCString *v30; // x0
cocos2d::CCLabelBMFont *v31; // x22
GJGameLevel *v32; // x3
int random; // w1
int seed; // w0
cocos2d::CCString *v35; // x0
const char *CString; // x0
int v37; // w4
int v38; // w2
cocos2d::CCString *v39; // x0
cocos2d::CCLabelBMFont *v40; // x20
float v41; // s8
cocos2d::CCDirector *v42; // x0
float v43; // s0
void (__fastcall *v44)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
void (__fastcall *v45)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
long double v46; // q0
void (__fastcall *v47)(cocos2d::CCLabelBMFont *__hidden, float); // x21
float *v48; // x0
void (__fastcall *v49)(cocos2d::CCLabelBMFont *__hidden, float); // x21
cocos2d::CCArray **v50; // x26
unsigned int *v51; // x25
int v52; // w0
unsigned int *v53; // x1
int v54; // w2
unsigned int *p_m_nExtraKerning; // x1
int m_nExtraKerning; // w2
__int64 v57; // [xsp+0h] [xbp+0h] BYREF
__int64 v58; // [xsp+78h] [xbp+78h]
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [xsp+80h] [xbp+80h]
cocos2d::CCObject *v60; // [xsp+88h] [xbp+88h]
cocos2d::CCObject *v61; // [xsp+90h] [xbp+90h]
cocos2d::CCLabelBMFont *v62; // [xsp+98h] [xbp+98h]
float v63; // [xsp+A0h] [xbp+A0h]
cocos2d::CCLabelBMFont *v64; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v65; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCPoint v66; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCLabelBMFont *v67; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCPoint v68; // 0:s1.4,4:s2.4
cocos2d::CCPoint v69; // 0:s1.4,4:s2.4
cocos2d::CCPoint v70; // 0:s1.4,4:s2.4
cocos2d::CCPoint v71; // 0:s1.4,4:s2.4
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
v5 = cocos2d::CCNode::create();
a1->addChild(a1, v5);
v6 = cocos2d::CCNode::create();
a1->addChild(a1, v6);
v7 = cocos2d::CCNode::create();
a1->addChild(a1, v7);
v8 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
v9 = v5->__vftable;
v61 = v8;
v9->addChild(v5, v8);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_noteIcon_001.png");
v11 = v6->__vftable;
v60 = v10;
v11->addChild(v6, v10);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v7->addChild(v7, v12);
GJGameLevel::lengthKeyToString((__int64 *)&v67, (GJGameLevel *)(unsigned int)a1->m_level->m_levelLength, v13);
v14 = cocos2d::CCLabelBMFont::create();
p_m_pTargetArray = &v67[-1].m_pTargetArray;
if ( &v67[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_nExtraKerning = (unsigned int *)&v67[-1].m_nExtraKerning;
do
m_nExtraKerning = __ldaxr(p_m_nExtraKerning);
while ( __stlxr(m_nExtraKerning - 1, p_m_nExtraKerning) );
}
else
{
m_nExtraKerning = v67[-1].m_nExtraKerning;
v67[-1].m_nExtraKerning = m_nExtraKerning - 1;
}
if ( m_nExtraKerning <= 0 )
operator delete(p_m_pTargetArray);
}
v5->addChild(v5, v14);
setScale = v14->setScale;
if ( (float)(100.0 / v14->getContentSize(v14)->width) <= 0.5 )
v14->getContentSize(v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))setScale)(v14);
GJGameLevel::getSongName((__int64 *)&v67, a1->m_level);
v17 = cocos2d::CCLabelBMFont::create();
v18 = &v67[-1].m_pTargetArray;
if ( &v67[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
v53 = (unsigned int *)&v67[-1].m_nExtraKerning;
do
v54 = __ldaxr(v53);
while ( __stlxr(v54 - 1, v53) );
}
else
{
v54 = v67[-1].m_nExtraKerning;
v67[-1].m_nExtraKerning = v54 - 1;
}
if ( v54 <= 0 )
operator delete(v18);
}
v6->addChild(v6, v17);
getContentSize = v17->getContentSize;
v62 = (cocos2d::CCLabelBMFont *)v17->setScale;
if ( (float)(100.0 / getContentSize(v17)->width) <= 0.5 )
v17->getContentSize(v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v62)(v17);
sub_D153B8((unsigned int)&v57 + 168, &byte_F288A0);
m_level = a1->m_level;
if ( m_level->m_isUploaded )
{
sub_D1798C(&v64, "Uploaded", 8);
}
else if ( m_level->m_isVerified.random - m_level->m_isVerified.seed == 1 )
{
sub_D1798C(&v64, "Verified", 8);
}
else
{
sub_D1798C(&v64, "Unverified", 10);
if ( a1->m_level->m_coins > 0 )
{
sub_D1798C(&v64, "Unverified\nReq. Coins: ", 23);
v21 = a1->m_level;
v22 = v21->m_firstCoinVerified.random - v21->m_firstCoinVerified.seed;
if ( v22 != 1 )
{
sub_D15FD4(&v64, "1", 1);
v21 = a1->m_level;
v22 = 0;
}
m_coins = v21->m_coins;
if ( m_coins > 1 )
{
if ( v21->m_secondCoinVerified.random - v21->m_secondCoinVerified.seed != 1 )
{
if ( !v22 )
sub_D15FD4(&v64, ", ", 2);
sub_D15FD4(&v64, &byte_F78BA8, 1);
v21 = a1->m_level;
v22 = 0;
m_coins = v21->m_coins;
}
if ( m_coins > 2 && v21->m_thirdCoinVerified.random - v21->m_thirdCoinVerified.seed != 1 )
{
if ( !v22 )
sub_D15FD4(&v64, ", ", 2);
sub_D15FD4(&v64, "3", 1);
}
}
}
}
v24 = cocos2d::CCLabelBMFont::create();
v25 = v7->__vftable;
v62 = v24;
v25->addChild(v7, v24);
cocos2d::CCLabelBMFont::limitLabelWidth(v62, 100.0, 0.5, 0.0);
getPosition = v12->getPosition;
setPosition = v12->setPosition;
v58 = (__int64)getPosition(v12);
cocos2d::CCPoint::CCPoint(&v66, 0.0, 2.0);
cocos2d::CCPoint::operator+(&v67, v58, &v66);
setPosition(v12, (const cocos2d::CCPoint *)&v67);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v61);
cocos2d::CCArray::addObject(v4, v14);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, &stru_12422B0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v68, (bool)&v67);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v60);
cocos2d::CCArray::addObject(v4, v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, &stru_12422B0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v69, (bool)&v67);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v12);
cocos2d::CCArray::addObject(v4, v62);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, &stru_12422B0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v70, (bool)&v67);
cocos2d::CCArray::removeAllObjects(v4);
cocos2d::CCArray::addObject(v4, v5);
cocos2d::CCArray::addObject(v4, v6);
cocos2d::CCArray::addObject(v4, v7);
v27 = v63 * 0.5;
v28 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenBottom(v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v67, v27, v29 + 55.0);
GameToolbox::alignItemsHorisontally(v4, 140.0, v71, (bool)&v67);
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Version: %i",
(const char *)(unsigned int)a1->m_level->m_levelVersion);
cocos2d::CCString::getCString(v30);
v31 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v31);
v32 = a1->m_level;
random = v32->m_levelID.random;
seed = v32->m_levelID.seed;
if ( random == seed )
{
CString = "ID: na";
}
else
{
v35 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"ID: %i",
(const char *)(unsigned int)(random - seed));
CString = cocos2d::CCString::getCString(v35);
v32 = a1->m_level;
}
v37 = v32->m_originalLevel.random;
v38 = v32->m_originalLevel.seed;
if ( v37 != v38 )
{
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s (%i)",
CString,
(unsigned int)(v37 - v38));
cocos2d::CCString::getCString(v39);
}
v40 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v40);
v41 = v63 * 0.5;
v42 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getScreenBottom(v42);
cocos2d::CCPoint::CCPoint(&v65, v41, v43 + 14.0);
v44 = v31->setPosition;
cocos2d::CCPoint::CCPoint(&v66, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v67, &v65, &v66);
v44(v31, (const cocos2d::CCPoint *)&v67);
v45 = v40->setPosition;
cocos2d::CCPoint::CCPoint(&v66, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v67, &v65, &v66);
v45(v40, (const cocos2d::CCPoint *)&v67);
v31->setScale(v31, 0.6);
*(float *)&v46 = v40->getContentSize(v40)->width;
if ( *(float *)&v46 > 150.0 )
{
v47 = v40->setScale;
v48 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v40->getContentSize)(v40, *(float *)&v46);
v47(v40, 150.0 / *v48);
}
v49 = v40->setScale;
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, long double))v40->getScale)(v40, v46) < 0.6 )
v40->getScale(v40);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v49)(v40);
v50 = &v64[-1].m_pTargetArray;
if ( &v64[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
v51 = (unsigned int *)&v64[-1].m_nExtraKerning;
do
v52 = __ldaxr(v51);
while ( __stlxr(v52 - 1, v51) );
}
else
{
v52 = v64[-1].m_nExtraKerning;
v64[-1].m_nExtraKerning = v52 - 1;
}
if ( v52 <= 0 )
operator delete(v50);
}
}