diff --git a/Form1.Designer.cs b/Form1.Designer.cs
index a4216d0..6f2006a 100644
--- a/Form1.Designer.cs
+++ b/Form1.Designer.cs
@@ -47,6 +47,7 @@
this.btGrab = new System.Windows.Forms.Button();
this.btDump = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
+ this.cbxInvert = new System.Windows.Forms.CheckBox();
this.btJsKbd = new System.Windows.Forms.Button();
this.IL = new System.Windows.Forms.ImageList(this.components);
this.btBlend = new System.Windows.Forms.Button();
@@ -61,7 +62,6 @@
this.treeView1 = new System.Windows.Forms.TreeView();
this.tc1 = new System.Windows.Forms.TabControl();
this.tabJS1 = new System.Windows.Forms.TabPage();
- this.UC_JoyPanel = new SCJMapper_V2.UC_JoyPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.btClip = new System.Windows.Forms.Button();
this.txRebind = new System.Windows.Forms.TextBox();
@@ -87,6 +87,11 @@
this.btLoadMyMapping = new System.Windows.Forms.Button();
this.txMappingName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
+ this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
+ this.cbxShowJoystick = new System.Windows.Forms.CheckBox();
+ this.cbxShowGamepad = new System.Windows.Forms.CheckBox();
+ this.cbxShowKeyboard = new System.Windows.Forms.CheckBox();
+ this.cbxShowMappedOnly = new System.Windows.Forms.CheckBox();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsDDbtProfiles = new System.Windows.Forms.ToolStripDropDownButton();
this.tsBtReset = new System.Windows.Forms.ToolStripDropDownButton();
@@ -102,7 +107,7 @@
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
- this.cbxInvert = new System.Windows.Forms.CheckBox();
+ this.UC_JoyPanel = new SCJMapper_V2.UC_JoyPanel();
this.cmCopyPaste.SuspendLayout();
this.panel2.SuspendLayout();
this.tc1.SuspendLayout();
@@ -113,6 +118,7 @@
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
+ this.flowLayoutPanel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -241,6 +247,16 @@
this.panel2.Size = new System.Drawing.Size(289, 142);
this.panel2.TabIndex = 17;
//
+ // cbxInvert
+ //
+ this.cbxInvert.AutoSize = true;
+ this.cbxInvert.Location = new System.Drawing.Point(89, 86);
+ this.cbxInvert.Name = "cbxInvert";
+ this.cbxInvert.Size = new System.Drawing.Size(55, 17);
+ this.cbxInvert.TabIndex = 17;
+ this.cbxInvert.Text = "Invert";
+ this.cbxInvert.UseVisualStyleBackColor = true;
+ //
// btJsKbd
//
this.btJsKbd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
@@ -364,9 +380,9 @@
this.treeView1.ImageList = this.IL;
this.treeView1.Location = new System.Drawing.Point(6, 81);
this.treeView1.Name = "treeView1";
- this.tlpanel.SetRowSpan(this.treeView1, 3);
+ this.tlpanel.SetRowSpan(this.treeView1, 2);
this.treeView1.SelectedImageKey = "Selected";
- this.treeView1.Size = new System.Drawing.Size(364, 739);
+ this.treeView1.Size = new System.Drawing.Size(364, 666);
this.treeView1.TabIndex = 16;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
@@ -395,15 +411,6 @@
this.tabJS1.TabIndex = 0;
this.tabJS1.Text = "Joystick 1";
//
- // UC_JoyPanel
- //
- this.UC_JoyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.UC_JoyPanel.JsAssignment = 0;
- this.UC_JoyPanel.Location = new System.Drawing.Point(3, 3);
- this.UC_JoyPanel.Name = "UC_JoyPanel";
- this.UC_JoyPanel.Size = new System.Drawing.Size(275, 315);
- this.UC_JoyPanel.TabIndex = 0;
- //
// panel1
//
this.tlpanel.SetColumnSpan(this.panel1, 3);
@@ -517,6 +524,7 @@
this.tlpanel.Controls.Add(this.tableLayoutPanel1, 1, 2);
this.tlpanel.Controls.Add(this.tableLayoutPanel2, 1, 3);
this.tlpanel.Controls.Add(this.tableLayoutPanel3, 2, 3);
+ this.tlpanel.Controls.Add(this.flowLayoutPanel2, 0, 3);
this.tlpanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tlpanel.Location = new System.Drawing.Point(0, 0);
@@ -696,6 +704,68 @@
this.label1.TabIndex = 16;
this.label1.Text = "Mapping name:";
//
+ // flowLayoutPanel2
+ //
+ this.flowLayoutPanel2.Controls.Add(this.cbxShowJoystick);
+ this.flowLayoutPanel2.Controls.Add(this.cbxShowGamepad);
+ this.flowLayoutPanel2.Controls.Add(this.cbxShowKeyboard);
+ this.flowLayoutPanel2.Controls.Add(this.cbxShowMappedOnly);
+ this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flowLayoutPanel2.Location = new System.Drawing.Point(6, 753);
+ this.flowLayoutPanel2.Name = "flowLayoutPanel2";
+ this.flowLayoutPanel2.Size = new System.Drawing.Size(364, 67);
+ this.flowLayoutPanel2.TabIndex = 26;
+ //
+ // cbxShowJoystick
+ //
+ this.cbxShowJoystick.AutoSize = true;
+ this.cbxShowJoystick.Checked = true;
+ this.cbxShowJoystick.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.cbxShowJoystick.Location = new System.Drawing.Point(3, 3);
+ this.cbxShowJoystick.Name = "cbxShowJoystick";
+ this.cbxShowJoystick.Size = new System.Drawing.Size(65, 17);
+ this.cbxShowJoystick.TabIndex = 0;
+ this.cbxShowJoystick.Text = "Joystick";
+ this.cbxShowJoystick.UseVisualStyleBackColor = true;
+ this.cbxShowJoystick.CheckedChanged += new System.EventHandler(this.cbxShowTreeOptions_CheckedChanged);
+ //
+ // cbxShowGamepad
+ //
+ this.cbxShowGamepad.AutoSize = true;
+ this.cbxShowGamepad.Checked = true;
+ this.cbxShowGamepad.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.cbxShowGamepad.Location = new System.Drawing.Point(74, 3);
+ this.cbxShowGamepad.Name = "cbxShowGamepad";
+ this.cbxShowGamepad.Size = new System.Drawing.Size(75, 17);
+ this.cbxShowGamepad.TabIndex = 1;
+ this.cbxShowGamepad.Text = "Gamepad";
+ this.cbxShowGamepad.UseVisualStyleBackColor = true;
+ this.cbxShowGamepad.CheckedChanged += new System.EventHandler(this.cbxShowTreeOptions_CheckedChanged);
+ //
+ // cbxShowKeyboard
+ //
+ this.cbxShowKeyboard.AutoSize = true;
+ this.cbxShowKeyboard.Checked = true;
+ this.cbxShowKeyboard.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.cbxShowKeyboard.Location = new System.Drawing.Point(155, 3);
+ this.cbxShowKeyboard.Name = "cbxShowKeyboard";
+ this.cbxShowKeyboard.Size = new System.Drawing.Size(74, 17);
+ this.cbxShowKeyboard.TabIndex = 1;
+ this.cbxShowKeyboard.Text = "Keyboard";
+ this.cbxShowKeyboard.UseVisualStyleBackColor = true;
+ this.cbxShowKeyboard.CheckedChanged += new System.EventHandler(this.cbxShowTreeOptions_CheckedChanged);
+ //
+ // cbxShowMappedOnly
+ //
+ this.cbxShowMappedOnly.AutoSize = true;
+ this.cbxShowMappedOnly.Location = new System.Drawing.Point(235, 3);
+ this.cbxShowMappedOnly.Name = "cbxShowMappedOnly";
+ this.cbxShowMappedOnly.Size = new System.Drawing.Size(94, 17);
+ this.cbxShowMappedOnly.TabIndex = 1;
+ this.cbxShowMappedOnly.Text = "Mapped only";
+ this.cbxShowMappedOnly.UseVisualStyleBackColor = true;
+ this.cbxShowMappedOnly.CheckedChanged += new System.EventHandler(this.cbxShowTreeOptions_CheckedChanged);
+ //
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.BackColor = System.Drawing.Color.DarkKhaki;
@@ -841,15 +911,14 @@
this.statusStrip1.TabIndex = 26;
this.statusStrip1.Text = "statusStrip1";
//
- // cbxInvert
+ // UC_JoyPanel
//
- this.cbxInvert.AutoSize = true;
- this.cbxInvert.Location = new System.Drawing.Point(89, 86);
- this.cbxInvert.Name = "cbxInvert";
- this.cbxInvert.Size = new System.Drawing.Size(55, 17);
- this.cbxInvert.TabIndex = 17;
- this.cbxInvert.Text = "Invert";
- this.cbxInvert.UseVisualStyleBackColor = true;
+ this.UC_JoyPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.UC_JoyPanel.JsAssignment = 0;
+ this.UC_JoyPanel.Location = new System.Drawing.Point(3, 3);
+ this.UC_JoyPanel.Name = "UC_JoyPanel";
+ this.UC_JoyPanel.Size = new System.Drawing.Size(275, 315);
+ this.UC_JoyPanel.TabIndex = 0;
//
// MainForm
//
@@ -881,6 +950,8 @@
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
+ this.flowLayoutPanel2.ResumeLayout(false);
+ this.flowLayoutPanel2.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
@@ -959,6 +1030,11 @@
private System.Windows.Forms.Button btBlend;
private System.Windows.Forms.Button btClip;
private System.Windows.Forms.CheckBox cbxInvert;
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
+ private System.Windows.Forms.CheckBox cbxShowJoystick;
+ private System.Windows.Forms.CheckBox cbxShowGamepad;
+ private System.Windows.Forms.CheckBox cbxShowKeyboard;
+ private System.Windows.Forms.CheckBox cbxShowMappedOnly;
}
}
diff --git a/Form1.cs b/Form1.cs
index da7c3cd..89e6aa5 100644
--- a/Form1.cs
+++ b/Form1.cs
@@ -618,6 +618,17 @@ namespace SCJMapper_V2
}
}
+
+ // Show options
+
+ private void cbxShowTreeOptions_CheckedChanged( object sender, EventArgs e )
+ {
+ m_AT.DefineShowOptions( cbxShowJoystick.Checked, cbxShowGamepad.Checked, cbxShowKeyboard.Checked, cbxShowMappedOnly.Checked );
+ m_AT.ReloadTreeView( );
+ }
+
+
+
// Assign Panel Items
private void btFind_Click( object sender, EventArgs e )
@@ -1184,6 +1195,5 @@ namespace SCJMapper_V2
-
}
}
diff --git a/Form1.resx b/Form1.resx
index 24c2ef9..9b2e4f8 100644
--- a/Form1.resx
+++ b/Form1.resx
@@ -391,8 +391,8 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ
- DgAAAk1TRnQBSQFMAgEBBwEAAcgBCgHIAQoBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAg
+ DgAAAk1TRnQBSQFMAgEBBwEAASgBCwEoAQsBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -441,18 +441,18 @@
AfIB/w1QAZkB/wIAAQ4B7wETAeoBFQEPAZEBDwEOBfEBAAH/Ae0BvAnyAfABBwEAAf8B8gSzAboBiwEp
BHgBUQFrAfIB/w5QAf8EAAFtAREBQwEQARUB8QL/AfQC/wIAAf8B9wHxCPIB8QHwAbwBAAH/AfIEswG6
AbsBKAJ4AVABeAEoAWsB8gH/ASkMUAEoAf8EAAG7AbQBkQFtCQAB/wGSAfEB8gbzAfIC8QHwAQAB/wHz
- BLMBuQG6AdwBtAFJAlABSQFrAfMC/wFQBXgBVwRRASkC/wMAAfMBAAGRARMLAAGSAfEB8gbzAfIB8QHy
- AfMBAAH/AfMGuQG6AdsD3AHbAWsB8wf/ASgEVwFQA/8DAAHwAQ4B7AEVCwAB7QHxAfIG8wHyAfEB8gH/
- AQAB/wHzDNoBiwHzBv8BmQR4AVcE/wEAAfEBAAEHAe0B7AGuAfIKAAEHAvIG8wHyAfEB8gIAAf8P8wb/
- ASkEeAX/AQABbgF5AbwB9wETAfAMAALyBvMB8gHxAfQCAAH/CPMB8gH3AfIB9wHyAfcB8wb/ARwDeAb/
- Ae0B6wG8Au8OAALxBvIC8QMAAf8B8w3/Ae8H/wGZAVAI/wETAfAB6hwAIP8CAAHzAfcB/xsAAUIBTQE+
- BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYAA/8BAAT/AfgBDwIAAZ8B/QL/AfABBwIAAY8B+AHf
- Af0B4AEDAgABjwHwAY8B8AHAAQECAAEDAeABBwHwAYABAQUAAoABAQIAAYABAAGAAQABgAEBAgABgAEA
- AYABAAGAAQECAAGAAQABgAEAAYABAQIAAYABAQGAAQABgAEBAgABwAEBAcABAQGAAQECAAHAAQEBwwHh
- AcABAwIAAeABAwHnAeMB4AEHAgAE/wHwAQ8CAAb/AgAG/wYAAfwBPwL/BAAB+AEPAeABAwQAAfABDwHA
- AQEEAAHAAQcBgAEBBAABgAEHAYABAQQAAYABAAGAAQEEAAHAAQABgAEBBAAB4AEBAYABAQQAAeAB/wGA
- AQEEAAHgAf8BwAEBBAAB4QH/AcABAQQAAYAB/wHAAQMEAAGBAf8B4AEDBAABAwH/AeABBwQAAQcD/wQA
- AccD/ws=
+ BLMBuQG6AdwBtAFJAlABSQFrAfMC/wFQBXgBVwRRASkC/wMAAfMBAAGRARMLAAGSAfEB8gLzAQcBkgLz
+ AfIB8QHyAfMBAAH/AfMGuQG6AdsD3AHbAWsB8wf/ASgEVwFQA/8DAAHwAQ4B7AEVCwAB7QHxAfIC8wHt
+ Ae8C8wHyAfEB8gH/AQAB/wHzDNoBiwHzBv8BmQR4AVcE/wEAAfEBAAEHAe0B7AGuAfIKAAEHAvIC8wG8
+ A/MB8gHxAfICAAH/D/MG/wEpBHgF/wEAAW4BeQG8AfcBEwHwDAAC8gbzAfIB8QH0AgAB/wjzAfIB9wHy
+ AfcB8gH3AfMG/wEcA3gG/wHtAesBvALvDgAC8QbyAvEDAAH/AfMN/wHvB/8BmQFQCP8BEwHwAeocACD/
+ AgAB8wH3Af8bAAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYAAQEWAAP/AQAE/wH4AQ8CAAGf
+ Af0C/wHwAQcCAAGPAfgB3wH9AeABAwIAAY8B8AGPAfABwAEBAgABAwHgAQcB8AGAAQEFAAKAAQECAAGA
+ AQABgAEAAYABAQIAAYABAAGAAQABgAEBAgABgAEAAYABAAGAAQECAAGAAQEBgAEAAYABAQIAAcABAQHA
+ AQEBgAEBAgABwAEBAcMB4QHAAQMCAAHgAQMB5wHjAeABBwIABP8B8AEPAgAG/wIABv8GAAH8AT8C/wQA
+ AfgBDwHgAQMEAAHwAQ8BwAEBBAABwAEHAYABAQQAAYABBwGAAQEEAAGAAQABgAEBBAABwAEAAYABAQQA
+ AeABAQGAAQEEAAHgAf8BgAEBBAAB4AH/AcABAQQAAeEB/wHAAQEEAAGAAf8BwAEDBAABgQH/AeABAwQA
+ AQMB/wHgAQcEAAEHA/8EAAHHA/8L
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
index 9da375a..772d714 100644
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion( "2.8.0.36" )]
-[assembly: AssemblyFileVersion( "2.8.0.36" )]
+[assembly: AssemblyVersion( "2.8.0.37" )]
+[assembly: AssemblyFileVersion( "2.8.0.37" )]
diff --git a/SCJMapper-V2.csproj b/SCJMapper-V2.csproj
index fd14927..49ee324 100644
--- a/SCJMapper-V2.csproj
+++ b/SCJMapper-V2.csproj
@@ -26,7 +26,7 @@
false
false
true
- 36
+ 37
2.8.0.%2a
false
true
diff --git a/actions/ActionCls.cs b/actions/ActionCls.cs
index 6d95ac2..7e7a48f 100644
--- a/actions/ActionCls.cs
+++ b/actions/ActionCls.cs
@@ -17,6 +17,26 @@ namespace SCJMapper_V2
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
+
+ public enum ActionDevice
+ {
+ AD_Unknown = -1,
+ AD_Joystick = 0,
+ AD_Gamepad,
+ AD_Keyboard,
+ }
+
+ static public ActionDevice ADevice( String device )
+ {
+ switch ( device.ToLower( ) ) {
+ case KeyboardCls.DeviceClass: return ActionDevice.AD_Keyboard;
+ case JoystickCls.DeviceClass: return ActionDevice.AD_Joystick;
+ case GamepadCls.DeviceClass: return ActionDevice.AD_Gamepad;
+ case "ps3pad": return ActionDevice.AD_Gamepad;
+ default: return ActionDevice.AD_Unknown;
+ }
+ }
+
// Static items to have this mapping in only one place
///
@@ -29,7 +49,7 @@ namespace SCJMapper_V2
switch ( device.ToLower( ) ) {
case KeyboardCls.DeviceClass: return "K";
case JoystickCls.DeviceClass: return "J";
- case "xboxpad": return "X";
+ case GamepadCls.DeviceClass: return "X";
case "ps3pad": return "P";
default: return "Z";
}
@@ -45,7 +65,7 @@ namespace SCJMapper_V2
switch ( devID ) {
case "K": return KeyboardCls.DeviceClass;
case "J": return JoystickCls.DeviceClass;
- case "X": return "xboxpad";
+ case "X": return GamepadCls.DeviceClass;
case "P": return "ps3pad";
default: return "unknown";
}
@@ -59,7 +79,8 @@ namespace SCJMapper_V2
public String device { get; set; }
public String input { get; set; }
public String defBinding { get; set; } // the default binding
- public Boolean inverted { get; set; }
+ public Boolean inverted { get; set; }
+ public ActionDevice actionDevice { get; set; }
///
/// ctor
///
@@ -71,6 +92,7 @@ namespace SCJMapper_V2
input = "";
defBinding = "";
inverted = false;
+ actionDevice = ActionDevice.AD_Unknown;
}
@@ -159,6 +181,7 @@ namespace SCJMapper_V2
input = reader["input"];
if ( ( input == JoystickCls.BlendedInput ) || ( input == GamepadCls.BlendedInput ) ) input = ""; // don't carry jsx_reserved or xi_reserved into the action
key = DevID( device ) + name; // unique id of the action
+ actionDevice = ADevice( device ); // get the enum of the input device
String inv = reader["invert"];
if ( String.IsNullOrWhiteSpace( inv ) ) {
inverted = false;
diff --git a/actions/ActionTree.cs b/actions/ActionTree.cs
index 869bf6e..e710cc3 100644
--- a/actions/ActionTree.cs
+++ b/actions/ActionTree.cs
@@ -33,6 +33,13 @@ namespace SCJMapper_V2
}
}
+
+ private Boolean m_showJoy = true;
+ private Boolean m_showGameP = true;
+ private Boolean m_showKbd = true;
+ private Boolean m_showMappedOnly = false;
+
+
///
/// maintains the change status (gets reset by reloading the complete tree)
///
@@ -152,8 +159,12 @@ namespace SCJMapper_V2
foreach ( ActionTreeNode tn in m_MasterTree.Nodes ) {
// have to search nodes of nodes
foreach ( ActionTreeNode stn in tn.Nodes ) {
+ stn.Tag = null; // default
+ if ( ( !m_showJoy ) && stn.IsJoystickAction ) stn.Tag = true;
+ if ( ( !m_showGameP ) && stn.IsGamepadAction ) stn.Tag = true;
+ if ( ( !m_showKbd ) && stn.IsKeyboardAction ) stn.Tag = true;
+ if ( m_showMappedOnly && ( !stn.IsMappedAction ) ) stn.Tag = true;
if ( !stn.Text.Contains( m_Filter ) ) stn.Tag = hidden;
- else stn.Tag = null;
}
}
ApplyFilter( ); // to the GUI tree
@@ -223,7 +234,8 @@ namespace SCJMapper_V2
cn.BackColor = Color.White; // some stuff does not work properly...
Array.Resize( ref cnl, cnl.Length + 1 ); cnl[cnl.Length - 1] = cn;
- ac = new ActionCls( ); ac.key = cn.Name; ac.name = action; ac.device = device; ac.defBinding = defBinding;
+ ac = new ActionCls( ); ac.key = cn.Name; ac.name = action; ac.device = device; ac.actionDevice = ActionCls.ADevice( device ); ac.defBinding = defBinding;
+ cn.ActionDevice = ac.actionDevice; // should be known now
acm.Add( ac ); // add to our map
if ( applyDefaults ) {
@@ -423,6 +435,21 @@ namespace SCJMapper_V2
}
}
+ ///
+ /// Defines what to show in the tree
+ ///
+ /// True to show Joystick actions
+ /// True to show Gamepad actions
+ /// True to show Keyboard actions
+ /// True to show mapped actions only
+ public void DefineShowOptions(Boolean showJoystick, Boolean showGamepad, Boolean showKeyboard, Boolean showMappedOnly)
+ {
+ m_showJoy = showJoystick;
+ m_showGameP = showGamepad;
+ m_showKbd = showKeyboard;
+ m_showMappedOnly = showMappedOnly;
+ }
+
///
/// Loads the mappings back into the treeview control
diff --git a/actions/ActionTreeNode.cs b/actions/ActionTreeNode.cs
index d95963c..e34a281 100644
--- a/actions/ActionTreeNode.cs
+++ b/actions/ActionTreeNode.cs
@@ -36,11 +36,16 @@ namespace SCJMapper_V2
action = ""; cmd = ""; mod = ( nodeText.Contains( INV_MOD ) ) ? INV_MOD : REG_MOD;
String[] e = nodeText.Split( new char[] { REG_MOD, INV_MOD }, StringSplitOptions.RemoveEmptyEntries );
if ( e.Length > 1 ) {
- action = e[0].Trim( );
- cmd = e[1].Trim( );
+ action = e[0].TrimEnd( );
+ if ( e[1] == " " + DeviceCls.BlendedInput ) {
+ cmd = e[1];
+ }
+ else {
+ cmd = e[1].Trim( );
+ }
}
else if ( e.Length > 0 ) {
- action = e[0].Trim( );
+ action = e[0].TrimEnd( );
cmd = "";
}
}
@@ -88,12 +93,15 @@ namespace SCJMapper_V2
#endregion
+ // Object defs
+ // ctor
public ActionTreeNode( )
: base( )
{
}
+ // ctor
public ActionTreeNode( ActionTreeNode srcNode )
: base( )
{
@@ -106,44 +114,28 @@ namespace SCJMapper_V2
this.ImageKey = srcNode.ImageKey;
this.Tag = srcNode.Tag;
this.m_action = srcNode.m_action;
+ this.m_actionDevice = srcNode.m_actionDevice;
this.m_command = srcNode.m_command;
this.m_modifier = srcNode.m_modifier;
}
+ // ctor
public ActionTreeNode( string text )
{
this.Text = text;
}
+ // ctor
public ActionTreeNode( string text, ActionTreeNode[] children )
: base( text, children )
{
}
- ///
- /// Instantiates a copy of the node - copies only the needed properties
- ///
- /// A source node
- /// A new TreeNode
- private ActionTreeNode TNCopy( ActionTreeNode srcNode )
- {
- if ( srcNode == null ) return null;
-
- ActionTreeNode nn = new ActionTreeNode( );
- nn.Name = srcNode.Name;
- nn.Text = srcNode.Text;
- nn.BackColor = srcNode.BackColor;
- nn.ForeColor = srcNode.ForeColor;
- nn.NodeFont = srcNode.NodeFont;
- nn.ImageKey = srcNode.ImageKey;
- return nn;
- }
-
-
private String m_action = "";
private String m_command ="";
private char m_modifier = REG_MOD;
+ private ActionCls.ActionDevice m_actionDevice = ActionCls.ActionDevice.AD_Unknown;
public new String Text
{
@@ -186,6 +178,37 @@ namespace SCJMapper_V2
}
}
+ public ActionCls.ActionDevice ActionDevice
+ {
+ get { return m_actionDevice; }
+ set
+ {
+ m_actionDevice = value;
+ }
+ }
+
+ public Boolean IsJoystickAction
+ {
+ get { return ( m_actionDevice == ActionCls.ActionDevice.AD_Joystick ); }
+ }
+
+ public Boolean IsGamepadAction
+ {
+ get { return ( m_actionDevice == ActionCls.ActionDevice.AD_Gamepad ); }
+ }
+
+ public Boolean IsKeyboardAction
+ {
+ get { return ( m_actionDevice == ActionCls.ActionDevice.AD_Keyboard ); }
+ }
+
+ public Boolean IsMappedAction
+ {
+ get { return !( String.IsNullOrEmpty(m_command)
+ || ( m_command == JoystickCls.BlendedInput )
+ || ( m_command == GamepadCls.BlendedInput ) );
+ }
+ }
}
diff --git a/graphics/keyboard_key_hash.ico b/graphics/keyboard_key_hash.ico
new file mode 100644
index 0000000..4327702
Binary files /dev/null and b/graphics/keyboard_key_hash.ico differ