controller config: remove some old unused code

This commit is contained in:
goyuken 2013-07-14 02:04:55 +00:00
parent 0825c4181c
commit f7e8273dad
6 changed files with 3 additions and 3386 deletions

View File

@ -166,12 +166,6 @@
<Compile Include="config\AutofireConfig.Designer.cs">
<DependentUpon>AutofireConfig.cs</DependentUpon>
</Compile>
<Compile Include="config\ControllerConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="config\ControllerConfig.Designer.cs">
<DependentUpon>ControllerConfig.cs</DependentUpon>
</Compile>
<Compile Include="config\ControllerConfig\ControllerConfigPanel.cs">
<SubType>UserControl</SubType>
</Compile>
@ -572,9 +566,6 @@
<EmbeddedResource Include="AVOut\VideoWriterChooserForm.resx">
<DependentUpon>VideoWriterChooserForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="config\ControllerConfig.resx">
<DependentUpon>ControllerConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="config\ControllerConfig\ControllerConfigPanel.resx">
<DependentUpon>ControllerConfigPanel.cs</DependentUpon>
</EmbeddedResource>

View File

@ -2804,7 +2804,7 @@ namespace BizHawk.MultiClient
//modals that need to capture input for binding purposes get input, of course
if (ActiveForm is HotkeyWindow) return true;
if (ActiveForm is ControllerConfig) return true;
//if (ActiveForm is ControllerConfig) return true;
if (ActiveForm is config.NewControllerConfig) return true;
if (ActiveForm is TAStudio) return true;
//if no form is active on this process, then the background input setting applies

File diff suppressed because it is too large Load Diff

View File

