//
// PlayLayer::toggleProgressbar from 0x312868 to 0x31298c (292 bytes)
//
// 0 xrefs:
//
// 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 PlayLayer::toggleProgressbar(PlayLayer *a1)
{
_BOOL4 m_showProgressBar; // r5
GameManager *v3; // r0
float v4; // s16
_BOOL4 GameVariable; // r8
GameManager *v6; // r0
_BOOL4 v7; // r0
cocos2d::CCDirector *v8; // r0
cocos2d::CCLabelBMFont *m_percentageLabel; // r10
float v10; // s16
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v12; // r0
cocos2d::CCLabelBMFont *v13; // r9
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r10
float v15; // r1
cocos2d::CCSize v16; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v17; // [sp+Ch] [bp-10h] BYREF
m_showProgressBar = GameManager::sharedState()->m_showProgressBar;
if ( a1->m_isPlatformer )
{
v3 = GameManager::sharedState();
v4 = 0.0;
m_showProgressBar = 0;
GameVariable = GameManager::getGameVariable(v3, "0145");
}
else
{
v6 = GameManager::sharedState();
v4 = 110.0;
v7 = GameManager::getGameVariable(v6, "0040");
if ( !m_showProgressBar )
v4 = 0.0;
GameVariable = v7;
}
a1->m_progressBar->setVisible(a1->m_progressBar, m_showProgressBar);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v16, v8);
a1->m_percentageLabel->setVisible(a1->m_percentageLabel, GameVariable);
m_percentageLabel = a1->m_percentageLabel;
v10 = v4 + (float)(v16.width * 0.5);
setPosition = m_percentageLabel->setPosition;
v12 = (int)m_percentageLabel->getPosition(m_percentageLabel);
cocos2d::CCPoint::CCPoint(&v17, v10, *(float *)(v12 + 4));
setPosition(m_percentageLabel, &v17);
v13 = a1->m_percentageLabel;
setAnchorPoint = v13->setAnchorPoint;
if ( m_showProgressBar )
{
v15 = 0.0;
}
else if ( a1->m_isPlatformer )
{
v15 = 0.0;
}
else
{
v15 = 0.5;
}
cocos2d::CCPoint::CCPoint(&v17, v15, 0.5);
setAnchorPoint(v13, &v17);
PlayLayer::updateProgressbar(a1);
if ( a1->m_isPlatformer && GameVariable )
GJBaseGameLayer::updatePlatformerTime(a1);
}