//
// ChallengesPage::updateTimers from 0x10003231c to 0x1000324d4 (440 bytes)
//
// 5 xrefs:
// > ChallengesPage::challengeStatusFinished @ 0x100032768
// > ChallengesPage::challengeStatusFinished @ 0x10003280c
// > ChallengesPage::claimItem @ 0x100032d94
// > ChallengesPage::init @ 0x100031f1c
// > ChallengesPage::challengeStatusFinished @ 0x100032810
//
// 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 __fastcall ChallengesPage::updateTimers(ChallengesPage *a1, float a2)
{
GameStatsManager *v3; // x0
double v4; // d8
int v5; // w21
cocos2d::CCLabelBMFont *m_countdownLabel; // x20
const char *time; // x8
cocos2d::CCString *v8; // x0
const char *CString; // x0
cocos2d::CCDictionary *m_challengeNodes; // x8
cocos2d::CCDictElement *m_pElements; // x20
cocos2d::CCObject *m_pObject; // x23
__int64 v13; // x0
void **v14; // x1
GameStatsManager *v15; // x0
void *__p[2]; // [xsp+10h] [xbp-70h] BYREF
__int64 v17; // [xsp+20h] [xbp-60h]
timeb v18; // [xsp+28h] [xbp-58h] BYREF
__int64 v19; // [xsp+38h] [xbp-48h]
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::areChallengesLoaded(v3) )
{
ftime(&v18);
v4 = (double)(v18.millitm + 1000 * (unsigned __int64)(v18.time & 0xFFFFF)) / -1000.0;
v5 = (int)(GameStatsManager::sharedState()->m_challengeTime + v4);
GameToolbox::getTimeString(&v18, v5 & (unsigned int)~(v5 >> 31), 0);
m_countdownLabel = a1->m_countdownLabel;
if ( v19 >= 0 )
time = (const char *)&v18;
else
time = (const char *)v18.time;
v8 = (cocos2d::CCString *)sub_100268F4C("New quests in: %s", time);
CString = cocos2d::CCString::getCString(v8);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_countdownLabel->setString)(
m_countdownLabel,
CString);
m_challengeNodes = a1->m_challengeNodes;
if ( m_challengeNodes )
{
m_pElements = m_challengeNodes->m_pElements;
while ( m_pElements )
{
while ( 1 )
{
m_pObject = m_pElements->m_pObject;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( SHIBYTE(v19) < 0 )
{
sub_1000097D0(__p, (void *)v18.time, *(unsigned __int64 *)&v18.millitm);
}
else
{
*(timeb *)__p = v18;
v17 = v19;
}
v13 = *(_QWORD *)&m_pObject[6].m_uID;
if ( v13 )
{
if ( v17 >= 0 )
v14 = __p;
else
v14 = (void **)__p[0];
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v13 + 912LL))(v13, v14);
}
if ( SHIBYTE(v17) < 0 )
break;
if ( !m_pElements )
goto LABEL_19;
}
operator delete(__p[0]);
}
}
LABEL_19:
if ( v5 <= 0 && !a1->m_unkBool )
{
((void (__fastcall *)(LoadingCircle *, __int64))a1->m_circle->setVisible)(a1->m_circle, 1);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_countdownLabel->setVisible)(a1->m_countdownLabel, 0);
*(_WORD *)&a1->m_triedToLoad = 256;
v15 = GameStatsManager::sharedState();
GameStatsManager::resetChallengeTimer(v15);
ChallengesPage::tryGetChallenges(a1);
}
if ( SHIBYTE(v19) < 0 )
operator delete((void *)v18.time);
}
}