//
// PauseLayer::setupProgressBars from 0x3a7e00 to 0x3a8446 (1606 bytes)
//
// 1 xrefs:
// > PauseLayer::customSetup @ 0x3a862a
//
// 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 PauseLayer::setupProgressBars(PauseLayer *a1)
{
GJGameLevel *m_level; // r11
cocos2d::CCDirector *v3; // r0
const char *v4; // r1
cocos2d::CCNode *v5; // r5
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
const char *v7; // r1
float *v8; // r6
float v9; // s17
void (__fastcall *v10)(float *, cocos2d::CCRect *); // r8
void (__fastcall *v11)(float *, cocos2d::CCRect *); // r8
int v12; // r0
float v13; // s17
float v14; // s15
bool v15; // fzf
bool v16; // fnf
float v17; // s17
void (__fastcall *v18)(float *, cocos2d::CCRect *); // r8
const char *v19; // r1
cocos2d::CCNode *v20; // r8
const char *v21; // r1
float *v22; // r9
void (__fastcall *v23)(float *, cocos2d::CCRect *); // r2
int v24; // r0
float v25; // s14
void (__fastcall *v26)(float *, cocos2d::CCRect *); // r6
float v27; // r3
const char *NormalPercent; // r0
cocos2d::CCString *v29; // r0
cocos2d::CCLabelBMFont *v30; // r6
int v31; // r0
cocos2d::CCString *v32; // r0
cocos2d::CCLabelBMFont *v33; // r6
void (__fastcall *v34)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v35; // r0
cocos2d::CCLabelBMFont *v36; // r6
void (__fastcall *v37)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v38; // r5
cocos2d::CCLabelBMFont *v39; // r5
void (__fastcall *v40)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r6
int v41; // r7
GameManager *v42; // r0
int PlayTimerMilli; // r0
int v44; // r10
int v45; // r8
int v46; // r9
int v47; // r1
cocos2d::CCString *v48; // r0
char *CString; // r0
cocos2d::CCString *v50; // r0
cocos2d::CCLabelBMFont *v51; // r8
void (__fastcall *v52)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
GameManager *v53; // r0
cocos2d::CCLabelBMFont **v54; // r0
cocos2d::CCLabelBMFont *v55; // r5
void (__fastcall *v56)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
int v57; // r8
int v58; // [sp+10h] [bp-3Ch]
void (__fastcall *v59)(float *, cocos2d::CCRect *); // [sp+10h] [bp-3Ch]
void (__fastcall *v60)(float *, int); // [sp+10h] [bp-3Ch]
void (__fastcall *v61)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+10h] [bp-3Ch]
cocos2d::CCString *v62; // [sp+14h] [bp-38h]
_BYTE v63[4]; // [sp+18h] [bp-34h] BYREF
char *v64; // [sp+1Ch] [bp-30h] BYREF
cocos2d::CCLabelBMFont *v65; // [sp+20h] [bp-2Ch] BYREF
cocos2d::CCSize v66; // [sp+24h] [bp-28h] BYREF
cocos2d::CCPoint v67; // [sp+2Ch] [bp-20h] BYREF
cocos2d::CCRect v68; // [sp+34h] [bp-18h] BYREF
m_level = GameManager::sharedState()->m_playLayer->m_level;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v66, v3);
v63[0] = 0;
v63[1] = 0;
v63[2] = 0;
if ( !GJGameLevel::isPlatformer(m_level) )
{
v5 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v4);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v5->__vftable[1].getTag)(v5, v63);
((void (__fastcall *)(cocos2d::CCNode *, int))v5->__vftable[1].~CCNode_0)(v5, 125);
((void (__fastcall *)(cocos2d::CCNode *, int))v5->setScale)(v5, 1065353216);
a1->addChild_0(a1, v5, 3);
setPosition = v5->setPosition;
cocos2d::CCPoint::CCPoint(&v68.origin, v66.width * 0.5, (float)((float)(v66.height * 0.5) + 80.0) + 0.0);
setPosition(v5, &v68.origin);
v8 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v7);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v8 + 64))(v8, 1065218998);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v8 + 72))(v8, 1063004406);
(*(void (__fastcall **)(float *, void *))(*(_DWORD *)v8 + 472))(v8, &unk_9AA8D0);
v9 = v8[86] - (float)(v8[86] * 0.992);
v5->addChild_0(v5, (cocos2d::CCNode *)v8, 1);
v10 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v8 + 140);
cocos2d::CCPoint::CCPoint(&v68.origin, 0.0, 0.5);
v10(v8, &v68);
v11 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v8 + 92);
v12 = (int)v5->getContentSize(v5);
cocos2d::CCPoint::CCPoint(&v68.origin, v9 * 0.5, *(float *)(v12 + 4) * 0.5);
v11(v8, &v68);
v13 = v8[86];
v14 = v13 * (float)((float)GJGameLevel::getNormalPercent(m_level) / 100.0);
v15 = v13 == v14;
v16 = v13 < v14;
v17 = v8[86];
if ( !v16 && !v15 )
v17 = v17 * (float)((float)GJGameLevel::getNormalPercent(m_level) / 100.0);
v18 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v8 + 560);
cocos2d::CCRect::CCRect(&v68, 0.0, 0.0, v17, v8[87]);
v18(v8, &v68);
v20 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v19);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v20->__vftable[1].getTag)(v20, v63);
((void (__fastcall *)(cocos2d::CCNode *, int))v20->__vftable[1].~CCNode_0)(v20, 125);
((void (__fastcall *)(cocos2d::CCNode *, int))v20->setScale)(v20, 1065353216);
a1->addChild_0(a1, v20, 3);
v62 = (cocos2d::CCString *)v20->setPosition;
v58 = (int)v5->getPosition(v5);
cocos2d::CCPoint::CCPoint(&v67, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v68, v58, &v67);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))v62)(v20, &v68);
v22 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v21);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v22 + 64))(v22, 1065218998);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v22 + 72))(v22, 1063004406);
v23 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v22 + 472);
LOWORD(v68.origin.x) = -256;
BYTE2(v68.origin.x) = -1;
v23(v22, &v68);
v20->addChild_0(v20, (cocos2d::CCNode *)v22, 1);
v59 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v22 + 140);
cocos2d::CCPoint::CCPoint(&v68.origin, 0.0, 0.5);
v59(v22, &v68);
v60 = *(void (__fastcall **)(float *, int))(*(_DWORD *)v22 + 92);
v24 = (*(int (__fastcall **)(float *))(*(_DWORD *)v8 + 96))(v8);
v60(v22, v24);
v25 = v22[86];
v26 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v22 + 560);
if ( v25 > (float)(v25 * (float)((float)m_level->m_practicePercent / 100.0)) )
v27 = v25 * (float)((float)m_level->m_practicePercent / 100.0);
else
v27 = v22[86];
cocos2d::CCRect::CCRect(&v68, 0.0, 0.0, v27, v22[87]);
v26(v22, &v68);
NormalPercent = (const char *)GJGameLevel::getNormalPercent(m_level);
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i%%", NormalPercent);
cocos2d::CCString::getCString(v29);
v30 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v30, 4);
v61 = v30->setPosition;
v31 = (int)v5->getPosition(v5);
v61(v30, (const cocos2d::CCPoint *)v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v30->setScale)(v30, 1056964608);
v32 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%%",
(const char *)m_level->m_practicePercent);
cocos2d::CCString::getCString(v32);
v33 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v33, 4);
v34 = v33->setPosition;
v35 = (int)v20->getPosition(v20);
v34(v33, (const cocos2d::CCPoint *)v35);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v33->setScale)(v33, 1056964608);
v36 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v36, 4);
v37 = v36->setPosition;
v38 = (int)v5->getPosition(v5);
cocos2d::CCPoint::CCPoint(&v67, 0.0, 20.0);
cocos2d::CCPoint::operator+(&v68, v38, &v67);
v37(v36, &v68.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v36->setScale)(v36, 1056964608);
v39 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v39, 4);
v40 = v39->setPosition;
v41 = (int)v20->getPosition(v20);
cocos2d::CCPoint::CCPoint(&v67, 0.0, 20.0);
cocos2d::CCPoint::operator+(&v68, v41, &v67);
v40(v39, &v68.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v39->setScale)(v39, 1056964608);
return;
}
v42 = GameManager::sharedState();
PlayTimerMilli = GJBaseGameLayer::getPlayTimerMilli(v42->m_playLayer);
v44 = PlayTimerMilli % 1000;
v45 = PlayTimerMilli / 1000 % 60;
v46 = PlayTimerMilli / 1000 / 60 % 60;
v47 = PlayTimerMilli / 1000 / 3600;
v64 = (char *)&unk_ACDDA8;
if ( v46 )
{
if ( !v47 )
{
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d.%03d",
(const char *)v46,
v45,
v44);
goto LABEL_11;
}
}
else if ( !v47 )
{
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i.%03d",
(const char *)v45,
v44);
goto LABEL_11;
}
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d:%02d.%03d",
(const char *)v47,
v46,
v45,
v44);
LABEL_11:
CString = (char *)cocos2d::CCString::getCString(v48);
sub_7753D4((int)&v64, CString);
v50 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Time: %s", v64);
cocos2d::CCString::getCString(v50);
v51 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v51, 3);
v52 = v51->setPosition;
cocos2d::CCPoint::CCPoint(&v68.origin, v66.width * 0.5, (float)((float)(v66.height * 0.5) + 85.0) + 0.0);
v52(v51, &v68.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v51, 150.0, 0.8, 0.0);
if ( GameManager::sharedState()->m_playLayer->m_gameState.m_unkBool32 )
{
v53 = GameManager::sharedState();
GameToolbox::pointsToString((GameToolbox *)&v68, v53->m_playLayer->m_gameState.m_points);
v54 = (cocos2d::CCLabelBMFont **)sub_775570((int)&v68, 0, "Points: ");
v65 = *v54;
*v54 = (cocos2d::CCLabelBMFont *)&unk_ACDDA8;
sub_774008(&v68);
v55 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v55, 3);
v56 = v55->setPosition;
v57 = (int)v51->getPosition(v51);
cocos2d::CCPoint::CCPoint(&v67, 0.0, -35.0);
cocos2d::CCPoint::operator+(&v68, v57, &v67);
v56(v55, &v68.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v55, 150.0, 0.8, 0.0);
sub_774008(&v65);
}
sub_774008(&v64);
}