multiclient: add some quick commandline load-slot handling

This commit is contained in:
zeromus 2011-02-05 21:00:59 +00:00
parent 1d00b7fe6b
commit fe2b6568fc
1 changed files with 17 additions and 2 deletions

View File

@ -92,11 +92,26 @@ namespace BizHawk.MultiClient
Application.Idle += Application_Idle;
if (args.Length != 0)
LoadRom(args[0]);
//TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null;
string cmdLoadState = null;
for (int i = 0; i < args.Length; i++)
{
string arg = args[i].ToLower();
if (arg.StartsWith("--load-slot="))
cmdLoadState = arg.Substring(arg.IndexOf('=')+1);
else
cmdRom = arg;
}
if(cmdRom != null)
LoadRom(cmdRom);
else if (Global.Config.AutoLoadMostRecentRom && !Global.Config.RecentRoms.IsEmpty())
LoadRomFromRecent(Global.Config.RecentRoms.GetRecentFileByPosition(0));
if(cmdLoadState != null)
LoadState("QuickSave" + cmdLoadState);
if (Global.Config.AutoLoadRamWatch)
LoadRamWatch();
if (Global.Config.AutoLoadRamSearch)