//
// PauseLayer::setupProgressBars from 0x6c6ebc to 0x6c7918 (2652 bytes)
//
// 2 xrefs:
// > PauseLayer::customSetup @ 0x6c7b7c
// > ??> @ 0x7e600
//
// 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; // x27
cocos2d::CCDirector *v3; // x0
const char *v4; // x1
cocos2d::CCNode *v5; // x20
void (__fastcall *v6)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
const char *v7; // x1
float *v8; // x23
float v9; // s9
void (__fastcall *v10)(float *, cocos2d::CCRect *); // x26
void (__fastcall *v11)(float *, cocos2d::CCRect *); // x26
__int64 v12; // x0
float v13; // s9
float v14; // s2
void (__fastcall *v15)(float *, cocos2d::CCRect *); // x24
const char *v16; // x1
cocos2d::CCNode *v17; // x24
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28
const char *v19; // x1
float *v20; // x25
void (__fastcall *v21)(float *, cocos2d::CCRect *); // x3
void (__fastcall *v22)(float *, cocos2d::CCRect *); // x28
float *v23; // x0
__int64 (__fastcall *v24)(float *); // x1
void (__fastcall *v25)(float *, __int64); // x23
__int64 v26; // x0
float v27; // s0
float v28; // s2
void (__fastcall *v29)(float *, cocos2d::CCRect *); // x23
unsigned int NormalPercent; // w0
cocos2d::CCString *v31; // x0
cocos2d::CCLabelBMFont *v32; // x25
__int64 v33; // x0
cocos2d::CCString *v34; // x0
cocos2d::CCLabelBMFont *v35; // x25
void (__fastcall *v36)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
__int64 v37; // x0
cocos2d::CCLabelBMFont *v38; // x25
cocos2d::CCNode *v39; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v41)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x20
__int64 v42; // x27
cocos2d::CCLabelBMFont *v43; // x20
void (__fastcall *v44)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
__int64 v45; // x23
GameManager *v46; // x0
int PlayTimerMilli; // w0
const char *v48; // x1
unsigned int v49; // w2
unsigned int v50; // w3
unsigned int v51; // w4
cocos2d::CCString *v52; // x0
size_t v53; // x0
cocos2d::CCString *v54; // x0
cocos2d::CCLabelBMFont *v55; // x23
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
char *v57; // x21
unsigned int *v58; // x2
int v59; // w0
float v60; // s9
GameManager *v61; // x0
__int64 *v62; // x0
__int64 v63; // x25
void *v64; // x0
cocos2d::CCLabelBMFont *v65; // x24
void (__fastcall *v66)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x21
__int64 v67; // x23
void *v68; // x0
unsigned int *v69; // x25
int v70; // w1
unsigned int *v71; // x2
int v72; // w1
__int64 v73; // [xsp+98h] [xbp+98h]
void (__fastcall *v74)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+98h] [xbp+98h]
const char *CString; // [xsp+98h] [xbp+98h]
_BYTE v76[8]; // [xsp+A8h] [xbp+A8h] BYREF
float v77; // [xsp+B0h] [xbp+B0h]
float v78; // [xsp+B4h] [xbp+B4h]
char *v79; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCPoint v80; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCRect v81; // [xsp+C8h] [xbp+C8h] BYREF
m_level = GameManager::sharedState()->m_playLayer->m_level;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v3);
v76[0] = 0;
v76[1] = 0;
v76[2] = 0;
if ( GJGameLevel::isPlatformer(m_level) )
{
v46 = GameManager::sharedState();
PlayTimerMilli = GJBaseGameLayer::getPlayTimerMilli(v46->m_playLayer);
v79 = &byte_124B6C8;
v48 = (const char *)(unsigned int)(PlayTimerMilli / 1000 / 3600);
v49 = PlayTimerMilli / 1000 / 60 % 60;
v50 = PlayTimerMilli / 1000 % 60;
v51 = PlayTimerMilli % 1000;
if ( v49 | (unsigned int)v48 )
{
if ( (_DWORD)v48 )
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%02d:%02d:%02d.%03d", v48);
else
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d.%03d",
(const char *)v49,
v50,
v51);
}
else
{
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i.%03d",
(const char *)v50,
v51);
}
CString = cocos2d::CCString::getCString(v52);
v53 = strlen(CString);
sub_D1798C(&v79, CString, v53);
v54 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Time: %s", v79);
cocos2d::CCString::getCString(v54);
v55 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v55, 3);
setPosition = v55->setPosition;
cocos2d::CCPoint::CCPoint(&v81.origin, v77 * 0.5, (float)((float)(v78 * 0.5) + 85.0) + 0.0);
setPosition(v55, &v81.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v55, 150.0, 0.8, 0.0);
if ( GameManager::sharedState()->m_playLayer->m_gameState.m_unkBool32 )
{
v61 = GameManager::sharedState();
GameToolbox::pointsToString((GameToolbox *)(unsigned int)v61->m_playLayer->m_gameState.m_points, (__int64 *)&v81);
v62 = (__int64 *)sub_D17B90(&v81, 0, "Points: ", 8);
v63 = *v62;
*v62 = (__int64)&byte_124B6C8;
v64 = (void *)(*(_QWORD *)&v81.origin - 24LL);
if ( (__int64 *)(*(_QWORD *)&v81.origin - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v71 = (unsigned int *)(*(_QWORD *)&v81.origin - 8LL);
do
v72 = __ldaxr(v71);
while ( __stlxr(v72 - 1, v71) );
}
else
{
v72 = *(_DWORD *)(*(_QWORD *)&v81.origin - 8LL);
*(_DWORD *)(*(_QWORD *)&v81.origin - 8LL) = v72 - 1;
}
if ( v72 <= 0 )
operator delete(v64);
}
v65 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v65, 3);
v66 = v65->setPosition;
v67 = (__int64)v55->getPosition(v55);
cocos2d::CCPoint::CCPoint(&v80, 0.0, -35.0);
cocos2d::CCPoint::operator+(&v81, v67, &v80);
v66(v65, &v81.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v65, 150.0, 0.8, 0.0);
v68 = (void *)(v63 - 24);
if ( (__int64 *)(v63 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v69 = (unsigned int *)(v63 - 8);
do
v70 = __ldaxr(v69);
while ( __stlxr(v70 - 1, v69) );
}
else
{
v70 = *(_DWORD *)(v63 - 8);
*(_DWORD *)(v63 - 8) = v70 - 1;
}
if ( v70 <= 0 )
operator delete(v68);
}
}
v57 = v79 - 24;
if ( v79 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v58 = (unsigned int *)(v79 - 8);
do
v59 = __ldaxr(v58);
while ( __stlxr(v59 - 1, v58) );
}
else
{
v59 = *((_DWORD *)v79 - 2);
*((_DWORD *)v79 - 2) = v59 - 1;
}
if ( v59 <= 0 )
operator delete(v57);
}
}
else
{
v5 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v4);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v5->__vftable[1].getTag)(v5, v76);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v5->__vftable[1].~CCNode_0)(v5, 125);
v5->setScale(v5, 1.0);
a1->addChild_0(a1, v5, 3);
v6 = v5->setPosition;
cocos2d::CCPoint::CCPoint(&v81.origin, v77 * 0.5, (float)((float)(v78 * 0.5) + 80.0) + 0.0);
v6(v5, &v81.origin);
v8 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v7);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v8 + 128LL))(v8, 0.992);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v8 + 144LL))(v8, 0.86);
(*(void (__fastcall **)(float *, void *))(*(_QWORD *)v8 + 944LL))(v8, &unk_EC7630);
v9 = v8[108] - (float)(v8[108] * 0.992);
v5->addChild_0(v5, (cocos2d::CCNode *)v8, 1);
v10 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v8 + 280LL);
cocos2d::CCPoint::CCPoint(&v81.origin, 0.0, 0.5);
v10(v8, &v81);
v11 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v8 + 184LL);
v12 = (__int64)v5->getContentSize(v5);
cocos2d::CCPoint::CCPoint(&v81.origin, v9 * 0.5, *(float *)(v12 + 4) * 0.5);
v11(v8, &v81);
v13 = v8[108];
if ( v13 > (float)(v13 * (float)((float)GJGameLevel::getNormalPercent(m_level) / 100.0)) )
{
v60 = v8[108];
v14 = v60 * (float)((float)GJGameLevel::getNormalPercent(m_level) / 100.0);
}
else
{
v14 = v8[108];
}
v15 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v8 + 1120LL);
cocos2d::CCRect::CCRect(&v81, 0.0, 0.0, v14, v8[109]);
v15(v8, &v81);
v17 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v16);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v17->__vftable[1].getTag)(v17, v76);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v17->__vftable[1].~CCNode_0)(v17, 125);
v17->setScale(v17, 1.0);
a1->addChild_0(a1, v17, 3);
v18 = v17->setPosition;
v73 = (__int64)v5->getPosition(v5);
cocos2d::CCPoint::CCPoint(&v80, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v81, v73, &v80);
v18(v17, &v81.origin);
v20 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v19);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v20 + 128LL))(v20, 0.992);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v20 + 144LL))(v20, 0.86);
v21 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v20 + 944LL);
BYTE2(v81.origin.x) = -1;
LOWORD(v81.origin.x) = -256;
v21(v20, &v81);
v17->addChild_0(v17, (cocos2d::CCNode *)v20, 1);
v22 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v20 + 280LL);
cocos2d::CCPoint::CCPoint(&v81.origin, 0.0, 0.5);
v22(v20, &v81);
v23 = v8;
v24 = *(__int64 (__fastcall **)(float *))(*(_QWORD *)v8 + 192LL);
v25 = *(void (__fastcall **)(float *, __int64))(*(_QWORD *)v20 + 184LL);
v26 = v24(v23);
v25(v20, v26);
v27 = v20[108];
v28 = v27 * (float)((float)m_level->m_practicePercent / 100.0);
if ( v27 <= v28 )
v28 = v20[108];
v29 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v20 + 1120LL);
cocos2d::CCRect::CCRect(&v81, 0.0, 0.0, v28, v20[109]);
v29(v20, &v81);
NormalPercent = GJGameLevel::getNormalPercent(m_level);
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%%",
(const char *)NormalPercent);
cocos2d::CCString::getCString(v31);
v32 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v32, 4);
v74 = v32->setPosition;
v33 = (__int64)v5->getPosition(v5);
v74(v32, (const cocos2d::CCPoint *)v33);
v32->setScale(v32, 0.5);
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%%",
(const char *)(unsigned int)m_level->m_practicePercent);
cocos2d::CCString::getCString(v34);
v35 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v35, 4);
v36 = v35->setPosition;
v37 = (__int64)v17->getPosition(v17);
v36(v35, (const cocos2d::CCPoint *)v37);
v35->setScale(v35, 0.5);
v38 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v38, 4);
v39 = v5;
getPosition = v5->getPosition;
v41 = v38->setPosition;
v42 = (__int64)getPosition(v39);
cocos2d::CCPoint::CCPoint(&v80, 0.0, 20.0);
cocos2d::CCPoint::operator+(&v81, v42, &v80);
v41(v38, &v81.origin);
v38->setScale(v38, 0.5);
v43 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v43, 4);
v44 = v43->setPosition;
v45 = (__int64)v17->getPosition(v17);
cocos2d::CCPoint::CCPoint(&v80, 0.0, 20.0);
cocos2d::CCPoint::operator+(&v81, v45, &v80);
v44(v43, &v81.origin);
v43->setScale(v43, 0.5);
}
}