//
// GameToolbox::getTimeString from 0x2ecfa0 to 0x2ed0ba (282 bytes)
//
// 6 xrefs:
// > LevelInfoLayer::updateLabelValues @ 0x3b2cc8
// > GameLevelManager::onUploadCommentCompleted @ 0x3c22aa
// > ChallengesPage::updateTimers @ 0x4ccee0
// > DailyLevelPage::getDailyTimeString @ 0x4d40fa
// > RewardsPage::updateTimers @ 0x4e6e2e
// > RewardsPage::updateTimers @ 0x4e6e60
//
// 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
//
GameToolbox *__fastcall GameToolbox::getTimeString(GameToolbox *this, int a2, int a3)
{
float v5; // s17
float v6; // s17
const char *v7; // r8
float v8; // s16
float v9; // r0
const char *v10; // r3
cocos2d::CCString *v11; // r0
char *CString; // r0
char *v14; // [sp+4h] [bp-Ch]
v5 = (float)a2;
v14 = (char *)(int)floorf((float)a2 / 86400.0);
v6 = v5 - (float)((float)(int)v14 * 86400.0);
v7 = (const char *)(int)floorf(v6 / 3600.0);
v8 = v6 - (float)(3600 * (int)v7);
v9 = floorf(v8 / 60.0);
v10 = (const char *)(int)v9;
if ( (int)&v7[(int)v14 + (int)v9] > 0 )
{
if ( (int)&v7[(int)v14] > 0 )
{
if ( (int)v14 > 0 )
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%idays %ih", v14, v7);
else
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%ih %imin", v7, v10);
}
else if ( a3 )
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%imin", v10);
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%imin %02dsec",
v10,
(int)(float)(v8 - (float)(60 * (int)v9)));
}
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%isec",
(const char *)(int)(float)(v8 - (float)(60 * (int)v9)));
}
CString = (char *)cocos2d::CCString::getCString(v11);
sub_776584((int)this, CString);
return this;
}