preparations for state hotkeys functioning with tastudio branches.

typos.
This commit is contained in:
feos 2015-12-05 12:09:39 +03:00
parent 7fe4f4e1de
commit 6d4c5ef17f
5 changed files with 74 additions and 4 deletions

View File

@ -207,6 +207,7 @@ namespace BizHawk.Client.Common
new Binding { DisplayName = "ToolBox", Bindings = "Shift+T", TabGroup = "Tools", DefaultBinding = "" },
new Binding { DisplayName = "Virtual Pad", Bindings = "", TabGroup = "Tools", DefaultBinding = "" },
//Ram Search
new Binding { DisplayName = "New Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "" },
new Binding { DisplayName = "Do Search", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "" },
new Binding { DisplayName = "Previous Compare To", Bindings = "", TabGroup = "Ram Search", DefaultBinding = "" },

View File

@ -88,6 +88,7 @@ namespace BizHawk.Client.Common
public string NewBranchText = "";
public int CurrentBranch { get; set; }
public int BranchCount { get { return Branches.Count; } }
public TasBranch GetBranch(int index)
{
if (index >= Branches.Count)

View File

@ -93,7 +93,7 @@ namespace BizHawk.Client.EmuHawk
IncreaseWindowSize();
break;
case "Smaller Window":
DecreaseWIndowSize();
DecreaseWindowSize();
break;
case "Increase Speed":
IncreaseSpeed();

View File

@ -1567,6 +1567,11 @@ namespace BizHawk.Client.EmuHawk
{
if (Global.Emulator.HasSavestates())
{
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
Global.Config.SaveSlot = num;
SaveSlotSelectedMessage();
UpdateStatusSlots();
@ -1882,6 +1887,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
var path = PathManager.GetSaveStatePath(Global.Game);
var file = new FileInfo(path);
@ -1913,6 +1923,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
var ofd = new OpenFileDialog
{
InitialDirectory = PathManager.GetSaveStatePath(Global.Game),
@ -2177,6 +2192,11 @@ namespace BizHawk.Client.EmuHawk
{
if (Global.Emulator.HasSavestates())
{
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
if (Global.Config.SaveSlot == 0)
{
Global.Config.SaveSlot = 9; // Wrap to end of slot list
@ -2199,6 +2219,11 @@ namespace BizHawk.Client.EmuHawk
{
if (Global.Emulator.HasSavestates())
{
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
if (Global.Config.SaveSlot >= 9)
{
Global.Config.SaveSlot = 0; // Wrap to beginning of slot list
@ -2368,7 +2393,7 @@ namespace BizHawk.Client.EmuHawk
FrameBufferResized();
}
private void DecreaseWIndowSize()
private void DecreaseWindowSize()
{
switch (Global.Config.TargetZoomFactor)
{
@ -2680,6 +2705,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
// If from lua, disable counting rerecords
bool wasCountingRerecords = Global.MovieSession.Movie.IsCountingRerecords;
@ -2722,6 +2752,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
var path = PathManager.SaveStatePrefix(Global.Game) + "." + quickSlotName + ".State";
if (File.Exists(path) == false)
{
@ -2740,6 +2775,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
try
{
SavestateManager.SaveStateFile(path, userFriendlyStateName);
@ -3675,6 +3715,11 @@ namespace BizHawk.Client.EmuHawk
return;
}
if (GlobalWin.Tools.TAStudio != null)
{
return;
}
var path = PathManager.SaveStatePrefix(Global.Game) + "." + quickSlotName + ".State";
var file = new FileInfo(path);

View File

@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
}
/// <summary>
/// Loads the tool dialog T (T must implemants <see cref="IToolForm"/>) , if it does not exist it will be created, if it is already open, it will be focused
/// Loads the tool dialog T (T must implement <see cref="IToolForm"/>) , if it does not exist it will be created, if it is already open, it will be focused
/// </summary>
/// <typeparam name="T">Type of tool you want to load</typeparam>
/// <param name="focus">Define if the tool form has to get the focus or not (Default is true)</param>
@ -75,7 +75,7 @@ namespace BizHawk.Client.EmuHawk
}
/// <summary>
/// Loads the tool dialog T (T must implemants <see cref="IToolForm"/>) , if it does not exist it will be created, if it is already open, it will be focused
/// Loads the tool dialog T (T must implement <see cref="IToolForm"/>) , if it does not exist it will be created, if it is already open, it will be focused
/// </summary>
/// <typeparam name="T">Type of tool you want to load</typeparam>
/// <param name="focus">Define if the tool form has to get the focus or not (Default is true)</param>
@ -888,6 +888,29 @@ namespace BizHawk.Client.EmuHawk
}
}
public TAStudio TAStudio
{
get
{
var tool = _tools.FirstOrDefault(x => x is TAStudio);
if (tool != null)
{
if (tool.IsDisposed)
{
_tools.Remove(tool);
}
else
{
return tool as TAStudio;
}
}
var newTool = new TAStudio();
_tools.Add(newTool);
return newTool;
}
}
#endregion
#region Specialized Tool Loading Logic