//
// EditLevelLayer::setupLevelInfo from 0x1000ea778 to 0x1000eaf58 (2016 bytes)
//
// 1 xrefs:
// > EditLevelLayer::init @ 0x1000e9868
//
// 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 EditLevelLayer::setupLevelInfo(EditLevelLayer *a1)
{
cocos2d::CCDirector *v2; // x0
__int64 v3; // x0
cocos2d::CCArray *v4; // x20
cocos2d::CCNode *v5; // x21
cocos2d::CCNode *v6; // x22
cocos2d::CCNode *v7; // x23
cocos2d::CCSprite *v8; // x28
cocos2d::CCSprite *v9; // x26
cocos2d::CCSprite *v10; // x24
std::string *p_p; // x0
cocos2d::CCLabelBMFont *v12; // x27
float *v13; // x0
__n128 v14; // q0
std::string *v15; // x0
cocos2d::CCLabelBMFont *v16; // x28
float *v17; // x0
__n128 v18; // q0
GJGameLevel *m_level; // x8
const std::string::value_type *v20; // x1
std::string *v21; // x0
cocos2d::CCLabelBMFont *v22; // x25
float32x2_t *v23; // x26
__n128 v24; // q0
__n128 v25; // q1
double v26; // d0
float v27; // s8
cocos2d::CCDirector *v28; // x0
__n128 v29; // q0
__n128 v30; // q1
cocos2d::CCString *v31; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v33; // x20
GJGameLevel *v34; // x8
int v35; // w9
const char *v36; // x0
cocos2d::CCString *v37; // x0
int v38; // w8
cocos2d::CCString *v39; // x0
cocos2d::CCLabelBMFont *v40; // x21
float v41; // s8
cocos2d::CCDirector *v42; // x0
__n128 v43; // q0
__n128 v44; // q1
AppDelegate *v45; // x0
__n128 v46; // q0
__n128 v47; // q1
double v48; // d0
AppDelegate *v49; // x0
__n128 v50; // q0
__n128 v51; // q1
double v52; // d0
float v53; // s8
__n128 v54; // q0
float *v55; // x0
GJGameLevel *v56; // x8
int v57; // w26
bool v58; // w25
int m_coins; // w9
cocos2d::CCSprite *v60; // [xsp+18h] [xbp-A8h]
cocos2d::CCSprite *v61; // [xsp+20h] [xbp-A0h]
float32x2_t v62; // [xsp+28h] [xbp-98h] BYREF
float32x2_t v63; // [xsp+30h] [xbp-90h] BYREF
float32x2_t v64; // [xsp+38h] [xbp-88h] BYREF
std::string __p; // [xsp+40h] [xbp-80h] BYREF
float v66; // [xsp+58h] [xbp-68h]
cocos2d::CCPoint v67; // 0:s1.4,4:s2.4
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
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
v4 = (cocos2d::CCArray *)sub_10024A15C(v3);
v5 = cocos2d::CCNode::create();
((void (__fastcall *)(EditLevelLayer *, cocos2d::CCNode *))a1->addChild)(a1, v5);
v6 = cocos2d::CCNode::create();
((void (__fastcall *)(EditLevelLayer *, cocos2d::CCNode *))a1->addChild)(a1, v6);
v7 = cocos2d::CCNode::create();
((void (__fastcall *)(EditLevelLayer *, cocos2d::CCNode *))a1->addChild)(a1, v7);
v8 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v5->addChild)(v5, v8);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_noteIcon_001.png");
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v6->addChild)(v6, v9);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v7->addChild)(v7, v10);
GJGameLevel::lengthKeyToString(a1->m_level->m_levelLength, &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v12 = cocos2d::CCLabelBMFont::create_1((const char *)p_p, "bigFont.fnt");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v60 = v9;
v61 = v8;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v5->addChild)(v5, v12);
v13 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getContentSize)(v12);
v14.n128_u32[0] = 0.5;
if ( (float)(100.0 / *v13) <= 0.5 )
v14.n128_f32[0] = 100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v12->getContentSize)(v12);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v12->setScale)(v12, v14);
GJGameLevel::getSongName((__int64)a1->m_level, (__int64)&__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v15 = &__p;
else
v15 = (std::string *)__p.__r_.__value_.__r.__words[0];
v16 = cocos2d::CCLabelBMFont::create_1((const char *)v15, "bigFont.fnt");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v6->addChild)(v6, v16);
v17 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v16->getContentSize)(v16);
v18.n128_u32[0] = 0.5;
if ( (float)(100.0 / *v17) <= 0.5 )
v18.n128_f32[0] = 100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v16->getContentSize)(v16);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v16->setScale)(v16, v18);
sub_100009900(&__p, "");
m_level = a1->m_level;
if ( m_level->m_isUploaded )
{
v20 = "Uploaded";
LABEL_19:
std::string::assign(&__p, v20);
goto LABEL_20;
}
if ( m_level->m_isVerified.random - m_level->m_isVerified.seed == 1 )
{
v20 = "Verified";
goto LABEL_19;
}
std::string::assign(&__p, "Unverified");
if ( a1->m_level->m_coins >= 1 )
{
std::string::assign(&__p, "Unverified\nReq. Coins: ");
v56 = a1->m_level;
v57 = v56->m_firstCoinVerified.random - v56->m_firstCoinVerified.seed;
v58 = v57 == 1;
if ( v57 != 1 )
{
std::string::append(&__p, "1");
v56 = a1->m_level;
}
m_coins = v56->m_coins;
if ( m_coins >= 2 )
{
if ( v56->m_secondCoinVerified.random - v56->m_secondCoinVerified.seed != 1 )
{
if ( v57 != 1 )
std::string::append(&__p, ", ");
std::string::append(&__p, "2");
v58 = 0;
v56 = a1->m_level;
m_coins = v56->m_coins;
}
if ( m_coins >= 3 && v56->m_thirdCoinVerified.random - v56->m_thirdCoinVerified.seed != 1 )
{
if ( !v58 )
std::string::append(&__p, ", ");
std::string::append(&__p, "3");
}
}
}
LABEL_20:
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v21 = &__p;
else
v21 = (std::string *)__p.__r_.__value_.__r.__words[0];
v22 = cocos2d::CCLabelBMFont::create_1((const char *)v21, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v7->addChild)(v7, v22);
cocos2d::CCLabelBMFont::limitLabelWidth(v22, 100.0, 0.5, 0.0);
v23 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v10->getPosition)(v10);
v24.n128_u32[0] = 0;
v25.n128_u32[0] = 2.0;
sub_100022980(v24, v25, &v63);
*(float32x2_t *)&v26 = sub_1000229DC(v23, &v63, &v64);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, double))v10->setPosition)(v10, &v64, v26);
sub_10024A45C(v4);
sub_10024A2D0(v4, v61);
sub_10024A2D0(v4, v12);
sub_1000229B8((__int64 *)&v64, &qword_10086AED0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v67, (bool)&v64);
sub_10024A45C(v4);
sub_10024A2D0(v4, v60);
sub_10024A2D0(v4, v16);
sub_1000229B8((__int64 *)&v64, &qword_10086AED0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v68, (bool)&v64);
sub_10024A45C(v4);
sub_10024A2D0(v4, v10);
sub_10024A2D0(v4, v22);
sub_1000229B8((__int64 *)&v64, &qword_10086AED0);
GameToolbox::alignItemsHorisontally(v4, 4.0, v69, (bool)&v64);
sub_10024A45C(v4);
sub_10024A2D0(v4, v5);
sub_10024A2D0(v4, v6);
sub_10024A2D0(v4, v7);
v27 = v66;
v28 = cocos2d::CCDirector::sharedDirector();
v29.n128_f64[0] = sub_1001768D0(v28);
v30.n128_f32[0] = v29.n128_f32[0] + 55.0;
v29.n128_f32[0] = v27 * 0.5;
sub_100022980(v29, v30, &v64);
GameToolbox::alignItemsHorisontally(v4, 140.0, v70, (bool)&v64);
v31 = (cocos2d::CCString *)sub_100268F4C("Version: %i", a1->m_level->m_levelVersion);
CString = cocos2d::CCString::getCString(v31);
v33 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
((void (__fastcall *)(EditLevelLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v33);
v34 = a1->m_level;
v35 = v34->m_levelID.random - v34->m_levelID.seed;
if ( v35 )
{
v37 = (cocos2d::CCString *)sub_100268F4C("ID: %i", v35);
v36 = cocos2d::CCString::getCString(v37);
v34 = a1->m_level;
}
else
{
v36 = "ID: na";
}
v38 = v34->m_originalLevel.random - v34->m_originalLevel.seed;
if ( v38 )
{
v39 = (cocos2d::CCString *)sub_100268F4C("%s (%i)", v36, v38);
v36 = cocos2d::CCString::getCString(v39);
}
v40 = cocos2d::CCLabelBMFont::create_1(v36, "goldFont.fnt");
((void (__fastcall *)(EditLevelLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v40);
v41 = v66;
v42 = cocos2d::CCDirector::sharedDirector();
v43.n128_f64[0] = sub_1001768D0(v42);
v44.n128_f32[0] = v43.n128_f32[0] + 14.0;
v43.n128_f32[0] = v41 * 0.5;
sub_100022980(v43, v44, &v64);
v45 = AppDelegate::get();
v47.n128_u32[0] = 10.0;
if ( !v45->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] )
v47.n128_f32[0] = 0.0;
v46.n128_u32[0] = -1030356992;
sub_100022980(v46, v47, &v62);
*(float32x2_t *)&v48 = sub_1000229DC(&v64, &v62, &v63);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v33->setPosition)(v33, &v63, v48);
v49 = AppDelegate::get();
v51.n128_u32[0] = 10.0;
if ( !v49->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] )
v51.n128_f32[0] = 0.0;
v50.n128_u32[0] = 1117126656;
sub_100022980(v50, v51, &v62);
*(float32x2_t *)&v52 = sub_1000229DC(&v64, &v62, &v63);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v40->setPosition)(v40, &v63, v52);
v53 = 0.6;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v33->setScale)(v33, 0.6);
v54.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v40->getContentSize)(v40);
if ( v54.n128_f32[0] > 150.0 )
{
v55 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v40->getContentSize)(v40, v54.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v40->setScale)(v40, 150.0 / *v55);
}
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v40->getScale)(v40, v54) < 0.6 )
v53 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v40->getScale)(v40);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v40->setScale)(v40, v53);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}