//
// AccountLayer::onBackup from 0x100165db0 to 0x100165f50 (416 bytes)
//
// 1 xrefs:
// > AccountLayer::customSetup @ 0x1001658fc
//
// 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 AccountLayer::onBackup(AccountLayer *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // x0
cocos2d::CCString *v4; // x0
char *v5; // x0
ButtonSprite **v6; // x19
void *v7; // x0
GameLevelManager *v8; // x0
int TimeLeft; // w0
cocos2d::CCString *v10; // x0
char *CString; // x0
void *v12[2]; // [xsp+8h] [xbp-58h] BYREF
char v13; // [xsp+1Fh] [xbp-41h]
void *__p[2]; // [xsp+20h] [xbp-40h] BYREF
char v15; // [xsp+37h] [xbp-29h]
_QWORD v16[2]; // [xsp+38h] [xbp-28h] BYREF
char v17; // [xsp+4Fh] [xbp-11h]
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::getStat(v3, "6") > 9 )
{
v8 = GameLevelManager::sharedState();
TimeLeft = GameLevelManager::getTimeLeft(v8, "bak_account", 30.0);
if ( (unsigned int)(TimeLeft - 1) > 0x1D )
{
sub_100009900(
v12,
"Do you want to save your account data on the cloud?\n"
"This will overwrite previously saved data.");
v6 = (ButtonSprite **)FLAlertLayer::create_1(&a1->FLAlertLayerProtocol, "Save Data", v12, "Cancel", "Save", 300.0);
if ( v13 < 0 )
operator delete(v12[0]);
ButtonSprite::updateBGImage(v6[74], "GJ_button_06.png");
(*(void (__fastcall **)(ButtonSprite **, __int64))&(*v6)->m_fVertexZ)(v6, 1);
}
else
{
v10 = (cocos2d::CCString *)sub_100268F4C(
"Please wait %i seconds before attempting to back up your account again.",
TimeLeft);
CString = (char *)cocos2d::CCString::getCString(v10);
sub_100009900(__p, CString);
v6 = (ButtonSprite **)FLAlertLayer::create_1(0, "Too Fast", __p, "OK", 0, 300.0);
if ( v15 < 0 )
{
v7 = __p[0];
goto LABEL_7;
}
}
}
else
{
v4 = (cocos2d::CCString *)sub_100268F4C(
"You need to collect atleast %i stars to enable saving.",
10);
v5 = (char *)cocos2d::CCString::getCString(v4);
sub_100009900(v16, v5);
v6 = (ButtonSprite **)FLAlertLayer::create_1(0, "Collect more", v16, "OK", 0, 300.0);
if ( v17 < 0 )
{
v7 = (void *)v16[0];
LABEL_7:
operator delete(v7);
}
}
(*(void (__fastcall **)(ButtonSprite **))&(*v6)[1].m_fTextureTop)(v6);
}