From 7796bd7cd70ebe4517139dfdd35119e8f1e9e592 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 10 May 2014 13:49:00 +0000 Subject: [PATCH] N64 Controller Settings - show reboot notification when saving. When a movie is active hide the n64 plugin and controller settings menu items since they manipulate sync settings. --- BizHawk.Client.EmuHawk/MainForm.Designer.cs | 23 ++++++++++--------- BizHawk.Client.EmuHawk/MainForm.Events.cs | 20 ++++++++++++++++ BizHawk.Client.EmuHawk/MainForm.cs | 5 ---- .../config/N64/N64ControllersSetup.cs | 2 -- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/BizHawk.Client.EmuHawk/MainForm.Designer.cs index 96d5fe3b5d..2cd88a5d71 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -273,6 +273,7 @@ this.ColecoSkipBiosMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.N64SubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.N64PluginSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.N64ControllerSettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaturnSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.SaturnPreferencesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.DGBSubMenu = new System.Windows.Forms.ToolStripMenuItem(); @@ -354,7 +355,6 @@ this.ClearSRAMContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ShowMenuContextMenuSeparator = new System.Windows.Forms.ToolStripSeparator(); this.ShowMenuContextMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.controllerSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MainformMenu.SuspendLayout(); this.MainStatusBar.SuspendLayout(); this.MainFormContextMenu.SuspendLayout(); @@ -2404,10 +2404,11 @@ // this.N64SubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.N64PluginSettingsMenuItem, - this.controllerSettingsToolStripMenuItem}); + this.N64ControllerSettingsMenuItem}); this.N64SubMenu.Name = "N64SubMenu"; this.N64SubMenu.Size = new System.Drawing.Size(40, 19); this.N64SubMenu.Text = "N64"; + this.N64SubMenu.DropDownOpened += new System.EventHandler(this.N64SubMenu_DropDownOpened); // // N64PluginSettingsMenuItem // @@ -2417,6 +2418,14 @@ this.N64PluginSettingsMenuItem.Text = "Video Plugin Settings..."; this.N64PluginSettingsMenuItem.Click += new System.EventHandler(this.N64PluginSettingsMenuItem_Click); // + // N64ControllerSettingsMenuItem + // + this.N64ControllerSettingsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.GameController; + this.N64ControllerSettingsMenuItem.Name = "N64ControllerSettingsMenuItem"; + this.N64ControllerSettingsMenuItem.Size = new System.Drawing.Size(195, 22); + this.N64ControllerSettingsMenuItem.Text = "Controller Settings..."; + this.N64ControllerSettingsMenuItem.Click += new System.EventHandler(this.N64ControllerSettingsMenuItem_Click); + // // SaturnSubMenu // this.SaturnSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -3096,14 +3105,6 @@ this.ShowMenuContextMenuItem.Text = "Show Menu"; this.ShowMenuContextMenuItem.Click += new System.EventHandler(this.ShowMenuContextMenuItem_Click); // - // controllerSettingsToolStripMenuItem - // - this.controllerSettingsToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.GameController; - this.controllerSettingsToolStripMenuItem.Name = "controllerSettingsToolStripMenuItem"; - this.controllerSettingsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.controllerSettingsToolStripMenuItem.Text = "Controller Settings..."; - this.controllerSettingsToolStripMenuItem.Click += new System.EventHandler(this.ControllerSettingsMenuItem_Click); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); @@ -3469,7 +3470,7 @@ private System.Windows.Forms.ToolStripMenuItem N64VideoPluginSettingsMenuItem; private System.Windows.Forms.ToolStripMenuItem ClientOptionsMenuItem; private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem controllerSettingsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem N64ControllerSettingsMenuItem; } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index a176562f28..38be731975 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1551,6 +1551,13 @@ namespace BizHawk.Client.EmuHawk #region N64 + private void N64SubMenu_DropDownOpened(object sender, EventArgs e) + { + N64PluginSettingsMenuItem.Enabled = + N64ControllerSettingsMenuItem.Enabled = + !Global.MovieSession.Movie.IsActive; + } + private void N64PluginSettingsMenuItem_Click(object sender, EventArgs e) { if (new N64VideoPluginconfig().ShowDialog() == DialogResult.OK) @@ -1564,6 +1571,19 @@ namespace BizHawk.Client.EmuHawk } } + private void N64ControllerSettingsMenuItem_Click(object sender, EventArgs e) + { + if (new N64ControllersSetup().ShowDialog() == DialogResult.OK) + { + GlobalWin.MainForm.FlagNeedsReboot(); + GlobalWin.OSD.AddMessage("Controller settings saved"); + } + else + { + GlobalWin.OSD.AddMessage("Controller settings aborted"); + } + } + #endregion #region Saturn diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 7c530a02a6..5cf37693f0 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -3297,10 +3297,5 @@ namespace BizHawk.Client.EmuHawk { new EmuHawkOptions().ShowDialog(); } - - private void ControllerSettingsMenuItem_Click(object sender, EventArgs e) - { - new N64ControllersSetup().ShowDialog(); - } } } diff --git a/BizHawk.Client.EmuHawk/config/N64/N64ControllersSetup.cs b/BizHawk.Client.EmuHawk/config/N64/N64ControllersSetup.cs index c26ac96b67..df8f873037 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64ControllersSetup.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64ControllersSetup.cs @@ -57,14 +57,12 @@ namespace BizHawk.Client.EmuHawk Global.Emulator.PutSyncSettings(n64Settings); DialogResult = DialogResult.OK; - GlobalWin.OSD.AddMessage("Controller settings saved."); Close(); } private void CancelBtn_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; - GlobalWin.OSD.AddMessage("Controller settings aborted."); Close(); } }