mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Add option to delete all custom level save data
To match the option to nuke all main game save data, there is also now an option to nuke all custom level save data separately (which is just all custom level quicksaves, along with stars for level completion). It has its own confirmation menu too. It does not delete any levels from the levels folder.
This commit is contained in:
@@ -1185,3 +1185,33 @@ bool FILESYSTEM_delete(const char *name)
|
||||
{
|
||||
return PHYSFS_delete(name) != 0;
|
||||
}
|
||||
|
||||
static void levelSaveCallback(const char* filename)
|
||||
{
|
||||
if (endsWith(filename, ".vvvvvv.vvv"))
|
||||
{
|
||||
if (!FILESYSTEM_delete(filename))
|
||||
{
|
||||
printf("Error deleting %s\n", filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FILESYSTEM_deleteLevelSaves(void)
|
||||
{
|
||||
int success;
|
||||
|
||||
success = PHYSFS_enumerate(
|
||||
"saves",
|
||||
enumerateCallback,
|
||||
(void*) levelSaveCallback
|
||||
);
|
||||
|
||||
if (success == 0)
|
||||
{
|
||||
printf(
|
||||
"Could not enumerate saves/: %s\n",
|
||||
PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user