better handling of tastudio interaction with select slot, previous slot, and next slot functions

This commit is contained in:
adelikat 2019-12-08 13:01:55 -06:00
parent a6eee3681f
commit 6ae1eac464
4 changed files with 42 additions and 29 deletions

View File

@ -10,9 +10,15 @@
void LoadStateAs(); void LoadStateAs();
void SaveQuickSave(int slot); void SaveQuickSave(int slot);
void LoadQuickSave(int slot); void LoadQuickSave(int slot);
void SelectSlot(int slot);
void PreviousSlot(); /// <summary>
void NextSlot(); /// Overrides the select slot method
/// </summary>
/// <returns>Returns whether the function is handled.
/// If false, the mainform should continue with its logic</returns>
bool SelectSlot(int slot);
bool PreviousSlot();
bool NextSlot();
bool WantsToControlReadOnly { get; } bool WantsToControlReadOnly { get; }
@ -31,7 +37,7 @@
/// Should not be called directly. /// Should not be called directly.
/// <remarks>Like MainForm's StopMovie(), saving the movie is part of this function's responsibility.</remarks> /// <remarks>Like MainForm's StopMovie(), saving the movie is part of this function's responsibility.</remarks>
/// </summary> /// </summary>
void StopMovie(bool supressSave); void StopMovie(bool suppressSave);
bool WantsToControlRewind { get; } bool WantsToControlRewind { get; }

View File

@ -4293,8 +4293,11 @@ namespace BizHawk.Client.EmuHawk
{ {
if (IsSavestateSlave) if (IsSavestateSlave)
{ {
Master.SelectSlot(slot); var handled = Master.SelectSlot(slot);
return; if (handled)
{
return;
}
} }
Global.Config.SaveSlot = slot; Global.Config.SaveSlot = slot;
@ -4309,8 +4312,11 @@ namespace BizHawk.Client.EmuHawk
{ {
if (IsSavestateSlave) if (IsSavestateSlave)
{ {
Master.PreviousSlot(); var handled = Master.PreviousSlot();
return; if (handled)
{
return;
}
} }
if (Global.Config.SaveSlot == 0) if (Global.Config.SaveSlot == 0)
@ -4337,8 +4343,11 @@ namespace BizHawk.Client.EmuHawk
{ {
if (IsSavestateSlave) if (IsSavestateSlave)
{ {
Master.NextSlot(); var handled = Master.NextSlot();
return; if (handled)
{
return;
}
} }
if (Global.Config.SaveSlot >= 9) if (Global.Config.SaveSlot >= 9)

View File

@ -1,13 +1,8 @@
using System; namespace BizHawk.Client.EmuHawk
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Client.EmuHawk
{ {
public partial class GenericDebugger : IControlMainform public partial class GenericDebugger : IControlMainform
{ {
public bool WantsToControlSavestates { get { return false; } } public bool WantsToControlSavestates => false;
public void SaveState() { } public void SaveState() { }
public void LoadState() { } public void LoadState() { }
@ -15,22 +10,22 @@ namespace BizHawk.Client.EmuHawk
public void LoadStateAs() { } public void LoadStateAs() { }
public void SaveQuickSave(int slot) { } public void SaveQuickSave(int slot) { }
public void LoadQuickSave(int slot) { } public void LoadQuickSave(int slot) { }
public void SelectSlot(int slot) { } public bool SelectSlot(int slot) => false;
public void PreviousSlot() { } public bool PreviousSlot() => false;
public void NextSlot() { } public bool NextSlot() => false;
public bool WantsToControlReadOnly { get { return false; } } public bool WantsToControlReadOnly => false;
public void ToggleReadOnly() { } public void ToggleReadOnly() { }
public bool WantsToControlStopMovie { get { return false; } } public bool WantsToControlStopMovie => false;
public void StopMovie(bool supressSave) { } public void StopMovie(bool suppressSave) { }
// TODO: We probably want to do this // TODO: We probably want to do this
public bool WantsToControlRewind { get { return false; } } public bool WantsToControlRewind => false;
public void CaptureRewind() { } public void CaptureRewind() { }
public bool Rewind() { return false; } public bool Rewind() => false;
public bool WantsToControlRestartMovie { get { return false; } } public bool WantsToControlRestartMovie => false;
public void RestartMovie() { } public void RestartMovie() { }
// TODO: We want to prevent movies and probably other things // TODO: We want to prevent movies and probably other things

View File

@ -38,19 +38,22 @@
BookMarkControl.LoadBranchExternal(slot); BookMarkControl.LoadBranchExternal(slot);
} }
public void SelectSlot(int slot) public bool SelectSlot(int slot)
{ {
BookMarkControl.SelectBranchExternal(slot); BookMarkControl.SelectBranchExternal(slot);
return false;
} }
public void PreviousSlot() public bool PreviousSlot()
{ {
BookMarkControl.SelectBranchExternal(false); BookMarkControl.SelectBranchExternal(false);
return false;
} }
public void NextSlot() public bool NextSlot()
{ {
BookMarkControl.SelectBranchExternal(true); BookMarkControl.SelectBranchExternal(true);
return false;
} }
public bool WantsToControlReadOnly => true; public bool WantsToControlReadOnly => true;