gui: Don't check if the backup menu option should be enabled every UI event

This commit is contained in:
Tyler Wilding 2020-07-17 21:48:37 -04:00 committed by refractionpcsx2
parent 717677402c
commit b7d01b4889
1 changed files with 10 additions and 2 deletions

View File

@ -51,11 +51,16 @@ static void _SaveLoadStuff(bool enabled)
sMainFrame.EnableMenuItem(MenuId_Sys_SaveStates, enabled);
#ifdef USE_NEW_SAVESLOTS_UI
bool crcChanged = false;
// Run though all the slots. Update if they need updating or the crc changed.
for (Saveslot &slot : saveslot_cache)
{
// We need to reload the file information if the crc or serial # changed.
if ((slot.crc != ElfCRC)|| (slot.serialName != DiscSerial)) slot.invalid_cache = true;
if ((slot.crc != ElfCRC)|| (slot.serialName != DiscSerial))
{
slot.invalid_cache = true;
crcChanged = true;
}
// Either the cache needs updating, or the menu items do, or both.
if (slot.menu_update || slot.invalid_cache)
@ -85,7 +90,10 @@ static void _SaveLoadStuff(bool enabled)
sMainFrame.SetMenuItemLabel(slot.save_item_id, slot.SlotName());
}
}
States_updateLoadBackupMenuItem();
if (crcChanged)
{
States_updateLoadBackupMenuItem();
}
#endif
}