From a71837c3aac36a6bbbf301157ade92176c74989c Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 23 Aug 2013 16:03:57 +0000 Subject: [PATCH] Fix path exceptions for various systems like GBC, and also clean up some terrible hacky code and do it in a nicer way --- BizHawk.MultiClient/Config.cs | 395 ++++++++++---------- BizHawk.MultiClient/config/NewPathConfig.cs | 113 +++--- BizHawk.MultiClient/config/PathManager.cs | 92 +---- 3 files changed, 257 insertions(+), 343 deletions(-) diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index 324d67a25c..4b4221a339 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -16,7 +16,7 @@ namespace BizHawk.MultiClient public void ResolveDefaults() { PathEntries.ResolveWithDefaults(); - HotkeyBindings.ResolveWithDefaults(); + HotkeyBindings.ResolveWithDefaults(); } //Path Settings ************************************/ @@ -449,7 +449,7 @@ namespace BizHawk.MultiClient public int TI83KeyPadWndy = -1; public bool TI83ToolTips = true; - public BindingCollection HotkeyBindings = new BindingCollection(); + public BindingCollection HotkeyBindings = new BindingCollection(); @@ -604,8 +604,8 @@ namespace BizHawk.MultiClient public BindingCollection() { - Bindings = new List(); - Bindings.AddRange(DefaultValues); + Bindings = new List(); + Bindings.AddRange(DefaultValues); } public void Add(Binding b) @@ -631,41 +631,41 @@ namespace BizHawk.MultiClient } } - public void ResolveWithDefaults() - { - //Add missing entries - foreach (Binding default_binding in DefaultValues) - { - var binding = Bindings.FirstOrDefault(x => x.DisplayName == default_binding.DisplayName); - if (binding == null) - { - Bindings.Add(default_binding); - } - } + public void ResolveWithDefaults() + { + //Add missing entries + foreach (Binding default_binding in DefaultValues) + { + var binding = Bindings.FirstOrDefault(x => x.DisplayName == default_binding.DisplayName); + if (binding == null) + { + Bindings.Add(default_binding); + } + } - List entriesToRemove = new List(); + List entriesToRemove = new List(); - //Remove entries that no longer exist in defaults - foreach (Binding entry in Bindings) - { - var binding = DefaultValues.FirstOrDefault(x => x.DisplayName == entry.DisplayName); - if (binding == null) - { - entriesToRemove.Add(entry); - } - } + //Remove entries that no longer exist in defaults + foreach (Binding entry in Bindings) + { + var binding = DefaultValues.FirstOrDefault(x => x.DisplayName == entry.DisplayName); + if (binding == null) + { + entriesToRemove.Add(entry); + } + } - foreach (Binding entry in entriesToRemove) - { - Bindings.Remove(entry); - } - } + foreach (Binding entry in entriesToRemove) + { + Bindings.Remove(entry); + } + } - public static List DefaultValues - { - get - { - return new List() + public static List DefaultValues + { + get + { + return new List() { //General new Binding() { DisplayName = "Frame Advance", Bindings = "F", TabGroup = "General", DefaultBinding = "F", Ordinal = 0 }, @@ -785,8 +785,8 @@ namespace BizHawk.MultiClient new Binding() { DisplayName = "X Down Large", Bindings = "", TabGroup = "Analog", DefaultBinding = "", Ordinal = 7 }, }; - } - } + } + } } public class Binding @@ -800,43 +800,43 @@ namespace BizHawk.MultiClient public Binding() { } } - public class PathEntryCollection : IEnumerable - { - public List Paths { get; private set; } + public class PathEntryCollection : IEnumerable + { + public List Paths { get; private set; } - public PathEntryCollection() - { - Paths = new List(); + public PathEntryCollection() + { + Paths = new List(); Paths.AddRange(DefaultValues); - } + } - public void Add(PathEntry p) - { - Paths.Add(p); - } + public void Add(PathEntry p) + { + Paths.Add(p); + } - public IEnumerator GetEnumerator() - { - return Paths.GetEnumerator(); - } + public IEnumerator GetEnumerator() + { + return Paths.GetEnumerator(); + } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } - public PathEntry this[string system, string type] - { - get - { - return Paths.FirstOrDefault(x => x.System == system && x.Type == type); - } - } + public PathEntry this[string system, string type] + { + get + { + return Paths.FirstOrDefault(x => x.System.Contains(system) && x.Type == type); + } + } public void ResolveWithDefaults() { //Add missing entries - foreach(PathEntry defaultpath in DefaultValues) + foreach (PathEntry defaultpath in DefaultValues) { var path = Paths.FirstOrDefault(x => x.System == defaultpath.System && x.Type == defaultpath.Type); if (path == null) @@ -861,6 +861,14 @@ namespace BizHawk.MultiClient { Paths.Remove(entry); } + + //Add missing displaynames + var missingDisplayPaths = Paths.Where(x => x.SystemDisplayName == null).ToList(); + foreach (PathEntry path in missingDisplayPaths) + { + path.SystemDisplayName = DefaultValues.FirstOrDefault(x => x.System == path.System).SystemDisplayName; + + } } //Some frequently requested paths, made into a property for convenience @@ -878,156 +886,157 @@ namespace BizHawk.MultiClient { return new List() { - new PathEntry() { System = "Global", Type = "Movies", Path = Path.Combine(".", "Movies"), Ordinal = 0 }, - new PathEntry() { System = "Global", Type = "Movie backups", Path = Path.Combine(".", "Movies", "backup"), Ordinal = 1 }, - new PathEntry() { System = "Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 2 }, - new PathEntry() { System = "Global", Type = "Watch (.wch)", Path = ".", Ordinal = 3 }, - new PathEntry() { System = "Global", Type = "A/V Dumps", Path = ".", Ordinal = 4 }, - new PathEntry() { System = "Global", Type = "Debug Logs", Path = ".", Ordinal = 5 }, - new PathEntry() { System = "Global", Type = "Firmware", Path = Path.Combine(".", "Firmware"), Ordinal = 6 }, - new PathEntry() { System = "Global", Type = "Base ROM", Path = ".", Ordinal = 6 }, - new PathEntry() { System = "Global", Type = "Base", Path = ".", Ordinal = 6 }, + 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 = "INTV", Type = "Base", Path = Path.Combine(".", "Intellivision"), Ordinal = 0 }, - new PathEntry() { System = "INTV", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "INTV", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "INTV", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "INTV", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "INTV", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "INTV", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, + 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 }, + new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "INTV", SystemDisplayName="Intellivision", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, - new PathEntry() { System = "NES", Type = "Base", Path = Path.Combine(".", "NES"), Ordinal = 0 }, - new PathEntry() { System = "NES", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "NES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "NES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "NES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "NES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "NES", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Base", Path = Path.Combine(".", "NES"), Ordinal = 0 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "NES", SystemDisplayName="NES", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, - new PathEntry() { System = "SNES", Type = "Base", Path= Path.Combine(".", "SNES"), Ordinal = 0 }, - new PathEntry() { System = "SNES", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "SNES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "SNES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "SNES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "SNES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Base", Path= Path.Combine(".", "SNES"), Ordinal = 0 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "SNES_SGB", SystemDisplayName="SNES", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "GBA", Type = "Base", Path= Path.Combine(".", "GBA"), Ordinal = 0 }, - new PathEntry() { System = "GBA", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "GBA", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "GBA", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "GBA", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "GBA", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Base", Path= Path.Combine(".", "GBA"), Ordinal = 0 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "GBA", SystemDisplayName="GBA", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "SMS", Type = "Base", Path= Path.Combine(".", "SMS"), Ordinal = 0 }, - new PathEntry() { System = "SMS", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "SMS", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "SMS", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "SMS", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "SMS", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Base", Path= Path.Combine(".", "SMS"), Ordinal = 0 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "SMS", SystemDisplayName="SMS", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "GG", Type = "Base", Path= Path.Combine(".", "Game Gear"), Ordinal = 0 }, - new PathEntry() { System = "GG", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "GG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "GG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "GG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "GG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Base", Path= Path.Combine(".", "Game Gear"), Ordinal = 0 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "GG", SystemDisplayName="GG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "SG", Type = "Base", Path= Path.Combine(".", "SG-1000"), Ordinal = 0 }, - new PathEntry() { System = "SG", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "SG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "SG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "SG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "SG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Base", Path= Path.Combine(".", "SG-1000"), Ordinal = 0 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "SG", SystemDisplayName="SG", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "GEN", Type = "Base", Path= Path.Combine(".", "Genesis"), Ordinal = 0 }, - new PathEntry() { System = "GEN", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "GEN", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "GEN", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "GEN", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "GEN", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Base", Path= Path.Combine(".", "Genesis"), Ordinal = 0 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "GEN", SystemDisplayName="Genesis", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "PCE", Type = "Base", Path= Path.Combine(".", "PC Engine"), Ordinal = 0 }, - new PathEntry() { System = "PCE", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "PCE", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "PCE", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "PCE", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "PCE", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Base", Path= Path.Combine(".", "PC Engine"), Ordinal = 0 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "PCE_PCECD_SGX", SystemDisplayName="PC Engine", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "GB", Type = "Base", Path= Path.Combine(".", "Gameboy"), Ordinal = 0 }, - new PathEntry() { System = "GB", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "GB", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "GB", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "GB", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "GB", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "GB", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Base", Path= Path.Combine(".", "Gameboy"), Ordinal = 0 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "GB_GBC", SystemDisplayName="Gameboy", Type = "Palettes", Path = Path.Combine(".", "Palettes"), Ordinal = 6 }, - new PathEntry() { System = "TI83", Type = "Base", Path= Path.Combine(".", "TI83"), Ordinal = 0 }, - new PathEntry() { System = "TI83", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "TI83", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "TI83", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "TI83", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "TI83", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Base", Path= Path.Combine(".", "TI83"), Ordinal = 0 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "TI83", SystemDisplayName="TI83", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "A26", Type = "Base", Path= Path.Combine(".", "Atari 2600"), Ordinal = 0 }, - new PathEntry() { System = "A26", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "A26", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "A26", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "A26", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Base", Path= Path.Combine(".", "Atari 2600"), Ordinal = 0 }, + new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "A26", SystemDisplayName="Atari 2600", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "A78", Type = "Base", Path= Path.Combine(".", "Atari 7800"), Ordinal = 0 }, - new PathEntry() { System = "A78", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "A78", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "A78", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "A78", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "A78", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Base", Path= Path.Combine(".", "Atari 7800"), Ordinal = 0 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "A78", SystemDisplayName="Atari 7800", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "C64", Type = "Base", Path= Path.Combine(".", "C64"), Ordinal = 0 }, - new PathEntry() { System = "C64", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "C64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "C64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "C64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Base", Path= Path.Combine(".", "C64"), Ordinal = 0 }, + new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "C64", SystemDisplayName="Commodore 64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "PSX", Type = "Base", Path= Path.Combine(".", "PSX"), Ordinal = 0 }, - new PathEntry() { System = "PSX", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "PSX", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "PSX", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "PSX", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "PSX", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Base", Path= Path.Combine(".", "PSX"), Ordinal = 0 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "PSX", SystemDisplayName="Playstation", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "Coleco", Type = "Base", Path= Path.Combine(".", "Coleco"), Ordinal = 0 }, - new PathEntry() { System = "Coleco", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "Coleco", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "Coleco", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "Coleco", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Base", Path= Path.Combine(".", "Coleco"), Ordinal = 0 }, + new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "Coleco", SystemDisplayName = "Coleco", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "N64", Type = "Base", Path= Path.Combine(".", "N64"), Ordinal = 0 }, - new PathEntry() { System = "N64", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "N64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "N64", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "N64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "N64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Base", Path= Path.Combine(".", "N64"), Ordinal = 0 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "N64", SystemDisplayName = "N64", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - new PathEntry() { System = "SAT", Type = "Base", Path= Path.Combine(".", "Saturn"), Ordinal = 0 }, - new PathEntry() { System = "SAT", Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry() { System = "SAT", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry() { System = "SAT", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry() { System = "SAT", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry() { System = "SAT", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Base", Path= Path.Combine(".", "Saturn"), Ordinal = 0 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry() { System = "SAT", SystemDisplayName = "Saturn", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, }; } } - } + } - public class PathEntry - { - public string Type; - public string Path; - public string System; - public int Ordinal; - public PathEntry() { } - } + public class PathEntry + { + public string SystemDisplayName; + public string Type; + public string Path; + public string System; + public int Ordinal; + public PathEntry() { } + } - public enum PLUGINTYPE { RICE, GLIDE, GLIDE64MK2 }; + public enum PLUGINTYPE { RICE, GLIDE, GLIDE64MK2 }; public interface iPluginSettings { @@ -1196,7 +1205,7 @@ namespace BizHawk.MultiClient filtering = Global.Game.GetInt("Glide_filtering", 1); fix_tex_coord = Global.Game.GetInt("Glide_fix_tex_coord", 0); lodmode = Global.Game.GetInt("Glide_lodmode", 0); - + stipple_mode = Global.Game.GetInt("Glide_stipple_mode", 2); stipple_pattern = Global.Game.GetInt("Glide_stipple_pattern", 1041204192); swapmode = Global.Game.GetInt("Glide_swapmode", 1); @@ -1273,7 +1282,7 @@ namespace BizHawk.MultiClient public int filtering = 1; public int depth_bias = 20; } - + public class N64Glide64mk2PluginSettings : iPluginSettings { public PLUGINTYPE PluginType diff --git a/BizHawk.MultiClient/config/NewPathConfig.cs b/BizHawk.MultiClient/config/NewPathConfig.cs index 7a3c4f964c..70ce152ede 100644 --- a/BizHawk.MultiClient/config/NewPathConfig.cs +++ b/BizHawk.MultiClient/config/NewPathConfig.cs @@ -11,38 +11,38 @@ namespace BizHawk.MultiClient { public partial class NewPathConfig : Form { - //All path text boxes should do some kind of error checking - //config path under base, config will default to %exe% + //All path text boxes should do some kind of error checking + //config path under base, config will default to %exe% - private void LockDownCores() - { - if (!MainForm.INTERIM) - { - string[] coresToHide = { "PSX", "GBA", "INTV", "C64", "GEN" }; - - foreach(string core in coresToHide) - { - TabPage tp = AllTabPages.FirstOrDefault(x => x.Name == core); - PathTabControl.TabPages.Remove(tp); - } - } - } + private void LockDownCores() + { + if (!MainForm.INTERIM) + { + string[] coresToHide = { "PSX", "GBA", "INTV", "C64", "GEN" }; - private AutoCompleteStringCollection AutoCompleteOptions - { - get - { - return new AutoCompleteStringCollection() + foreach (string core in coresToHide) + { + TabPage tp = AllTabPages.FirstOrDefault(x => x.Name == core); + PathTabControl.TabPages.Remove(tp); + } + } + } + + private AutoCompleteStringCollection AutoCompleteOptions + { + get + { + return new AutoCompleteStringCollection() { "%recent%", "%exe%", ".\\", "..\\", }; - } - } + } + } - public NewPathConfig() + public NewPathConfig() { InitializeComponent(); } @@ -50,7 +50,7 @@ namespace BizHawk.MultiClient private void NewPathConfig_Load(object sender, EventArgs e) { LoadSettings(); - LockDownCores(); + LockDownCores(); } private void OK_Click(object sender, EventArgs e) @@ -82,33 +82,13 @@ namespace BizHawk.MultiClient private void SetDefaultFocusedTab() { - switch (Global.Game.System) - { - case "NULL": - PathTabControl.SelectTab(FindTabByName("Global")); - break; - default: - PathTabControl.SelectTab(FindTabByName(Global.Game.System)); - break; - - //"Sub" Systems and other exceptions go here - case "PCECD": - case "SGX": - PathTabControl.SelectTab(FindTabByName("PCE")); - break; - case "GBC": - PathTabControl.SelectTab(FindTabByName("GB")); - break; - case "SGB": - PathTabControl.SelectTab(FindTabByName("SNES")); - break; - } + PathTabControl.SelectTab(FindTabByName(Global.Game.System)); } private TabPage FindTabByName(string name) { IEnumerable query = from p in PathTabControl.TabPages.OfType() select p; - var tab = query.FirstOrDefault(x => x.Name.ToUpper() == name.ToUpper()); + var tab = query.FirstOrDefault(x => x.Name.ToUpper().Contains(name.ToUpper())); if (tab == null) { return new TabPage(); @@ -125,7 +105,7 @@ namespace BizHawk.MultiClient PathTabControl.TabPages.Clear(); //Separate by system - List systems = Global.Config.PathEntries.Select(x => x.System).Distinct().ToList(); + List systems = Global.Config.PathEntries.Select(x => x.SystemDisplayName).Distinct().ToList(); systems.Sort(); //Hacky way to put global first @@ -133,11 +113,12 @@ namespace BizHawk.MultiClient systems.Remove(global); systems.Insert(0, global); - foreach (string systemId in systems) + foreach (string systemDisplayName in systems) { + string systemId = Global.Config.PathEntries.FirstOrDefault(x => x.SystemDisplayName == systemDisplayName).System; TabPage t = new TabPage() { - Text = systemId == "SG" ? "SG-1000" : systemId == "GEN" ? "Genesis" : systemId, //TODO: don't be hacky + Text = systemDisplayName, Name = systemId, }; List paths = PathCollection.Where(x => x.System == systemId).OrderBy(x => x.Ordinal).ThenBy(x => x.Type).ToList(); @@ -159,9 +140,9 @@ namespace BizHawk.MultiClient Name = path.Type, Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right, MinimumSize = new Size(26, 23), - AutoCompleteMode = AutoCompleteMode.SuggestAppend, - AutoCompleteCustomSource = AutoCompleteOptions, - AutoCompleteSource = AutoCompleteSource.CustomSource, + AutoCompleteMode = AutoCompleteMode.SuggestAppend, + AutoCompleteCustomSource = AutoCompleteOptions, + AutoCompleteSource = AutoCompleteSource.CustomSource, }; Button btn = new Button() @@ -198,8 +179,8 @@ namespace BizHawk.MultiClient _y += row_height; } - string sys = systemId; - if (systemId == "PCE") //Hack + string sys = systemDisplayName; + if (systemDisplayName == "PCE") //Hack { sys = "PCECD"; } @@ -352,18 +333,18 @@ namespace BizHawk.MultiClient } } - private List AllTabPages - { - get - { - List _AllTabPages = new List(); - foreach (TabPage tp in PathTabControl.TabPages) - { - _AllTabPages.Add(tp); - } - return _AllTabPages; - } - } + private List AllTabPages + { + get + { + List _AllTabPages = new List(); + foreach (TabPage tp in PathTabControl.TabPages) + { + _AllTabPages.Add(tp); + } + return _AllTabPages; + } + } private void DefaultsBtn_Click(object sender, EventArgs e) { diff --git a/BizHawk.MultiClient/config/PathManager.cs b/BizHawk.MultiClient/config/PathManager.cs index 9caed2296a..b0871c66a3 100644 --- a/BizHawk.MultiClient/config/PathManager.cs +++ b/BizHawk.MultiClient/config/PathManager.cs @@ -71,10 +71,6 @@ namespace BizHawk.MultiClient public static string GetPlatformBase(string system) { - if (system == "SGX" || system == "PCECD") - { - system = "PCE"; - } return Global.Config.PathEntries[system, "Base"].Path; } @@ -187,10 +183,7 @@ namespace BizHawk.MultiClient public static bool IsRecent(string path) { - if (path == "%recent%") - return true; - else - return false; + return path == "%recent%"; } public static string GetLuaPath() @@ -205,15 +198,6 @@ namespace BizHawk.MultiClient return Environment.SpecialFolder.Recent.ToString(); } - if (sysID == "SGX" || sysID == "PCECD") //Yucky - { - sysID = "PCE"; - } - else if (sysID == "NULL") - { - sysID = "Global"; - } - PathEntry path = Global.Config.PathEntries[sysID, "ROM"]; if (path == null) @@ -249,22 +233,7 @@ namespace BizHawk.MultiClient name += "." + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename); } - string sysId = ""; - switch (game.System) - { - case "SGX": - case "PCECD": - sysId = "PCE"; - break; - case "NULL": - sysId = "Global"; - break; - default: - sysId = game.System; - break; - } - - PathEntry pathEntry = Global.Config.PathEntries[sysId, "Save RAM"]; + PathEntry pathEntry = Global.Config.PathEntries[game.System, "Save RAM"]; if (pathEntry == null) { @@ -276,29 +245,14 @@ namespace BizHawk.MultiClient public static string GetSaveStatePath(GameInfo game) { - string sysId = ""; - switch (game.System) - { - case "SGX": - case "PCECD": - sysId = "PCE"; - break; - case "NULL": - sysId = "Global"; - break; - default: - sysId = game.System; - break; - } - - PathEntry pathEntry = Global.Config.PathEntries[sysId, "Savestates"]; + PathEntry pathEntry = Global.Config.PathEntries[game.System, "Savestates"]; if (pathEntry == null) { pathEntry = Global.Config.PathEntries[game.System, "Base"]; } - return MakeAbsolutePath(pathEntry.Path, sysId == "Global" ? null : sysId); + return MakeAbsolutePath(pathEntry.Path, game.System); } public static string SaveStatePrefix(GameInfo game) @@ -310,51 +264,21 @@ namespace BizHawk.MultiClient name += "." + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename); } - string sysId = ""; - switch (game.System) - { - case "SGX": - case "PCECD": - sysId = "PCE"; - break; - case "NULL": - sysId = "Global"; - break; - default: - sysId = game.System; - break; - } - - PathEntry pathEntry = Global.Config.PathEntries[sysId, "Savestates"]; + PathEntry pathEntry = Global.Config.PathEntries[game.System, "Savestates"]; if (pathEntry == null) { - pathEntry = Global.Config.PathEntries[sysId, "Base"]; + pathEntry = Global.Config.PathEntries[game.System, "Base"]; } - return Path.Combine(MakeAbsolutePath(pathEntry.Path, sysId == "Global" ? null : sysId), name); + return Path.Combine(MakeAbsolutePath(pathEntry.Path, game.System), name); } public static string ScreenshotPrefix(GameInfo game) { string name = FilesystemSafeName(game); - string sysId = ""; - switch (game.System) - { - case "SGX": - case "PCECD": - sysId = "PCE"; - break; - case "NULL": - sysId = "Global"; - break; - default: - sysId = game.System; - break; - } - - PathEntry pathEntry = Global.Config.PathEntries[sysId, "Screenshots"]; + PathEntry pathEntry = Global.Config.PathEntries[game.System, "Screenshots"]; if (pathEntry == null) {