From 8bf2dcabd99512b351a4056faecd4c8583fd9477 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 21 Jul 2014 23:11:21 +0000 Subject: [PATCH] Path Config - better order for global entries, dynamically put the firmware info button in there, so that if someone changes the ordinals, nothing breaks --- BizHawk.Client.Common/config/PathEntry.cs | 19 ++++---- BizHawk.Client.EmuHawk/config/PathConfig.cs | 51 ++++++++++----------- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/BizHawk.Client.Common/config/PathEntry.cs b/BizHawk.Client.Common/config/PathEntry.cs index 9680f547d6..5f6427056d 100644 --- a/BizHawk.Client.Common/config/PathEntry.cs +++ b/BizHawk.Client.Common/config/PathEntry.cs @@ -135,6 +135,7 @@ namespace BizHawk.Client.Common public string FirmwaresPathFragment { get { return Global.Config.PathEntries["Global", "Firmware"].Path; } } public string AvPathFragment { get { return Global.Config.PathEntries["Global", "A/V Dumps"].Path; } } + //this one is special public string GlobalBaseFragment { get { return Global.Config.PathEntries["Global", "Base"].Path; } } @@ -144,15 +145,15 @@ namespace BizHawk.Client.Common { return new List { - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movies", Path = Path.Combine(".", "Movies"), Ordinal = 0 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movie backups", Path = Path.Combine(".", "Movies", "backup"), Ordinal = 1 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 2 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Watch (.wch)", Path = ".", Ordinal = 3 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "A/V Dumps", Path = ".", Ordinal = 4 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Debug Logs", Path = ".", Ordinal = 5 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Firmware", Path = Path.Combine(".", "Firmware"), Ordinal = 6 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base ROM", Path = ".", Ordinal = 6 }, - new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base", Path = ".", Ordinal = 6 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base", Path = ".", Ordinal = 1 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Base ROM", Path = ".", Ordinal = 2 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Firmware", Path = Path.Combine(".", "Firmware"), Ordinal = 3 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movies", Path = Path.Combine(".", "Movies"), Ordinal = 4 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Movie backups", Path = Path.Combine(".", "Movies", "backup"), Ordinal = 5 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 6 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Watch (.wch)", Path = ".", Ordinal = 7 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "A/V Dumps", Path = ".", Ordinal = 8 }, + new PathEntry { System = "Global_NULL", SystemDisplayName="Global", Type = "Debug Logs", Path = ".", Ordinal = 9 }, new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "Base", Path = Path.Combine(".", "Intellivision"), Ordinal = 0 }, new PathEntry { System = "INTV", SystemDisplayName="Intellivision", Type = "ROM", Path = ".", Ordinal = 1 }, diff --git a/BizHawk.Client.EmuHawk/config/PathConfig.cs b/BizHawk.Client.EmuHawk/config/PathConfig.cs index 728f53ab58..dfd2731d89 100644 --- a/BizHawk.Client.EmuHawk/config/PathConfig.cs +++ b/BizHawk.Client.EmuHawk/config/PathConfig.cs @@ -143,6 +143,30 @@ namespace BizHawk.Client.EmuHawk if (t.Name.Contains("Global") && path.Type == "Firmware") { infoPadding = 26; + + var firmwareButton = new Button + { + Name = "Global", + Text = String.Empty, + Image = Properties.Resources.Help, + Location = new Point(115, _y - 1), + Width = 26, + Anchor = AnchorStyles.Top | AnchorStyles.Right + }; + + firmwareButton.Click += delegate + { + if (Owner is FirmwaresConfig) + { + MessageBox.Show("C-C-C-Combo Breaker!", "Nice try, but"); + return; + } + + var f = new FirmwaresConfig { TargetSystem = "Global" }; + f.ShowDialog(this); + }; + + t.Controls.Add(firmwareButton); } var label = new Label @@ -167,33 +191,6 @@ namespace BizHawk.Client.EmuHawk sys = "PCECD"; } - if (t.Name.Contains("Global")) - { - var firmwareButton = new Button - { - Name = sys, - Text = String.Empty, - Image = Properties.Resources.Help, - Location = new Point(115, 253), - Width = 26, - Anchor = AnchorStyles.Top | AnchorStyles.Right - }; - - firmwareButton.Click += delegate - { - if (Owner is FirmwaresConfig) - { - MessageBox.Show("C-C-C-Combo Breaker!", "Nice try, but"); - return; - } - - var f = new FirmwaresConfig { TargetSystem = sys }; - f.ShowDialog(this); - }; - - t.Controls.Add(firmwareButton); - } - tabPages.Add(t); }