add --load-state to go along with --load-slot

This commit is contained in:
zeromus 2015-10-17 21:36:04 -05:00
parent 11891d0e6c
commit 5906bf232b
1 changed files with 18 additions and 6 deletions

View File

@ -144,6 +144,7 @@ namespace BizHawk.Client.EmuHawk
// TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null;
string cmdLoadState = null;
string cmdLoadSlot = null;
string cmdMovie = null;
string cmdDumpType = null;
string cmdDumpName = null;
@ -161,6 +162,10 @@ namespace BizHawk.Client.EmuHawk
var arg = args[i].ToLower();
if (arg.StartsWith("--load-slot="))
{
cmdLoadSlot = arg.Substring(arg.IndexOf('=') + 1);
}
if (arg.StartsWith("--load-state="))
{
cmdLoadState = arg.Substring(arg.IndexOf('=') + 1);
}
@ -401,13 +406,20 @@ namespace BizHawk.Client.EmuHawk
ToggleFullscreen();
}
if (cmdLoadState != null && !Global.Game.IsNullInstance)
if(!Global.Game.IsNullInstance)
{
LoadQuickSave("QuickSave" + cmdLoadState);
}
else if (Global.Config.AutoLoadLastSaveSlot && !Global.Game.IsNullInstance)
{
LoadQuickSave("QuickSave" + Global.Config.SaveSlot);
if(cmdLoadState != null)
{
LoadState(cmdLoadState,Path.GetFileName(cmdLoadState));
}
else if (cmdLoadSlot != null)
{
LoadQuickSave("QuickSave" + cmdLoadSlot);
}
else if (Global.Config.AutoLoadLastSaveSlot)
{
LoadQuickSave("QuickSave" + Global.Config.SaveSlot);
}
}
GlobalWin.Tools.AutoLoad();