//
// PlayLayer::updateAttempts from 0x3130cc to 0x313222 (342 bytes)
//
// 1 xrefs:
// > PlayLayer::resetLevel @ 0x31fd2e
//
// 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::updateAttempts(PlayLayer *a1)
{
bool *p_m_isPracticeMode; // r7
GameManager *v3; // r5
GameManager *v4; // r5
GameManager *v5; // r5
cocos2d::CCString *v6; // r0
const unsigned __int8 *CString; // r0
cocos2d::CCDirector *v8; // r0
cocos2d::CCLabelBMFont *m_attemptLabel; // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
GameManager *v11; // r0
GameManager *v12; // r0
void (*setVisible)(void); // r3
cocos2d::CCSize v14; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v15; // [sp+Ch] [bp-10h] BYREF
p_m_isPracticeMode = &a1->m_isPracticeMode;
++a1->m_attempts;
v3 = GameManager::sharedState();
v3->m_sessionAttempts = GameManager::sharedState()->m_sessionAttempts + 1;
v4 = GameManager::sharedState();
v4->m_sessionAttempts2 = GameManager::sharedState()->m_sessionAttempts2 + 1;
if ( !*p_m_isPracticeMode )
{
v5 = GameManager::sharedState();
v5->m_sessionNormalAttempts = GameManager::sharedState()->m_sessionNormalAttempts + 1;
}
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Attempt %i",
(const char *)a1->m_attempts);
CString = (const unsigned __int8 *)cocos2d::CCString::getCString(v6);
a1->m_attemptLabel->setString(a1->m_attemptLabel, CString);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v14, v8);
if ( a1->m_attempts != 1 || a1->m_isPlatformer )
{
m_attemptLabel = a1->m_attemptLabel;
setPosition = m_attemptLabel->setPosition;
cocos2d::CCPoint::CCPoint(
&v15,
(float)(a1->m_gameState.m_cameraPosition.x + (float)(v14.width * 0.5)) + 50.0,
(float)(a1->m_gameState.m_cameraPosition.y + (float)(v14.height * 0.5)) + 85.0);
setPosition(m_attemptLabel, &v15);
}
if ( a1->m_unk36cf
|| *p_m_isPracticeMode && (v12 = GameManager::sharedState(), GameManager::getGameVariable(v12, "0134"))
|| (v11 = GameManager::sharedState(), GameManager::getGameVariable(v11, "0135")) )
{
setVisible = (void (*)(void))a1->m_attemptLabel->setVisible;
}
else
{
if ( a1->m_attempts <= 0 )
return;
setVisible = (void (*)(void))a1->m_attemptLabel->setVisible;
}
setVisible();
}