From 9b46de0d3ed1f6ee37ded23b602c1edd1b0a59ba Mon Sep 17 00:00:00 2001 From: Hathor86 Date: Sat, 17 Oct 2015 20:44:36 +0200 Subject: [PATCH] Menuing Allow tool to be loaded from menu instead of ROM loading --- BizHawk.Client.EmuHawk/MainForm.Designer.cs | 45 +++++++++++++-------- BizHawk.Client.EmuHawk/MainForm.Events.cs | 10 ++++- BizHawk.Client.EmuHawk/MainForm.cs | 3 +- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/BizHawk.Client.EmuHawk/MainForm.Designer.cs index b348c2cc33..ae39f5a74f 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -205,6 +205,7 @@ this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.CheatsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.LuaConsoleMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.customToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator29 = new System.Windows.Forms.ToolStripSeparator(); this.MultiDiskBundlerFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.batchRunnerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -325,13 +326,13 @@ this.AppleDisksSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator31 = new System.Windows.Forms.ToolStripSeparator(); this.settingsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.C64SubMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.C64SettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.HelpSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.OnlineHelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ForumsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FeaturesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AboutMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.C64SubMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.C64SettingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MainStatusBar = new StatusStripEx(); this.DumpStatusButton = new System.Windows.Forms.ToolStripDropDownButton(); this.EmuStatus = new System.Windows.Forms.ToolStripStatusLabel(); @@ -1825,6 +1826,7 @@ this.toolStripSeparator11, this.CheatsMenuItem, this.LuaConsoleMenuItem, + this.customToolToolStripMenuItem, this.toolStripSeparator29, this.MultiDiskBundlerFileMenuItem, this.batchRunnerToolStripMenuItem}); @@ -1944,6 +1946,14 @@ this.LuaConsoleMenuItem.Text = "Lua Console"; this.LuaConsoleMenuItem.Click += new System.EventHandler(this.LuaConsoleMenuItem_Click); // + // customToolToolStripMenuItem + // + this.customToolToolStripMenuItem.Enabled = false; + this.customToolToolStripMenuItem.Name = "customToolToolStripMenuItem"; + this.customToolToolStripMenuItem.Size = new System.Drawing.Size(172, 22); + this.customToolToolStripMenuItem.Text = "Custom Tool"; + this.customToolToolStripMenuItem.Click += new System.EventHandler(this.CustomToolMenuItem_Click); + // // toolStripSeparator29 // this.toolStripSeparator29.Name = "toolStripSeparator29"; @@ -2885,6 +2895,21 @@ this.settingsToolStripMenuItem1.Text = "&Settings..."; this.settingsToolStripMenuItem1.Click += new System.EventHandler(this.settingsToolStripMenuItem1_Click_1); // + // C64SubMenu + // + this.C64SubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.C64SettingsMenuItem}); + this.C64SubMenu.Name = "C64SubMenu"; + this.C64SubMenu.Size = new System.Drawing.Size(39, 19); + this.C64SubMenu.Text = "&C64"; + // + // C64SettingsMenuItem + // + this.C64SettingsMenuItem.Name = "C64SettingsMenuItem"; + this.C64SettingsMenuItem.Size = new System.Drawing.Size(125, 22); + this.C64SettingsMenuItem.Text = "&Settings..."; + this.C64SettingsMenuItem.Click += new System.EventHandler(this.C64SettingsMenuItem_Click); + // // HelpSubMenu // this.HelpSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2929,21 +2954,6 @@ this.AboutMenuItem.Text = "&About"; this.AboutMenuItem.Click += new System.EventHandler(this.AboutMenuItem_Click); // - // C64SubMenu - // - this.C64SubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.C64SettingsMenuItem}); - this.C64SubMenu.Name = "C64SubMenu"; - this.C64SubMenu.Size = new System.Drawing.Size(39, 19); - this.C64SubMenu.Text = "&C64"; - // - // C64SettingsMenuItem - // - this.C64SettingsMenuItem.Name = "C64SettingsMenuItem"; - this.C64SettingsMenuItem.Size = new System.Drawing.Size(152, 22); - this.C64SettingsMenuItem.Text = "&Settings..."; - this.C64SettingsMenuItem.Click += new System.EventHandler(this.C64SettingsMenuItem_Click); - // // MainStatusBar // this.MainStatusBar.ClickThrough = true; @@ -3993,6 +4003,7 @@ private System.Windows.Forms.ToolStripMenuItem DisplayMessagesMenuItem; private System.Windows.Forms.ToolStripMenuItem C64SubMenu; private System.Windows.Forms.ToolStripMenuItem C64SettingsMenuItem; + private System.Windows.Forms.ToolStripMenuItem customToolToolStripMenuItem; } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 60cd748d54..fed428b988 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk var font = new System.Drawing.Font(SaveRAMSubMenu.Font, needBold ? FontStyle.Bold : FontStyle.Regular); SaveRAMSubMenu.Font.Dispose(); SaveRAMSubMenu.Font = font; - } + } } private void RecentRomMenuItem_DropDownOpened(object sender, EventArgs e) @@ -1160,6 +1160,9 @@ namespace BizHawk.Client.EmuHawk AutoHawkMenuItem.Visible = VersionInfo.DeveloperBuild; BasicBotMenuItem.Enabled = GlobalWin.Tools.IsAvailable(); + + string toolPath = Path.Combine(Global.Config.PathEntries["Global", "GameTools"].Path, string.Format("{0}.dll", Global.Game.Name)); + customToolToolStripMenuItem.Enabled = File.Exists(toolPath); } private void AutoHawkMenuItem_Click(object sender, EventArgs e) @@ -1222,6 +1225,11 @@ namespace BizHawk.Client.EmuHawk OpenLuaConsole(); } + private void CustomToolMenuItem_Click(object sender, EventArgs e) + { + GlobalWin.Tools.Load(); + } + private void batchRunnerToolStripMenuItem_Click(object sender, EventArgs e) { new BatchRun().ShowDialog(); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 6d932a889c..63df8da335 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -3543,8 +3543,7 @@ namespace BizHawk.Client.EmuHawk { Console.WriteLine(" {0} : {1}", f.FirmwareId, f.Hash); } - } - GlobalWin.Tools.Load(); + } return true; }