made a function to delete game statistics & favorite choice.

Removed game settings and game statistics when a game is deleted from the drive.
This commit is contained in:
giantpune 2009-06-17 06:07:43 +00:00
parent bf12b2f997
commit db9df14d66
3 changed files with 21 additions and 3 deletions

View File

@ -1995,8 +1995,11 @@ int GameSettings(struct discHdr * header)
LANGUAGE.Yes,LANGUAGE.Cancel,0,0);
if (choice == 1)
{
ret = WBFS_RemoveGame(header->id);
{
CFG_forget_game_opt(header->id);
CFG_forget_game_num(header->id);
/*ret = WBFS_RemoveGame(header->id);
if (ret < 0)
{
WindowPrompt(
@ -2011,7 +2014,7 @@ int GameSettings(struct discHdr * header)
gameName,
LANGUAGE.ok,0,0,0);
retVal = 1;
}
}*/
break;
}
else if (choice == 0)

View File

@ -1570,6 +1570,20 @@ bool CFG_forget_game_opt(u8 *id)
return cfg_save_games();
}
bool CFG_forget_game_num(u8 *id)
{
struct Game_NUM *game = CFG_get_game_num(id);
int i;
if (!game) return true;
// move entries down
num_saved_game_num--;
for (i=game-cfg_game_num; i<num_saved_game_num; i++) {
cfg_game[i] = cfg_game[i+1];
}
memset(&cfg_game[num_saved_game_num], 0, sizeof(struct Game_NUM));
return cfg_save_game_num();
}
void CFG_LoadXml(bool openfile, bool loadtitles, bool freemem)
{
/* load renamed titles from proper names and game info XML, needs to be after cfg_load_games - Lustar */

View File

@ -197,6 +197,7 @@ struct Game_NUM* CFG_get_game_num(u8 *id);
bool CFG_save_game_opt(u8 *id);
bool CFG_save_game_num(u8 *id);
bool CFG_forget_game_opt(u8 *id);
bool CFG_forget_game_num(u8 *id);
//Astidof - Begin of modification
enum {