Redo Savestate context menu item implemented
This commit is contained in:
parent
04d41975d0
commit
bfd3956796
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue