From 9ccc214667ae748910b3bafee2ab68ccaea1dd18 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 28 Nov 2013 22:39:00 +0000 Subject: [PATCH] Make an extension method ShowHawkDialog() to use for modal dialog calls that does the Sound Stop/Start methods (and potentially any other EmuHawk specific logic that needs to be done). Use this in the bazillion places we were calling StopSound and StartSound. --- BizHawk.Client.EmuHawk/CustomControls/Util.cs | 47 +++++++++++++++---- BizHawk.Client.EmuHawk/MainForm.Events.cs | 8 +--- BizHawk.Client.EmuHawk/MainForm.cs | 22 +++------ BizHawk.Client.EmuHawk/movie/PlayMovie.cs | 4 +- BizHawk.Client.EmuHawk/movie/RecordMovie.cs | 5 +- BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs | 4 +- .../tools/HexEditor/HexEditor.cs | 22 +++------ .../tools/Lua/LuaConsole.cs | 17 +++---- BizHawk.Client.EmuHawk/tools/Lua/LuaWriter.cs | 10 ++-- .../tools/NES/NameTableViewer.cs | 4 +- .../tools/NES/PaletteViewer.cs | 6 +-- .../tools/NES/PatternViewer.cs | 6 +-- .../tools/NES/SpriteViewer.cs | 6 +-- BizHawk.Client.EmuHawk/tools/TAStudio.cs | 6 +-- BizHawk.Client.EmuHawk/tools/ToolHelpers.cs | 16 ++----- BizHawk.Client.EmuHawk/tools/TraceLogger.cs | 12 ++--- .../tools/Watch/RamSearch.cs | 8 +--- .../tools/Watch/RamWatch.cs | 14 ++---- 18 files changed, 91 insertions(+), 126 deletions(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/Util.cs b/BizHawk.Client.EmuHawk/CustomControls/Util.cs index 9ee615d333..c50d793ee0 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/Util.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/Util.cs @@ -1,20 +1,44 @@ using System; -using System.Text; using System.ComponentModel; using System.Runtime.InteropServices; +using System.Text; using System.Windows.Forms; namespace BizHawk.Client.EmuHawk { public static class Extensions { - //extension method to make Control.Invoke easier to use + // extension method to make Control.Invoke easier to use public static void Invoke(this Control control, Action action) { - control.Invoke((Delegate)action); + control.Invoke(action); } } + public static class WinFormExtensions + { + /// + /// Handles EmuHawk specific issues before showing a modal dialog + /// + public static DialogResult ShowHawkDialog(this Form form) + { + GlobalWin.Sound.StopSound(); + var result = form.ShowDialog(); + GlobalWin.Sound.StartSound(); + return result; + } + + /// + /// Handles EmuHawk specific issues before showing a modal dialog + /// + public static DialogResult ShowHawkDialog(this CommonDialog form) + { + GlobalWin.Sound.StopSound(); + var result = form.ShowDialog(); + GlobalWin.Sound.StartSound(); + return result; + } + } public static class ListViewExtensions { @@ -70,27 +94,32 @@ namespace BizHawk.Client.EmuHawk /// public static string CopyItemsAsText(this ListView listViewControl) { - ListView.SelectedIndexCollection indexes = listViewControl.SelectedIndices; + var indexes = listViewControl.SelectedIndices; if (indexes.Count <= 0) - return ""; + { + return String.Empty; + } - StringBuilder sb = new StringBuilder(); + var sb = new StringBuilder(); - //walk over each selected item and subitem within it to generate a string from it + // walk over each selected item and subitem within it to generate a string from it foreach (int index in indexes) { foreach (ListViewItem.ListViewSubItem item in listViewControl.Items[index].SubItems) { if (!String.IsNullOrWhiteSpace(item.Text)) + { sb.Append(item.Text).Append('\t'); + } } - //remove the last tab + + // remove the last tab sb.Remove(sb.Length - 1, 1); sb.Append("\r\n"); } - //remove last newline + // remove last newline sb.Length -= 2; diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index c86330e1d7..fd792ddf15 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -413,9 +413,7 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = false }; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = ofd.ShowHawkDialog(); if (result == DialogResult.OK) { foreach (var fn in ofd.FileNames) @@ -481,9 +479,7 @@ namespace BizHawk.Client.EmuHawk Filter = "PNG File (*.png)|*.png" }; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result == DialogResult.OK) { TakeScreenshot(sfd.FileName); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 75c0213c14..a28b581458 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1787,10 +1787,7 @@ namespace BizHawk.Client.EmuHawk file.Directory.Create(); } - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); - + var result = sfd.ShowHawkDialog(); if (result == DialogResult.OK) { SaveStateFile(sfd.FileName, sfd.FileName, false); @@ -1811,10 +1808,7 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = true }; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); - + var result = ofd.ShowHawkDialog(); if (result != DialogResult.OK) return; @@ -1991,11 +1985,12 @@ namespace BizHawk.Client.EmuHawk ofd.RestoreDirectory = false; ofd.FilterIndex = _lastOpenRomFilter; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = ofd.ShowHawkDialog(); if (result != DialogResult.OK) + { return; + } + var file = new FileInfo(ofd.FileName); Global.Config.LastRomPath = file.DirectoryName; _lastOpenRomFilter = ofd.FilterIndex; @@ -2725,10 +2720,7 @@ namespace BizHawk.Client.EmuHawk } sfd.Filter = String.Format("{0} (*.{0})|*.{0}|All Files|*.*", aw.DesiredExtension()); - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); - + var result = sfd.ShowHawkDialog(); if (result == DialogResult.Cancel) { aw.Dispose(); diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index c747dff479..31ab3af7a3 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -74,9 +74,7 @@ namespace BizHawk.Client.EmuHawk var filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; ofd.Filter = filter; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = ofd.ShowHawkDialog(); if (result == DialogResult.OK) { var file = new FileInfo(ofd.FileName); diff --git a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs index 35f4390918..211acb571c 100644 --- a/BizHawk.Client.EmuHawk/movie/RecordMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/RecordMovie.cs @@ -210,10 +210,7 @@ namespace BizHawk.Client.EmuHawk var filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; sfd.Filter = filter; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); - + var result = sfd.ShowHawkDialog(); if (result == DialogResult.OK && !String.IsNullOrWhiteSpace(sfd.FileName)) { diff --git a/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs b/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs index c1008fa6af..dbf8d52af3 100644 --- a/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs +++ b/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs @@ -963,9 +963,7 @@ namespace BizHawk.Client.EmuHawk dlg.FullOpen = true; dlg.Color = spriteback; - GlobalWin.Sound.StopSound(); - var result = dlg.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = dlg.ShowHawkDialog(); if (result == DialogResult.OK) { // force full opaque diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index af174965e1..737a895473 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -383,9 +383,7 @@ namespace BizHawk.Client.EmuHawk sfd.Filter = "Text (*.txt)|*.txt|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); return result == DialogResult.OK ? sfd.FileName : String.Empty; } @@ -862,9 +860,7 @@ namespace BizHawk.Client.EmuHawk sfd.InitialDirectory = PathManager.GetPlatformBase(Global.Emulator.SystemId); sfd.Filter = GetSaveFileFilter(); sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); return result == DialogResult.OK ? sfd.FileName : String.Empty; } @@ -1397,9 +1393,7 @@ namespace BizHawk.Client.EmuHawk { var inputPrompt = new InputPrompt { Text = "Go to Address", _Location = GetPromptPoint() }; inputPrompt.SetMessage("Enter a hexadecimal value"); - GlobalWin.Sound.StopSound(); - inputPrompt.ShowDialog(); - GlobalWin.Sound.StartSound(); + inputPrompt.ShowHawkDialog(); if (inputPrompt.UserOK && InputValidate.IsValidHexNumber(inputPrompt.UserText)) { @@ -1491,11 +1485,9 @@ namespace BizHawk.Client.EmuHawk )); poke.SetWatch(watches); - - GlobalWin.Sound.StopSound(); - poke.ShowDialog(); + poke.ShowHawkDialog(); UpdateValues(); - GlobalWin.Sound.StartSound(); + } } @@ -1512,9 +1504,7 @@ namespace BizHawk.Client.EmuHawk private void SetColorsMenuItem_Click(object sender, EventArgs e) { - GlobalWin.Sound.StopSound(); - new HexColorsForm().ShowDialog(); - GlobalWin.Sound.StartSound(); + new HexColorsForm().ShowHawkDialog(); } private void ResetColorsToDefaultMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 2a5109cdf1..d244cf7a3e 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -240,10 +240,7 @@ namespace BizHawk.Client.EmuHawk Directory.CreateDirectory(ofd.InitialDirectory); } - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); - + var result = ofd.ShowHawkDialog(); return result == DialogResult.OK ? new FileInfo(ofd.FileName) : null; } @@ -435,13 +432,13 @@ namespace BizHawk.Client.EmuHawk } sfd.Filter = "Lua Session Files (*.luases)|*.luases|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) + { return null; - var file = new FileInfo(sfd.FileName); - return file; + } + + return new FileInfo(sfd.FileName); } private void SaveSessionAs() @@ -875,9 +872,7 @@ namespace BizHawk.Client.EmuHawk private void FunctionsListMenuItem_Click(object sender, EventArgs e) { - GlobalWin.Sound.StopSound(); new LuaFunctionsForm().Show(); - GlobalWin.Sound.StartSound(); } private void OnlineDocsMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaWriter.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaWriter.cs index b4ad910151..e033bedf3b 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaWriter.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaWriter.cs @@ -578,13 +578,13 @@ namespace BizHawk.Client.EmuHawk } sfd.Filter = "Watch Files (*.lua)|*.lua|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) + { return null; - var file = new FileInfo(sfd.FileName); - return file; + } + + return new FileInfo(sfd.FileName); } private void LuaText_KeyUp(object sender, KeyEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs index ca8ad5795f..4f993c7d46 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NameTableViewer.cs @@ -76,9 +76,7 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = true }; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) { return; diff --git a/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs index de10c9f0b1..fc7d2cec25 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/PaletteViewer.cs @@ -83,11 +83,11 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = true }; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) + { return; + } var file = new FileInfo(sfd.FileName); Bitmap b = new Bitmap(Width, Height); diff --git a/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs index c43fb2e98a..fbc4ed09fb 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/PatternViewer.cs @@ -44,11 +44,11 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = true }; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) + { return; + } var file = new FileInfo(sfd.FileName); Bitmap b = new Bitmap(Width, Height); diff --git a/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs index 3544f22f43..ec2e3dfb3f 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/SpriteViewer.cs @@ -49,11 +49,11 @@ namespace BizHawk.Client.EmuHawk RestoreDirectory = true }; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) + { return; + } var file = new FileInfo(sfd.FileName); Bitmap b = new Bitmap(Width, Height); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio.cs index ba1f27d6dd..49e94616ad 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio.cs @@ -451,14 +451,12 @@ namespace BizHawk.Client.EmuHawk string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; sfd.Filter = filter; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result == DialogResult.OK) { return sfd.FileName; } - return ""; + return String.Empty; } private void TASView_MouseWheel(object sender, MouseEventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs index 80428bc47d..7eeba59bd2 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs @@ -23,9 +23,7 @@ namespace BizHawk.Client.EmuHawk ofd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; ofd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = ofd.ShowHawkDialog(); if (result != DialogResult.OK) { return null; @@ -55,9 +53,7 @@ namespace BizHawk.Client.EmuHawk sfd.Filter = "Watch Files (*.wch)|*.wch|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) { return null; @@ -78,9 +74,7 @@ namespace BizHawk.Client.EmuHawk ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*"; ofd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = ofd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = ofd.ShowHawkDialog(); if (result != DialogResult.OK) { return null; @@ -104,9 +98,7 @@ namespace BizHawk.Client.EmuHawk sfd.InitialDirectory = PathManager.GetCheatsPath(Global.Game); sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) { return null; diff --git a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs index 53ae307e90..dbca285aea 100644 --- a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs +++ b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs @@ -323,19 +323,13 @@ namespace BizHawk.Client.EmuHawk sfd.Filter = "Text Files (*.txt)|*.txt|Log Files (*.log)|*.log|All Files|*.*"; sfd.RestoreDirectory = true; - GlobalWin.Sound.StopSound(); - - var result = sfd.ShowDialog(); - GlobalWin.Sound.StartSound(); + var result = sfd.ShowHawkDialog(); if (result != DialogResult.OK) { return null; } - else - { - return new FileInfo(sfd.FileName); - - } + + return new FileInfo(sfd.FileName); } private void saveLogToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index 31056fd4e4..49fb74578c 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -794,14 +794,12 @@ namespace BizHawk.Client.EmuHawk { if (SelectedIndices.Count > 0) { - GlobalWin.Sound.StopSound(); var poke = new RamPoke(); var watches = SelectedIndices.Select(t => _searches[t]).ToList(); poke.SetWatch(watches); poke.InitialLocation = GetPromptPoint(); - poke.ShowDialog(); + poke.ShowHawkDialog(); UpdateValues(); - GlobalWin.Sound.StartSound(); } } @@ -854,9 +852,7 @@ namespace BizHawk.Client.EmuHawk WatchListView.SelectedIndices.Clear(); var prompt = new InputPrompt {Text = "Go to Address", _Location = GetPromptPoint()}; prompt.SetMessage("Enter a hexadecimal value"); - GlobalWin.Sound.StopSound(); - prompt.ShowDialog(); - GlobalWin.Sound.StartSound(); + prompt.ShowHawkDialog(); if (prompt.UserOK) { diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index e13b4ccf03..50fc93c441 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -295,8 +295,7 @@ namespace BizHawk.Client.EmuHawk we.SetWatch(_watches.Domain, SelectedWatches, duplicate ? WatchEditor.Mode.Duplicate : WatchEditor.Mode.Edit); - GlobalWin.Sound.StopSound(); - var result = we.ShowDialog(); + var result = we.ShowHawkDialog(); if (result == DialogResult.OK) { Changes(); @@ -314,7 +313,6 @@ namespace BizHawk.Client.EmuHawk } } - GlobalWin.Sound.StartSound(); UpdateValues(); } } @@ -672,10 +670,7 @@ namespace BizHawk.Client.EmuHawk InitialLocation = GetPromptPoint() }; we.SetWatch(_watches.Domain); - GlobalWin.Sound.StopSound(); - we.ShowDialog(); - GlobalWin.Sound.StartSound(); - + we.ShowHawkDialog(); if (we.DialogResult == DialogResult.OK) { _watches.Add(we.Watches[0]); @@ -726,13 +721,10 @@ namespace BizHawk.Client.EmuHawk poke.SetWatch(SelectedWatches); } - GlobalWin.Sound.StopSound(); - if (poke.ShowDialog() == DialogResult.OK) + if (poke.ShowHawkDialog() == DialogResult.OK) { UpdateValues(); } - - GlobalWin.Sound.StartSound(); } }