Path Config - better order for global entries, dynamically put the firmware info button in there, so that if someone changes the ordinals, nothing breaks

This commit is contained in:
adelikat 2014-07-21 23:11:21 +00:00
parent 5179c59f58
commit 8bf2dcabd9
2 changed files with 34 additions and 36 deletions

View File

@ -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<PathEntry>
{
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 },

View File

@ -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);
}