From fe2b6568fc573632b800fd6b8c96894f027e4adf Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 5 Feb 2011 21:00:59 +0000 Subject: [PATCH] multiclient: add some quick commandline load-slot handling --- BizHawk.MultiClient/MainForm.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 3a8be1f59d..3e7a60c133 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -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)