From 67da2c511f93e9a7432a5c64d646679edc3b9a4f Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 10 Jan 2015 15:57:47 +0000 Subject: [PATCH] Allow drag and drop of a movie while another movie is active, fix feature where if no rom is loaded on movie drop it does the open rom dialog for you, fix drag and drop logic for importable movies to match that of regular movies instead of some illogical vestigial code --- BizHawk.Client.EmuHawk/MainForm.Events.cs | 53 ++++++++++------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index c97709e5fd..9d566270b8 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -2405,10 +2405,12 @@ namespace BizHawk.Client.EmuHawk } else if (MovieService.IsValidMovieExtension(ext)) { - if (!Global.MovieSession.Movie.IsActive) + if (Global.Emulator.IsNull()) { - StartNewMovie(MovieService.Get(filePaths[0]), false); + OpenRom(); } + + StartNewMovie(MovieService.Get(filePaths[0]), false); } else if (ext.ToUpper() == ".STATE") { @@ -2433,35 +2435,28 @@ namespace BizHawk.Client.EmuHawk else if (MovieImport.IsValidMovieExtension(Path.GetExtension(filePaths[0]))) { - if (!Global.MovieSession.Movie.IsActive) + if (Global.Emulator.IsNull()) { - //tries to open a legacy movie format by importing it - if (CurrentlyOpenRom == null) - { - OpenRom(); - } - else - { - LoadRom(CurrentlyOpenRom); - } - - string errorMsg; - string warningMsg; - var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg); - if (!string.IsNullOrEmpty(errorMsg)) - { - MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - else - { - // fix movie extension to something palatable for these purposes. - // for instance, something which doesnt clobber movies you already may have had. - // i'm evenly torn between this, and a file in %TEMP%, but since we dont really have a way to clean up this tempfile, i choose this: - StartNewMovie(movie, false); - } - - GlobalWin.OSD.AddMessage(warningMsg); + OpenRom(); } + + // tries to open a legacy movie format by importing it + string errorMsg; + string warningMsg; + var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg); + if (!string.IsNullOrEmpty(errorMsg)) + { + MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else + { + // fix movie extension to something palatable for these purposes. + // for instance, something which doesnt clobber movies you already may have had. + // i'm evenly torn between this, and a file in %TEMP%, but since we dont really have a way to clean up this tempfile, i choose this: + StartNewMovie(movie, false); + } + + GlobalWin.OSD.AddMessage(warningMsg); } else {