//
// LevelInfoLayer::setupProgressBars from 0x1402fa700 to 0x1402fae01 (1793 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::init @ 0x1402f8257
// > ??> @ 0x1406d416c
//
// 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
//
// Hidden C++ exception states: #wind=2
void LevelInfoLayer::setupProgressBars(LevelInfoLayer *a1)
{
cocos2d::CCDirector *v2; // rax
struct cocos2d::CCSprite *v3; // r12
__int64 v4; // rdx
cocos2d::CCSprite_vtbl *v5; // rbx
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
float v8; // xmm0_4
const cocos2d::CCPoint *v9; // rax
struct cocos2d::CCSprite *v10; // r14
float v11; // xmm6_4
float v12; // xmm0_4
cocos2d::CCSprite_vtbl *v13; // rbx
double v14; // xmm0_8
const cocos2d::CCPoint *v15; // rax
cocos2d::CCSprite_vtbl *v16; // rbx
const cocos2d::CCPoint *v17; // rax
float v18; // xmm1_4
float width; // xmm3_4
cocos2d::CCSprite_vtbl *v20; // rbx
const cocos2d::CCRect *v21; // rax
struct cocos2d::CCSprite *v22; // r15
__int64 v23; // rdx
float v24; // xmm0_4
__int64 v25; // rax
struct cocos2d::CCSprite *v26; // rdi
float v27; // xmm0_4
cocos2d::CCSprite_vtbl *v28; // rbx
const cocos2d::CCPoint *v29; // rax
cocos2d::CCSprite_vtbl *v30; // rbx
__int64 v31; // rax
float v32; // xmm1_4
float v33; // xmm3_4
cocos2d::CCSprite_vtbl *v34; // rbx
const cocos2d::CCRect *v35; // rax
cocos2d::CCString *v36; // rax
const char *CString; // rax
size_t v38; // rbx
size_t v39; // r8
GameManager *v40; // rcx
GJGameLevel *m_level; // rcx
int v42; // edx
cocos2d::CCString *v43; // rax
char *v44; // rax
const char *p_Src; // rcx
struct cocos2d::CCLabelBMFont *v46; // rdi
cocos2d::CCLabelBMFont_vtbl *v47; // rbx
__int64 v48; // rax
cocos2d::CCString *v49; // rax
const char *v50; // rax
struct cocos2d::CCLabelBMFont *v51; // rdi
cocos2d::CCLabelBMFont_vtbl *v52; // rbx
__int64 v53; // rax
struct cocos2d::CCLabelBMFont *v54; // rdi
float v55; // xmm0_4
__int64 v56; // rax
struct cocos2d::CCLabelBMFont *v57; // rdi
float v58; // xmm0_4
__int64 v59; // rax
__int16 v60; // [rsp+38h] [rbp-39h] BYREF
char v61; // [rsp+3Ah] [rbp-37h]
__int16 v62; // [rsp+3Ch] [rbp-35h] BYREF
char v63; // [rsp+3Eh] [rbp-33h]
cocos2d::CCPoint v64; // [rsp+40h] [rbp-31h] BYREF
cocos2d::CCRect v65; // [rsp+48h] [rbp-29h] BYREF
float v66; // [rsp+58h] [rbp-19h]
__int128 Src; // [rsp+60h] [rbp-11h] BYREF
__int64 v68; // [rsp+70h] [rbp-1h]
unsigned __int64 v69; // [rsp+78h] [rbp+7h]
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2);
v62 = 0;
v63 = 0;
v3 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
v3->setColor(&v3->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v62);
LOBYTE(v4) = 125;
v3->setOpacity(&v3->cocos2d::CCRGBAProtocol, v4);
((void (__fastcall *)(struct cocos2d::CCSprite *))v3->setScale_0)(v3);
a1->addChild_0(a1, v3, 3);
v5 = v3->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
v8 = cocos2d::CCDirector::getScreenBottom(v7) + 136.0;
cocos2d::CCPoint::CCPoint(v8, v66 * 0.5);
v5->setPosition_0(v3, v9);
v10 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScaleX)(v10);
((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScaleY)(v10);
v10->setColor(&v10->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&unk_140529B3C);
v11 = v10->m_obRect.size.width - (float)(v10->m_obRect.size.width * 0.99199998);
v12 = ((float (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))v3->addChild_0)(
v3,
v10,
1);
v13 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = cocos2d::CCPoint::CCPoint(v12, 0.0);
v13->setAnchorPoint(v10, v15);
v16 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v3->getContentSize(v3);
cocos2d::CCPoint::CCPoint(*(float *)&v14, v11 * 0.5);
v16->setPosition_0(v10, v17);
v18 = (float)(a1->m_level->m_normalPercent.random - a1->m_level->m_normalPercent.seed) / 100.0;
width = v10->m_obRect.size.width;
if ( (float)(width * v18) <= width )
width = width * v18;
v20 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCRect::CCRect(&v65, 0.0, 0.0, width, v10->m_obRect.size.height);
v20->setTextureRect_0(v10, v21);
v22 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
v22->setColor(&v22->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v62);
LOBYTE(v23) = 125;
v22->setOpacity(&v22->cocos2d::CCRGBAProtocol, v23);
((void (__fastcall *)(struct cocos2d::CCSprite *))v22->setScale_0)(v22);
v24 = ((float (__fastcall *)(LevelInfoLayer *, struct cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v22, 3);
cocos2d::CCPoint::CCPoint(v24, 0.0);
v25 = (__int64)v3->getPosition_0(v3);
cocos2d::CCPoint::operator+(v25, &v64);
v22->setPosition_0(v22, &v64);
v26 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleX)(v26);
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleY)(v26);
v60 = -256;
v61 = -1;
v26->setColor(&v26->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v60);
v27 = ((float (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))v22->addChild_0)(
v22,
v26,
1);
v28 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v27, 0.0);
v28->setAnchorPoint(v26, v29);
v30 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v31 = (__int64)v10->getPosition_0(v10);
v30->setPosition_0(v26, (const cocos2d::CCPoint *)v31);
v32 = (float)a1->m_level->m_practicePercent / 100.0;
v33 = v26->m_obRect.size.width;
if ( (float)(v33 * v32) <= v33 )
v33 = v32 * v33;
v34 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCRect::CCRect(&v65, 0.0, 0.0, v33, v26->m_obRect.size.height);
v34->setTextureRect_0(v26, v35);
v36 = cocos2d::CCString::createWithFormat(
"%i%%",
a1->m_level->m_normalPercent.random - a1->m_level->m_normalPercent.seed);
CString = cocos2d::CCString::getCString(v36);
Src = 0;
v68 = 0;
v69 = 0;
v38 = -1;
v39 = -1;
do
++v39;
while ( CString[v39] );
sub_14003A930(&Src, CString, v39);
v40 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v65.origin = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v65.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v40 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v40, "0099") )
{
m_level = a1->m_level;
v42 = m_level->m_newNormalPercent2.random - m_level->m_newNormalPercent2.seed;
if ( m_level->m_normalPercent.random - m_level->m_normalPercent.seed != v42 )
{
v43 = cocos2d::CCString::createWithFormat(" (%i%%)", v42);
v44 = (char *)cocos2d::CCString::getCString(v43);
do
++v38;
while ( v44[v38] );
sub_140041270(&Src, v44, v38);
}
}
p_Src = (const char *)&Src;
if ( v69 > 0xF )
p_Src = (const char *)Src;
v46 = cocos2d::CCLabelBMFont::create(p_Src, (const char *)&qword_14052A4D8);
a1->addChild_0(a1, v46, 4);
v47 = v46->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v48 = (__int64)v3->getPosition_0(v3);
v47->setPosition_0(v46, (const cocos2d::CCPoint *)v48);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v46->setScale_0)(v46);
v49 = cocos2d::CCString::createWithFormat("%i%%", a1->m_level->m_practicePercent);
v50 = cocos2d::CCString::getCString(v49);
v51 = cocos2d::CCLabelBMFont::create(v50, (const char *)&qword_14052A4D8);
a1->addChild_0(a1, v51, 4);
v52 = v51->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v53 = (__int64)v22->getPosition_0(v22);
v52->setPosition_0(v51, (const cocos2d::CCPoint *)v53);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v51->setScale_0)(v51);
v54 = cocos2d::CCLabelBMFont::create("Normal Mode", (const char *)&qword_14052A4D8);
v55 = ((float (__fastcall *)(LevelInfoLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v54, 4);
cocos2d::CCPoint::CCPoint(v55, 0.0);
v56 = (__int64)v3->getPosition_0(v3);
cocos2d::CCPoint::operator+(v56, &v64);
v54->setPosition_0(v54, &v64);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v54->setScale_0)(v54);
v57 = cocos2d::CCLabelBMFont::create("Practice Mode", (const char *)&qword_14052A4D8);
v58 = ((float (__fastcall *)(LevelInfoLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v57, 4);
cocos2d::CCPoint::CCPoint(v58, 0.0);
v59 = (__int64)v22->getPosition_0(v22);
cocos2d::CCPoint::operator+(v59, &v64);
v57->setPosition_0(v57, &v64);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v57->setScale_0)(v57);
sub_14003A830((__int64)&Src);
}