diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 51ed7063cd..8f462d6084 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common { if (AllTrollers.Count == 0 && AllTrollersAutoFire.Count == 0 && AllTrollersAnalog.Count == 0) { - var cd = ConfigService.Load(ControlDefaultPath); + var cd = ConfigService.Load(ControlDefaultPath); AllTrollers = cd.AllTrollers; AllTrollersAutoFire = cd.AllTrollersAutoFire; AllTrollersAnalog = cd.AllTrollersAnalog; @@ -382,8 +382,6 @@ namespace BizHawk.Client.Common public int Analog_LargeChange = 10; public int Analog_SmallChange = 1; - - // [ControllerType][ButtonName] => Physical Bind public Dictionary> AllTrollers = new Dictionary>(); public Dictionary> AllTrollersAutoFire = new Dictionary>(); @@ -405,12 +403,4 @@ namespace BizHawk.Client.Common public string LastWrittenFrom = VersionInfo.Mainversion; public string LastWrittenFromDetailed = VersionInfo.GetEmuVersion(); } - - // These are used in the defctrl.json or wherever - public class ControlDefaults - { - public Dictionary> AllTrollers = new Dictionary>(); - public Dictionary> AllTrollersAutoFire = new Dictionary>(); - public Dictionary> AllTrollersAnalog = new Dictionary>(); - } } \ No newline at end of file diff --git a/BizHawk.Client.Common/config/DefaultControls.cs b/BizHawk.Client.Common/config/DefaultControls.cs new file mode 100644 index 0000000000..03515f95a1 --- /dev/null +++ b/BizHawk.Client.Common/config/DefaultControls.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace BizHawk.Client.Common +{ + // Represents the defaults used in defctrl.json + public class DefaultControls + { + public Dictionary> AllTrollers = new Dictionary>(); + public Dictionary> AllTrollersAutoFire = new Dictionary>(); + public Dictionary> AllTrollersAnalog = new Dictionary>(); + } +} diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index ff946337f1..524003ae93 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -237,7 +237,7 @@ namespace BizHawk.Client.EmuHawk } } - private void LoadPanels(ControlDefaults cd) + private void LoadPanels(DefaultControls cd) { LoadPanels(cd.AllTrollers, cd.AllTrollersAutoFire, cd.AllTrollersAnalog); } @@ -323,7 +323,7 @@ namespace BizHawk.Client.EmuHawk ActOnControlCollection(AnalogControlsTab, c => c.Save(_config.AllTrollersAnalog[_emulator.ControllerDefinition.Name])); } - private void SaveToDefaults(ControlDefaults cd) + private void SaveToDefaults(DefaultControls cd) { ActOnControlCollection(NormalControlsTab, c => c.Save(cd.AllTrollers[_emulator.ControllerDefinition.Name])); ActOnControlCollection(AutofireControlsTab, c => c.Save(cd.AllTrollersAutoFire[_emulator.ControllerDefinition.Name])); @@ -398,7 +398,7 @@ namespace BizHawk.Client.EmuHawk // load panels directly from the default config. // this means that the changes are NOT committed. so "Cancel" works right and you // still have to hit OK at the end. - var cd = ConfigService.Load(Config.ControlDefaultPath); + var cd = ConfigService.Load(Config.ControlDefaultPath); LoadPanels(cd); tabControl1.SelectTab(wasTabbedMain); @@ -431,7 +431,7 @@ namespace BizHawk.Client.EmuHawk var result = MessageBox.Show(this, "OK to overwrite defaults for current control scheme?", "Save Defaults", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { - var cd = ConfigService.Load(Config.ControlDefaultPath); + var cd = ConfigService.Load(Config.ControlDefaultPath); cd.AllTrollers[_emulator.ControllerDefinition.Name] = new Dictionary(); cd.AllTrollersAutoFire[_emulator.ControllerDefinition.Name] = new Dictionary(); cd.AllTrollersAnalog[_emulator.ControllerDefinition.Name] = new Dictionary(); diff --git a/BizHawk.sln.DotSettings b/BizHawk.sln.DotSettings index 8e26f15d1c..0cb18ba73d 100644 --- a/BizHawk.sln.DotSettings +++ b/BizHawk.sln.DotSettings @@ -229,6 +229,7 @@ True True True + True True True True