diff --git a/BizHawk.MultiClient/MainForm.MenuItems.cs b/BizHawk.MultiClient/MainForm.MenuItems.cs index 736dfd63eb..bbfc54d13d 100644 --- a/BizHawk.MultiClient/MainForm.MenuItems.cs +++ b/BizHawk.MultiClient/MainForm.MenuItems.cs @@ -877,9 +877,18 @@ namespace BizHawk.MultiClient var file = new FileInfo(path); if (file.Exists == true) { - contextMenuStrip1.Items[13].Enabled = true; - contextMenuStrip1.Items[13].Text = "Undo Save to slot " + SaveSlot.ToString(); - contextMenuStrip1.Items[13].Image = BizHawk.MultiClient.Properties.Resources.undo; + if (StateSlots.IsRedo(SaveSlot)) + { + contextMenuStrip1.Items[13].Enabled = true; + contextMenuStrip1.Items[13].Text = "Redo Save to slot " + SaveSlot.ToString(); + contextMenuStrip1.Items[13].Image = BizHawk.MultiClient.Properties.Resources.redo; + } + else + { + contextMenuStrip1.Items[13].Enabled = true; + contextMenuStrip1.Items[13].Text = "Undo Save to slot " + SaveSlot.ToString(); + contextMenuStrip1.Items[13].Image = BizHawk.MultiClient.Properties.Resources.undo; + } } else { @@ -887,8 +896,6 @@ namespace BizHawk.MultiClient contextMenuStrip1.Items[13].Text = "Undo Savestate"; contextMenuStrip1.Items[13].Image = BizHawk.MultiClient.Properties.Resources.undo; } - - //contextMenuStrip1.Items[13].Enabled = false; } diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 0b6b1326ce..56d4a98560 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -962,7 +962,7 @@ namespace BizHawk.MultiClient Cheats1.Restart(); CurrentlyOpenRom = file.CanonicalFullPath; HandlePlatformMenus(); - UpdateStatusSlots(); + StateSlots.Clear(); UpdateDumpIcon(); return true; } @@ -1954,7 +1954,7 @@ namespace BizHawk.MultiClient Cheats1.Restart(); Text = "BizHawk"; HandlePlatformMenus(); - UpdateStatusSlots(); + StateSlots.Clear(); UpdateDumpIcon(); } @@ -2196,6 +2196,8 @@ namespace BizHawk.MultiClient state.Delete(); temp.CopyTo(path); temp.Delete(); + + StateSlots.ToggleRedo(SaveSlot); } } } \ No newline at end of file diff --git a/BizHawk.MultiClient/SavestateManager.cs b/BizHawk.MultiClient/SavestateManager.cs index 00c7dcd0f1..36f8155a0c 100644 --- a/BizHawk.MultiClient/SavestateManager.cs +++ b/BizHawk.MultiClient/SavestateManager.cs @@ -9,6 +9,7 @@ namespace BizHawk.MultiClient class SavestateManager { private bool[] slots = new bool[10]; + private bool[] redo = new bool[10]; public SavestateManager() { @@ -51,5 +52,35 @@ namespace BizHawk.MultiClient Update(); return slots[slot]; } + + public void ClearRedoList() + { + for (int x = 0; x < 10; x++) + { + redo[x] = false; + } + } + + public void ToggleRedo(int slot) + { + if (slot < 0 || slot > 9) + return; + + redo[slot] ^= true; + } + + public bool IsRedo(int slot) + { + if (slot < 0 || slot > 9) + return false; + + return redo[slot]; + } + + public void Clear() + { + ClearRedoList(); + Update(); + } } }