//
// PauseLayer::setupProgressBars from 0x1001428b4 to 0x1001431b0 (2300 bytes)
//
// 1 xrefs:
// > PauseLayer::customSetup @ 0x100142028
//
// 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 PauseLayer::setupProgressBars(PauseLayer *a1)
{
GJGameLevel *m_level; // x21
cocos2d::CCDirector *v3; // x0
GameManager *v4; // x0
int PlayTimerMilli; // w0
cocos2d::CCString *v6; // x0
cocos2d::CCSprite *v7; // x20
__n128 v8; // q0
__n128 v9; // q1
cocos2d::CCSprite *v10; // x23
float v11; // s10
__n128 v12; // q0
__n128 v13; // q1
__n128 v14; // q1
__n128 v15; // q0
float width; // s11
int NormalPercent; // w0
float v18; // s10
cocos2d::CCSprite *v19; // x22
float32x2_t *v20; // x25
__n128 v21; // q1
__n128 v22; // q0
double v23; // d0
cocos2d::CCSprite *v24; // x24
__n128 v25; // q0
__n128 v26; // q1
__int64 v27; // x0
float v28; // s0
float v29; // s2
int v30; // w0
cocos2d::CCString *v31; // x0
const char *v32; // x0
cocos2d::CCLabelBMFont *v33; // x25
__int64 v34; // x0
cocos2d::CCString *v35; // x0
const char *v36; // x0
cocos2d::CCLabelBMFont *v37; // x21
__int64 v38; // x0
cocos2d::CCLabelBMFont *v39; // x21
float32x2_t *v40; // x20
__n128 v41; // q0
__n128 v42; // q1
double v43; // d0
cocos2d::CCLabelBMFont *v44; // x20
float32x2_t *v45; // x19
__n128 v46; // q0
__n128 v47; // q1
double v48; // d0
const char *CString; // x0
std::string *v50; // x8
cocos2d::CCString *v51; // x0
const char *v52; // x0
cocos2d::CCLabelBMFont *v53; // x20
__n128 v54; // q0
__n128 v55; // q1
GameManager *v56; // x0
std::string *v57; // x0
__int128 v58; // q0
void **v59; // x0
cocos2d::CCLabelBMFont *v60; // x21
float32x2_t *v61; // x19
__n128 v62; // q1
__n128 v63; // q0
double v64; // d0
float32x2_t v65; // [xsp+20h] [xbp-C0h] BYREF
std::string v66; // [xsp+28h] [xbp-B8h] BYREF
void *__p[2]; // [xsp+40h] [xbp-A0h] BYREF
signed __int64 v68; // [xsp+50h] [xbp-90h]
std::string v69; // [xsp+58h] [xbp-88h] BYREF
__int16 v70; // [xsp+74h] [xbp-6Ch] BYREF
char v71; // [xsp+76h] [xbp-6Ah]
float v72; // [xsp+78h] [xbp-68h]
float v73; // [xsp+7Ch] [xbp-64h]
m_level = GameManager::sharedState()->m_playLayer->m_level;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v3);
v71 = 0;
v70 = 0;
if ( GJGameLevel::isPlatformer(m_level) )
{
v4 = GameManager::sharedState();
PlayTimerMilli = GJBaseGameLayer::getPlayTimerMilli(v4->m_playLayer);
memset(&v69, 0, sizeof(v69));
if ( (unsigned int)(PlayTimerMilli + 3599999) > 0x6DDCFE || PlayTimerMilli / 60000 % 60 )
{
if ( (unsigned int)(PlayTimerMilli + 3599999) > 0x6DDCFE )
v6 = (cocos2d::CCString *)sub_100268F4C(
"%02d:%02d:%02d.%03d",
PlayTimerMilli / 3600000,
PlayTimerMilli / 60000 % 60,
PlayTimerMilli / 1000 % 60,
PlayTimerMilli % 1000);
else
v6 = (cocos2d::CCString *)sub_100268F4C(
"%02d:%02d.%03d",
PlayTimerMilli / 60000 % 60,
PlayTimerMilli / 1000 % 60,
PlayTimerMilli % 1000);
}
else
{
v6 = (cocos2d::CCString *)sub_100268F4C("%i.%03d", PlayTimerMilli / 1000 % 60, PlayTimerMilli % 1000);
}
CString = cocos2d::CCString::getCString(v6);
std::string::assign(&v69, CString);
if ( (v69.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v50 = &v69;
else
v50 = (std::string *)v69.__r_.__value_.__r.__words[0];
v51 = (cocos2d::CCString *)sub_100268F4C("Time: %s", (const char *)v50);
v52 = cocos2d::CCString::getCString(v51);
v53 = cocos2d::CCLabelBMFont::create_1(v52, "goldFont.fnt");
v54 = ((__n128 (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v53, 3);
v54.n128_f32[0] = v72 * 0.5;
v55.n128_f32[0] = (float)(v73 * 0.5) + 85.0;
sub_100022980(v54, v55, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v53->setPosition)(v53, __p);
cocos2d::CCLabelBMFont::limitLabelWidth(v53, 150.0, 0.8, 0.0);
if ( GameManager::sharedState()->m_playLayer->m_gameState.m_unkBool32 )
{
v56 = GameManager::sharedState();
GameToolbox::pointsToString((unsigned int)v56->m_playLayer->m_gameState.m_points, (__int64)&v66);
v57 = std::string::insert(&v66, 0, "Points: ");
v58 = *(_OWORD *)&v57->__r_.__value_.__l.__data_;
v68 = v57->__r_.__value_.__r.__words[2];
*(_OWORD *)__p = v58;
v57->__r_.__value_.__l.__size_ = 0;
v57->__r_.__value_.__r.__words[2] = 0;
v57->__r_.__value_.__r.__words[0] = 0;
if ( SHIBYTE(v66.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v66.__r_.__value_.__l.__data_);
if ( v68 >= 0 )
v59 = __p;
else
v59 = (void **)__p[0];
v60 = cocos2d::CCLabelBMFont::create_1((const char *)v59, "goldFont.fnt");
((void (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v60, 3);
v61 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v53->getPosition)(v53);
v62.n128_u32[0] = -1039400960;
v63.n128_u32[0] = 0;
sub_100022980(v63, v62, &v65);
*(float32x2_t *)&v64 = sub_1000229DC(v61, &v65, (float32x2_t *)&v66);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *, double))v60->setPosition)(v60, &v66, v64);
cocos2d::CCLabelBMFont::limitLabelWidth(v60, 150.0, 0.8, 0.0);
if ( SHIBYTE(v68) < 0 )
operator delete(__p[0]);
}
if ( SHIBYTE(v69.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v69.__r_.__value_.__l.__data_);
}
else
{
v7 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v7->setColor)(v7, &v70);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v7->setOpacity)(v7, 125);
((void (__fastcall *)(cocos2d::CCSprite *, float))v7->setScale)(v7, 1.0);
v8 = ((__n128 (__fastcall *)(PauseLayer *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v7, 3);
v8.n128_f32[0] = v72 * 0.5;
v9.n128_f32[0] = (float)(v73 * 0.5) + 80.0;
sub_100022980(v8, v9, &v69);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v7->setPosition)(v7, &v69);
v10 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setScaleX)(v10, 0.992);
((void (__fastcall *)(cocos2d::CCSprite *, float))v10->setScaleY)(v10, 0.86);
((void (__fastcall *)(cocos2d::CCSprite *, void *))v10->setColor)(v10, &unk_100638303);
v11 = v10->m_obRect.size.width - (float)(v10->m_obRect.size.width * 0.992);
v12 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))v7->addChild_0)(v7, v10, 1);
v12.n128_u32[0] = 0;
v13.n128_u32[0] = 0.5;
sub_100022980(v12, v13, &v69);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v10->setAnchorPoint)(v10, &v69);
v14.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))v7->getContentSize)(v7) + 4) * 0.5;
v15.n128_f32[0] = v11 * 0.5;
sub_100022980(v15, v14, &v69);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v10->setPosition)(v10, &v69);
width = v10->m_obRect.size.width;
NormalPercent = GJGameLevel::getNormalPercent(m_level);
v18 = v10->m_obRect.size.width;
if ( width > (float)(width * (float)((float)NormalPercent / 100.0)) )
v18 = v18 * (float)((float)GJGameLevel::getNormalPercent(m_level) / 100.0);
sub_100022990((float *)&v69, 0.0, 0.0, v18, v10->m_obRect.size.height);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v10->setTextureRect)(v10, &v69);
v19 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v19->setColor)(v19, &v70);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v19->setOpacity)(v19, 125);
((void (__fastcall *)(cocos2d::CCSprite *, float))v19->setScale)(v19, 1.0);
((void (__fastcall *)(PauseLayer *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v19, 3);
v20 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v7->getPosition)(v7);
v21.n128_u32[0] = -1035468800;
v22.n128_u32[0] = 0;
sub_100022980(v22, v21, __p);
*(float32x2_t *)&v23 = sub_1000229DC(v20, (float32x2_t *)__p, (float32x2_t *)&v69);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *, double))v19->setPosition)(v19, &v69, v23);
v24 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v24->setScaleX)(v24, 0.992);
((void (__fastcall *)(cocos2d::CCSprite *, float))v24->setScaleY)(v24, 0.86);
v69.__r_.__value_.__s.__data_[2] = -1;
LOWORD(v69.__r_.__value_.__l.__data_) = -256;
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v24->setColor)(v24, &v69);
v25 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))v19->addChild_0)(v19, v24, 1);
v25.n128_u32[0] = 0;
v26.n128_u32[0] = 0.5;
sub_100022980(v25, v26, &v69);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v24->setAnchorPoint)(v24, &v69);
v27 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v10->getPosition)(v10);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v24->setPosition)(v24, v27);
v28 = v24->m_obRect.size.width;
if ( v28 <= (float)(v28 * (float)((float)m_level->m_practicePercent / 100.0)) )
v29 = v24->m_obRect.size.width;
else
v29 = v28 * (float)((float)m_level->m_practicePercent / 100.0);
sub_100022990((float *)&v69, 0.0, 0.0, v29, v24->m_obRect.size.height);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v24->setTextureRect)(v24, &v69);
v30 = GJGameLevel::getNormalPercent(m_level);
v31 = (cocos2d::CCString *)sub_100268F4C("%i%%", v30);
v32 = cocos2d::CCString::getCString(v31);
v33 = cocos2d::CCLabelBMFont::create_1(v32, "bigFont.fnt");
((void (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v33, 4);
v34 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v7->getPosition)(v7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v33->setPosition)(v33, v34);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v33->setScale)(v33, 0.5);
v35 = (cocos2d::CCString *)sub_100268F4C("%i%%", m_level->m_practicePercent);
v36 = cocos2d::CCString::getCString(v35);
v37 = cocos2d::CCLabelBMFont::create_1(v36, "bigFont.fnt");
((void (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v37, 4);
v38 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v19->getPosition)(v19);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v37->setPosition)(v37, v38);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v37->setScale)(v37, 0.5);
v39 = cocos2d::CCLabelBMFont::create_1("Normal Mode", "bigFont.fnt");
((void (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v39, 4);
v40 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v7->getPosition)(v7);
v41.n128_u32[0] = 0;
v42.n128_u32[0] = 20.0;
sub_100022980(v41, v42, __p);
*(float32x2_t *)&v43 = sub_1000229DC(v40, (float32x2_t *)__p, (float32x2_t *)&v69);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *, double))v39->setPosition)(v39, &v69, v43);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v39->setScale)(v39, 0.5);
v44 = cocos2d::CCLabelBMFont::create_1("Practice Mode", "bigFont.fnt");
((void (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v44, 4);
v45 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v19->getPosition)(v19);
v46.n128_u32[0] = 0;
v47.n128_u32[0] = 20.0;
sub_100022980(v46, v47, __p);
*(float32x2_t *)&v48 = sub_1000229DC(v45, (float32x2_t *)__p, (float32x2_t *)&v69);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *, double))v44->setPosition)(v44, &v69, v48);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v44->setScale)(v44, 0.5);
}
}