From a26e36719a532060fdd6a0df64ea80dbd6324a9d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 29 Nov 2014 00:59:14 +0000 Subject: [PATCH] Don't allow drag and drop of a movie file if a movie is already active --- BizHawk.Client.EmuHawk/MainForm.Events.cs | 54 +++++++++++++---------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 6101996920..86c7b4256d 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -2391,7 +2391,10 @@ namespace BizHawk.Client.EmuHawk } else if (MovieService.IsValidMovieExtension(ext)) { - StartNewMovie(MovieService.Get(filePaths[0]), false); + if (!Global.MovieSession.Movie.IsActive) + { + StartNewMovie(MovieService.Get(filePaths[0]), false); + } } else if (ext.ToUpper() == ".STATE") { @@ -2416,32 +2419,35 @@ namespace BizHawk.Client.EmuHawk else if (MovieImport.IsValidMovieExtension(Path.GetExtension(filePaths[0]))) { - //tries to open a legacy movie format by importing it - if (CurrentlyOpenRom == null) + if (!Global.MovieSession.Movie.IsActive) { - OpenRom(); - } - else - { - LoadRom(CurrentlyOpenRom); - } + //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); - } + 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); + GlobalWin.OSD.AddMessage(warningMsg); + } } else {