--movie commandline arg

This commit is contained in:
andres.delikat 2011-05-22 00:13:12 +00:00
parent e9186686f8
commit 839d1e3cca
1 changed files with 18 additions and 7 deletions

View File

@ -109,13 +109,16 @@ namespace BizHawk.MultiClient
//TODO - replace this with some kind of standard dictionary-yielding parser in a separate component //TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null; string cmdRom = null;
string cmdLoadState = null; string cmdLoadState = null;
string cmdMovie = null;
for (int i = 0; i < args.Length; i++) for (int i = 0; i < args.Length; i++)
{ {
string arg = args[i].ToLower(); string arg = args[i].ToLower();
if (arg.StartsWith("--load-slot=")) if (arg.StartsWith("--load-slot="))
cmdLoadState = arg.Substring(arg.IndexOf('=') + 1); cmdLoadState = arg.Substring(arg.IndexOf('=') + 1);
else else if (arg.StartsWith("--movie="))
cmdRom = arg; cmdMovie = arg.Substring(arg.IndexOf('=') + 1);
else
cmdRom = arg;
} }
if (cmdRom != null) if (cmdRom != null)
@ -124,20 +127,28 @@ namespace BizHawk.MultiClient
LoadRom(cmdRom); LoadRom(cmdRom);
if (Global.Game == null) if (Global.Game == null)
{ {
MessageBox.Show("Failed to load rom specified on commandline"); MessageBox.Show("Failed to load " + cmdRom + " specified on commandline");
} }
} }
else if (Global.Config.AutoLoadMostRecentRom && !Global.Config.RecentRoms.IsEmpty()) else if (Global.Config.AutoLoadMostRecentRom && !Global.Config.RecentRoms.IsEmpty())
LoadRomFromRecent(Global.Config.RecentRoms.GetRecentFileByPosition(0)); LoadRomFromRecent(Global.Config.RecentRoms.GetRecentFileByPosition(0));
if (Global.Config.AutoLoadMostRecentMovie && !Global.Config.RecentMovies.IsEmpty()) if (cmdMovie != null)
{
Movie m = new Movie(cmdMovie, MOVIEMODE.PLAY);
ReadOnly = true;
StartNewMovie(m, false);
InputLog.StopMovie();
UserMovie.StartPlayback();
Global.Config.RecentMovies.Add(cmdMovie);
}
else if (Global.Config.AutoLoadMostRecentMovie && !Global.Config.RecentMovies.IsEmpty())
{ {
Movie m = new Movie(Global.Config.RecentMovies.GetRecentFileByPosition(0), MOVIEMODE.PLAY); Movie m = new Movie(Global.Config.RecentMovies.GetRecentFileByPosition(0), MOVIEMODE.PLAY);
ReadOnly = true; ReadOnly = true;
StartNewMovie(m, false); StartNewMovie(m, false);
InputLog.StopMovie(); InputLog.StopMovie();
UserMovie.StartPlayback(); UserMovie.StartPlayback();
//LoadMoviesFromRecent(Global.Config.RecentRoms.GetRecentFileByPosition(0));
} }
if (cmdLoadState != null && Global.Game != null) if (cmdLoadState != null && Global.Game != null)