@ -1,389 +0,0 @@
using System;
using System.Windows.Forms;
namespace BizHawk.MultiClient
{
public partial class ControllerConfig : Form
{
//TODO: autoab
public ControllerConfig()
{
InitializeComponent();
}
private void ControllerConfig_Load(object sender, EventArgs e)
{
/*
AllowLR.Checked = Global.Config.AllowUD_LR;
NESController1Panel.LoadSettings(Global.Config.NESController[0]);
NESController2Panel.LoadSettings(Global.Config.NESController[1]);
NESController3Panel.LoadSettings(Global.Config.NESController[2]);
NESController4Panel.LoadSettings(Global.Config.NESController[3]);
NESConsoleButtons.LoadSettings(Global.Config.NESConsoleButtons);
NESAutofire1Panel.LoadSettings(Global.Config.NESAutoController[0]);
NESAutofire2Panel.LoadSettings(Global.Config.NESAutoController[1]);
NESAutofire3Panel.LoadSettings(Global.Config.NESAutoController[2]);
NESAutofire4Panel.LoadSettings(Global.Config.NESAutoController[3]);
N64Controller1Panel.InputSize = 110;
N64Controller1Panel.LabelWidth = 50;
N64Controller1Panel.ColumnWidth = 170;
N64Autofire1Panel.InputSize = 110;
N64Autofire1Panel.LabelWidth = 50;
N64Autofire1Panel.ColumnWidth = 170;
N64Controller2Panel.InputSize = 110;
N64Controller2Panel.LabelWidth = 50;
N64Controller2Panel.ColumnWidth = 170;
N64Autofire2Panel.InputSize = 110;
N64Autofire2Panel.LabelWidth = 50;
N64Autofire2Panel.ColumnWidth = 170;
N64Controller3Panel.InputSize = 110;
N64Controller3Panel.LabelWidth = 50;
N64Controller3Panel.ColumnWidth = 170;
N64Autofire3Panel.InputSize = 110;
N64Autofire3Panel.LabelWidth = 50;
N64Autofire3Panel.ColumnWidth = 170;
N64Controller4Panel.InputSize = 110;
N64Controller4Panel.LabelWidth = 50;
N64Controller4Panel.ColumnWidth = 170;
N64Autofire4Panel.InputSize = 110;
N64Autofire4Panel.LabelWidth = 50;
N64Autofire4Panel.ColumnWidth = 170;
N64Controller1Panel.LoadSettings(Global.Config.N64Controller[0]);
N64Controller2Panel.LoadSettings(Global.Config.N64Controller[1]);
N64Controller3Panel.LoadSettings(Global.Config.N64Controller[2]);
N64Controller4Panel.LoadSettings(Global.Config.N64Controller[3]);
N64ConsoleButtons.LoadSettings(Global.Config.N64ConsoleButtons);
N64Autofire1Panel.LoadSettings(Global.Config.N64AutoController[0]);
N64Autofire2Panel.LoadSettings(Global.Config.N64AutoController[1]);
N64Autofire3Panel.LoadSettings(Global.Config.N64AutoController[2]);
N64Autofire4Panel.LoadSettings(Global.Config.N64AutoController[3]);
SaturnController1Panel.Spacing = 25;
SaturnController1Panel.LoadSettings(Global.Config.SaturnController[0]);
SaturnController2Panel.Spacing = 25;
SaturnController2Panel.LoadSettings(Global.Config.SaturnController[1]);
SaturnConsoleButtons.Spacing = 25;
SaturnConsoleButtons.LoadSettings(Global.Config.SaturnConsoleButtons);
SaturnAutofire1Panel.Spacing = 25;
SaturnAutofire1Panel.LoadSettings(Global.Config.SaturnAutoController[0]);
SaturnAutofire2Panel.Spacing = 25;
SaturnAutofire2Panel.LoadSettings(Global.Config.SaturnAutoController[1]);
SNESController1Panel.Spacing = 25;
SNESController2Panel.Spacing = 25;
SNESController3Panel.Spacing = 25;
SNESController4Panel.Spacing = 25;
SNESAutofire1Panel.Spacing = 25;
SNESAutofire2Panel.Spacing = 25;
SNESAutofire3Panel.Spacing = 25;
SNESAutofire4Panel.Spacing = 25;
SNESController1Panel.LoadSettings(Global.Config.SNESController[0]);
SNESController2Panel.LoadSettings(Global.Config.SNESController[1]);
SNESController3Panel.LoadSettings(Global.Config.SNESController[2]);
SNESController4Panel.LoadSettings(Global.Config.SNESController[3]);
SNESConsoleButtons.LoadSettings(Global.Config.SNESConsoleButtons);
SNESAutofire1Panel.LoadSettings(Global.Config.SNESAutoController[0]);
SNESAutofire2Panel.LoadSettings(Global.Config.SNESAutoController[1]);
SNESAutofire3Panel.LoadSettings(Global.Config.SNESAutoController[2]);
SNESAutofire4Panel.LoadSettings(Global.Config.SNESAutoController[3]);
GBController1Panel.LoadSettings(Global.Config.GBController[0]);
GBAutofire1Panel.LoadSettings(Global.Config.GBAutoController[0]);
GBDualPanel.Spacing = 24;
GBDualPanel.InputSize = 190;
GBDualPanel.LabelPadding = 5;
GBDualPanel.ColumnWidth = 250;
GBDualPanel.LabelWidth = 50;
GBDualPanel.LoadSettings(Global.Config.DualGBController[0]);
GBDualAutofirePanel.Spacing = 24;
GBDualAutofirePanel.InputSize = 190;
GBDualAutofirePanel.LabelPadding = 5;
GBDualAutofirePanel.ColumnWidth = 250;
GBDualAutofirePanel.LabelWidth = 50;
GBDualAutofirePanel.LoadSettings(Global.Config.AutoDualGBController[0]);
GBAController1Panel.LoadSettings(Global.Config.GBAController[0]);
GBAAutofire1Panel.LoadSettings(Global.Config.GBAAutoController[0]);
GenesisController1Panel.LoadSettings(Global.Config.GenesisController[0]);
GenesisAutofire1Panel.LoadSettings(Global.Config.GenesisAutoController[0]);
GenesisConsoleButtons.LoadSettings(Global.Config.GenesisConsoleButtons);
SMSController1Panel.LoadSettings(Global.Config.SMSController[0]);
SMSController2Panel.LoadSettings(Global.Config.SMSController[1]);
SMSConsoleButtons.LoadSettings(Global.Config.SMSConsoleButtons);
SMSAutofire1Panel.LoadSettings(Global.Config.SMSAutoController[0]);
SMSAutofire2Panel.LoadSettings(Global.Config.SMSAutoController[1]);
PCEController1Panel.LoadSettings(Global.Config.PCEController[0]);
PCEController2Panel.LoadSettings(Global.Config.PCEController[1]);
PCEController3Panel.LoadSettings(Global.Config.PCEController[2]);
PCEController4Panel.LoadSettings(Global.Config.PCEController[3]);
PCEController5Panel.LoadSettings(Global.Config.PCEController[4]);
PCEAutofire1Panel.LoadSettings(Global.Config.PCEAutoController[0]);
PCEAutofire2Panel.LoadSettings(Global.Config.PCEAutoController[1]);
PCEAutofire3Panel.LoadSettings(Global.Config.PCEAutoController[2]);
PCEAutofire4Panel.LoadSettings(Global.Config.PCEAutoController[3]);
PCEAutofire5Panel.LoadSettings(Global.Config.PCEAutoController[4]);
Atari2600Controller1Panel.LoadSettings(Global.Config.Atari2600Controller[0]);
Atari2600Controller2Panel.LoadSettings(Global.Config.Atari2600Controller[1]);
Atari2600ConsoleButtons.LoadSettings(Global.Config.Atari2600ConsoleButtons[0]);
Atari2600Autofire1Panel.LoadSettings(Global.Config.Atari2600AutoController[0]);
Atari2600Autofire2Panel.LoadSettings(Global.Config.Atari2600AutoController[1]);
Atari7800Controller1Panel.LoadSettings(Global.Config.Atari7800Controller[0]);
Atari7800Controller2Panel.LoadSettings(Global.Config.Atari7800Controller[1]);
Atari7800ConsoleButtons.LoadSettings(Global.Config.Atari7800ConsoleButtons[0]);
Atari7800Autofire1Panel.LoadSettings(Global.Config.Atari7800AutoController[0]);
Atari7800Autofire2Panel.LoadSettings(Global.Config.Atari7800AutoController[1]);
TI83ControllerPanel.Spacing = 24;
TI83ControllerPanel.InputSize = 110;
TI83ControllerPanel.LabelPadding = 5;
TI83ControllerPanel.ColumnWidth = 170;
TI83ControllerPanel.LabelWidth = 50;
TI83ControllerPanel.LoadSettings(Global.Config.TI83Controller[0]);
C64Controller1Panel.LoadSettings(Global.Config.C64Joysticks[0]);
C64Controller2Panel.LoadSettings(Global.Config.C64Joysticks[1]);
C64Autofire1Panel.LoadSettings(Global.Config.C64AutoJoysticks[0]);
C64Autofire2Panel.LoadSettings(Global.Config.C64AutoJoysticks[1]);
C64KeyboardPanel.Spacing = 23;
C64KeyboardPanel.InputSize = 70;
C64KeyboardPanel.LabelPadding = 4;
C64KeyboardPanel.ColumnWidth = 130;
C64KeyboardPanel.LabelWidth = 55;
C64KeyboardPanel.LoadSettings(Global.Config.C64Keyboard);
COLController1Panel.InputSize = 110;
COLController1Panel.LabelWidth = 50;
COLController1Panel.ColumnWidth = 170;
COLController1Panel.LoadSettings(Global.Config.ColecoController[0]);
COLAutofire1Panel.InputSize = 110;
COLAutofire1Panel.LabelWidth = 50;
COLAutofire1Panel.ColumnWidth = 170;
COLAutofire1Panel.LoadSettings(Global.Config.ColecoAutoController[0]);
COLController2Panel.InputSize = 110;
COLController2Panel.LabelWidth = 50;
COLController2Panel.ColumnWidth = 170;
COLController2Panel.LoadSettings(Global.Config.ColecoController[1]);
COLAutofire2Panel.InputSize = 110;
COLAutofire2Panel.LabelWidth = 50;
COLAutofire2Panel.ColumnWidth = 170;
COLAutofire2Panel.LoadSettings(Global.Config.ColecoAutoController[1]);
INTVController1Panel.InputSize = 110;
INTVController1Panel.LabelWidth = 50;
INTVController1Panel.ColumnWidth = 170;
INTVController1Panel.LoadSettings(Global.Config.IntellivisionController[0]);
INTVAutofire1Panel.InputSize = 110;
INTVAutofire1Panel.LabelWidth = 50;
INTVAutofire1Panel.ColumnWidth = 170;
INTVAutofire1Panel.LoadSettings(Global.Config.IntellivisionAutoController[0]);
INTVController2Panel.InputSize = 110;
INTVController2Panel.LabelWidth = 50;
INTVController2Panel.ColumnWidth = 170;
INTVController2Panel.LoadSettings(Global.Config.IntellivisionController[1]);
INTVAutofire2Panel.InputSize = 110;
INTVAutofire2Panel.LabelWidth = 50;
INTVAutofire2Panel.ColumnWidth = 170;
INTVAutofire2Panel.LoadSettings(Global.Config.IntellivisionAutoController[1]);
*/
SetTabByPlatform();
if (!MainForm.INTERIM)
{
PlatformTabControl.Controls.Remove(tabPageC64);
PlatformTabControl.Controls.Remove(tabPageGBA);
PlatformTabControl.Controls.Remove(tabPageINTV);
}
AutoTab.Checked = Global.Config.InputConfigAutoTab;
SetAutoTab();
}
private void SetTabByPlatform()
{
switch (Global.Emulator.SystemId)
{
case "NES":
case "FDS":
PlatformTabControl.SelectTab(tabPageNES);
break;
case "SNES":
case "SGB": //TODO: I think it never reports this, so this line could/should be removed
PlatformTabControl.SelectTab(tabPageSNES);
break;
case "GB":
case "GBC":
PlatformTabControl.SelectTab(tabPageGameboy);
break;
case "GBA":
PlatformTabControl.SelectTab(tabPageGBA);
break;
case "GEN":
PlatformTabControl.SelectTab(tabPageGenesis);
break;
case "SMS":
case "GG":
case "SG":
PlatformTabControl.SelectTab(tabPageSMS);
break;
case "PCE":
case "SGX":
case "PCECD":
PlatformTabControl.SelectTab(tabPagePCE);
break;
case "A26":
PlatformTabControl.SelectTab(tabPageAtari2600);
break;
case "A78":
PlatformTabControl.SelectTab(tabPageAtari7800);
break;
case "C64":
PlatformTabControl.SelectTab(tabPageC64);
break;
case "Coleco":
PlatformTabControl.SelectTab(tabPageColeco);
break;
case "INTV":
PlatformTabControl.SelectTab(tabPageINTV);
break;
case "TI83":
PlatformTabControl.SelectTab(tabPageTI83);
break;
case "N64":
PlatformTabControl.SelectTab(tabPageN64);
break;
case "SAT":
PlatformTabControl.SelectTab(tabPageSaturn);
break;
}
}
private void SetAutoTab()
{
bool setting = AutoTab.Checked;
foreach (Control control1 in PlatformTabControl.TabPages)
{
if (control1 is TabPage)
{
foreach (Control control2 in control1.Controls)
{
if (control2 is ControllerConfigPanel)
{
(control2 as ControllerConfigPanel).SetAutoTab(setting);
}
else if (control2 is TabControl)
{
foreach (Control control3 in (control2 as TabControl).TabPages)
{
if (control3 is TabPage)
{
foreach (Control control4 in control3.Controls)
{
if (control4 is ControllerConfigPanel)
{
(control4 as ControllerConfigPanel).SetAutoTab(setting);
}
}
}
else if (control3 is ControllerConfigPanel)
{
(control3 as ControllerConfigPanel).SetAutoTab(setting);
}
}
}
}
}
else if (control1 is ControllerConfigPanel)
{
(control1 as ControllerConfigPanel).SetAutoTab(setting);
}
}
}
private void OK_Click(object sender, EventArgs e)
{
Global.Config.AllowUD_LR = AllowLR.Checked;
foreach (Control control1 in PlatformTabControl.TabPages)
{
if (control1 is TabPage)
{
foreach (Control control2 in control1.Controls)
{
if (control2 is ControllerConfigPanel)
{
(control2 as ControllerConfigPanel).Save();
}
else if (control2 is TabControl)
{
foreach (Control control3 in (control2 as TabControl).TabPages)
{
if (control3 is TabPage)
{
foreach (Control control4 in control3.Controls)
{
if (control4 is ControllerConfigPanel)
{
(control4 as ControllerConfigPanel).Save();
}
}
}
else if (control3 is ControllerConfigPanel)
{
(control3 as ControllerConfigPanel).Save();
}
}
}
}
}
else
{
if (control1 is ControllerConfigPanel)
{
(control1 as ControllerConfigPanel).Save();
}
}
}
Global.OSD.AddMessage("Controller settings saved");
DialogResult = DialogResult.OK;
Close();
}
private void Cancel_Click(object sender, EventArgs e)
{
Global.OSD.AddMessage("Controller config aborted");
Close();
}
private void AutoTab_CheckedChanged(object sender, EventArgs e)
{
Global.Config.HotkeyConfigAutoTab = AutoTab.Checked;
SetAutoTab();
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -7,6 +7,8 @@ using System.Windows.Forms;
namespace BizHawk.MultiClient
{
// this is a little messy right now because of remnants of the old config system
public partial class ControllerConfigPanel : UserControl
{
iControllerConfigObject ControllerConfigObject; //Object that values will be saved to (In Config.cs)