mirror of https://github.com/PCSX2/pcsx2.git
gui: Visually indicate the current savestate slot in the load/save menu
This commit is contained in:
parent
9a435c1a7e
commit
0dffc13e49
|
@ -43,7 +43,8 @@ wxMenu* MainEmuFrame::MakeStatesSubMenu(int baseid, int loadBackupId) const
|
|||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
// Will be changed once an iso is loaded.
|
||||
mnuSubstates->Append(baseid + i + 1, wxsFormat(_("Slot %d"), i));
|
||||
wxMenuItem* m = mnuSubstates->Append(baseid + i + 1, wxsFormat(_("Slot %d"), i), wxEmptyString, wxITEM_CHECK);
|
||||
m->Check(i == 0); // 0 is the default selected slot
|
||||
}
|
||||
|
||||
if (loadBackupId >= 0)
|
||||
|
|
|
@ -139,20 +139,23 @@ int States_GetCurrentSlot()
|
|||
return StatesC;
|
||||
}
|
||||
|
||||
void States_SetCurrentSlot(int slot)
|
||||
void States_SetCurrentSlot(int slot_num)
|
||||
{
|
||||
StatesC = std::min(std::max(slot, 0), StateSlotsCount);
|
||||
StatesC = std::min(std::max(slot_num, 0), StateSlotsCount);
|
||||
for (Saveslot& slot : saveslot_cache)
|
||||
{
|
||||
sMainFrame.CheckMenuItem(slot.load_item_id, slot.slot_num == slot_num);
|
||||
sMainFrame.CheckMenuItem(slot.save_item_id, slot.slot_num == slot_num);
|
||||
}
|
||||
OnSlotChanged();
|
||||
}
|
||||
|
||||
void States_CycleSlotForward()
|
||||
{
|
||||
StatesC = (StatesC + 1) % StateSlotsCount;
|
||||
OnSlotChanged();
|
||||
States_SetCurrentSlot((StatesC + 1) % StateSlotsCount);
|
||||
}
|
||||
|
||||
void States_CycleSlotBackward()
|
||||
{
|
||||
StatesC = (StatesC + StateSlotsCount - 1) % StateSlotsCount;
|
||||
OnSlotChanged();
|
||||
States_SetCurrentSlot((StatesC + StateSlotsCount - 1) % StateSlotsCount);
|
||||
}
|
||||
|
|
|
@ -132,6 +132,6 @@ extern void States_DefrostCurrentSlot();
|
|||
extern void States_FreezeCurrentSlot();
|
||||
extern void States_CycleSlotForward();
|
||||
extern void States_CycleSlotBackward();
|
||||
extern void States_SetCurrentSlot(int slot);
|
||||
extern void States_SetCurrentSlot(int slot_num);
|
||||
extern int States_GetCurrentSlot();
|
||||
extern void States_updateLoadBackupMenuItem();
|
|
@ -86,6 +86,7 @@ static void _SaveLoadStuff(bool enabled)
|
|||
slot.crc = ElfCRC;
|
||||
|
||||
sMainFrame.EnableMenuItem(slot.load_item_id, !slot.empty);
|
||||
sMainFrame.CheckMenuItem(slot.load_item_id, slot.slot_num == States_GetCurrentSlot());
|
||||
sMainFrame.SetMenuItemLabel(slot.load_item_id, slot.SlotName());
|
||||
sMainFrame.SetMenuItemLabel(slot.save_item_id, slot.SlotName());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue