//
// AccountLayer::onBackup from 0x4663e8 to 0x4664f6 (270 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 AccountLayer::onBackup(AccountLayer *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // r0
cocos2d::CCString *v4; // r0
char *v5; // r0
FLAlertLayer *v6; // r0
GameLevelManager *v7; // r0
const char *TimeLeft; // r0
cocos2d::CCString *v9; // r0
char *CString; // r0
FLAlertLayer *v11; // r5
_BYTE v12[4]; // [sp+10h] [bp+4h] BYREF
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "6") > 9 )
{
v7 = GameLevelManager::sharedState();
TimeLeft = (const char *)GameLevelManager::getTimeLeft(v7, "bak_account", 30.0);
if ( (unsigned int)(TimeLeft - 1) > 0x1D )
{
sub_776584(
(int)v12,
"Do you want to save your account data on the cloud?\n"
"This will overwrite previously saved data.");
v11 = FLAlertLayer::create(
(int)&a1->FLAlertLayerProtocol,
(int)"Save Data",
(int)v12,
(int)"Cancel",
(int)"Save",
300.0);
sub_774008(v12);
ButtonSprite::updateBGImage(v11->m_button1, "GJ_button_06.png");
v11->setTag(v11, 1);
goto LABEL_7;
}
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Please wait %i seconds before attempting to back up your account again.",
TimeLeft);
CString = (char *)cocos2d::CCString::getCString(v9);
sub_776584((int)v12, CString);
v6 = FLAlertLayer::create(0, (int)"Too Fast", (int)v12, (int)"OK", 0, 300.0);
}
else
{
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need to collect atleast %i stars to enable saving.",
&byte_9[1]);
v5 = (char *)cocos2d::CCString::getCString(v4);
sub_776584((int)v12, v5);
v6 = FLAlertLayer::create(0, (int)"Collect more", (int)v12, (int)"OK", 0, 300.0);
}
v11 = v6;
sub_774008(v12);
LABEL_7:
v11->show(v11);
}