From b16d41e92b8886866b37ba2275e874758e1f2587 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 1 Mar 2015 23:30:57 +0000 Subject: [PATCH] MultiHawk - some todos and cleanups --- BizHawk.Client.MultiHawk/EmulatorWindow.cs | 2 +- BizHawk.Client.MultiHawk/Mainform.Designer.cs | 1 - BizHawk.Client.MultiHawk/Mainform.cs | 35 ++++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/BizHawk.Client.MultiHawk/EmulatorWindow.cs b/BizHawk.Client.MultiHawk/EmulatorWindow.cs index 557703872f..6e77497b36 100644 --- a/BizHawk.Client.MultiHawk/EmulatorWindow.cs +++ b/BizHawk.Client.MultiHawk/EmulatorWindow.cs @@ -142,7 +142,7 @@ namespace BizHawk.Client.MultiHawk } else // text mode { - if (true /*Global.MovieSession.HandleMovieLoadState(path) */) // TODO + if (Global.MovieSession.HandleMovieLoadState(path)) { using (var reader = new StreamReader(path)) { diff --git a/BizHawk.Client.MultiHawk/Mainform.Designer.cs b/BizHawk.Client.MultiHawk/Mainform.Designer.cs index 664aff4e61..293c5c842c 100644 --- a/BizHawk.Client.MultiHawk/Mainform.Designer.cs +++ b/BizHawk.Client.MultiHawk/Mainform.Designer.cs @@ -393,7 +393,6 @@ this.Name = "Mainform"; this.Text = "MultiHawk"; this.Load += new System.EventHandler(this.Mainform_Load); - this.ResizeEnd += new System.EventHandler(this.Mainform_ResizeEnd); this.MainformMenu.ResumeLayout(false); this.MainformMenu.PerformLayout(); this.WorkspacePanel.ResumeLayout(false); diff --git a/BizHawk.Client.MultiHawk/Mainform.cs b/BizHawk.Client.MultiHawk/Mainform.cs index 1376e6c86f..1cd88c8b47 100644 --- a/BizHawk.Client.MultiHawk/Mainform.cs +++ b/BizHawk.Client.MultiHawk/Mainform.cs @@ -48,8 +48,7 @@ namespace BizHawk.Client.MultiHawk MovieControllerAdapter = MovieService.DefaultInstance.LogGeneratorInstance().MovieControllerAdapter, MessageCallback = AddMessage, - // TODO - //AskYesNoCallback = StateErrorAskUser, + AskYesNoCallback = StateErrorAskUser, PauseCallback = PauseEmulator, ModeChangedCallback = SetMainformMovieInfo }; @@ -100,6 +99,18 @@ namespace BizHawk.Client.MultiHawk } } + private static bool StateErrorAskUser(string title, string message) + { + var result = MessageBox.Show( + message, + title, + MessageBoxButtons.YesNo, + MessageBoxIcon.Question + ); + + return result == DialogResult.Yes; + } + private void Mainform_Load(object sender, EventArgs e) { SetMainformMovieInfo(); @@ -301,7 +312,7 @@ namespace BizHawk.Client.MultiHawk GL = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK(), GLManager = new GLManager(), Game = loader.Game, - CurrentRomPath = path + CurrentRomPath = loader.CanonicalFullPath }; nextComm.RequestGLContext = () => ew.GLManager.CreateGLContext(); @@ -318,7 +329,7 @@ namespace BizHawk.Client.MultiHawk WorkspacePanel.Controls.Add(ew); ew.Show(); - Global.Config.RecentRoms.Add(path); + Global.Config.RecentRoms.Add(loader.CanonicalFullPath); if (EmulatorWindows.Count == 1) { @@ -346,7 +357,6 @@ namespace BizHawk.Client.MultiHawk return true; } - // TODO // modals that need to capture input for binding purposes get input, of course if (ActiveForm is HotkeyConfig || ActiveForm is ControllerConfig @@ -357,12 +367,6 @@ namespace BizHawk.Client.MultiHawk return true; } - //// if no form is active on this process, then the background input setting applies - //if (ActiveForm == null && Global.Config.AcceptBackgroundInput) - //{ - // return true; - //} - return false; } } @@ -1404,14 +1408,5 @@ namespace BizHawk.Client.MultiHawk ew.Render(); } } - - private void Mainform_ResizeEnd(object sender, EventArgs e) - { - //if (Global.Config.SaveWindowPosition) - //{ - // Global.Config.MainWidth = this.Width; - // Global.Config.MainHeight = this.Height; - //} - } } }