diff --git a/AppSettings.cs b/AppSettings.cs index 68ed75b..530cfbd 100644 --- a/AppSettings.cs +++ b/AppSettings.cs @@ -182,7 +182,7 @@ public Boolean UserSCPathUsed } [UserScopedSettingAttribute( )] - [DefaultSettingValueAttribute( ",multiplayer,player,singleplayer," )] // empty Note: comma separated list, must have a comma at the begining and the end (to find 'player' on its own...) + [DefaultSettingValueAttribute( ",multiplayer,player,flycam,singleplayer," )] // empty Note: comma separated list, must have a comma at the begining and the end (to find 'player' on its own...) public String IgnoreActionmaps { get { return ( String )this["IgnoreActionmaps"]; } diff --git a/Form1.Designer.cs b/Form1.Designer.cs index b0949b9..a5fef1f 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -15,7 +15,7 @@ protected override void Dispose( bool disposing ) { timer1.Stop( ); // Unacquire all DirectInput objects. - foreach ( JoystickCls js in m_JS ) js.FinishDX( ); + foreach ( JoystickCls js in m_Joystick ) js.FinishDX( ); if ( disposing && ( components != null ) ) { components.Dispose( ); diff --git a/Form1.cs b/Form1.cs index 9f6c8f8..4da324e 100644 --- a/Form1.cs +++ b/Form1.cs @@ -24,7 +24,7 @@ public partial class MainForm : Form /// /// Holds the DXInput Joystick List /// - private JoystickList m_JS = new JoystickList( ); + private JoystickList m_Joystick = new JoystickList( ); /// /// Holds the ActionTree that manages the TreeView and the action lists @@ -98,6 +98,7 @@ private void MainForm_Load( object sender, System.EventArgs e ) String version = Application.ProductVersion; // get the version information lblTitle.Text += " - V " + version.Substring( 0, version.IndexOf( ".", version.IndexOf( "." ) + 1 ) ); // get the first two elements + log.InfoFormat( "Application Version: {0}", version.ToString( ) ); // tooltips where needed toolTip1.SetToolTip( this.linkLblReleases, c_GithubLink ); // allow to see where the link may head @@ -244,14 +245,14 @@ private void InitActionTree( Boolean addDefaultBinding ) m_AT.LoadTree( m_AppSettings.DefProfileName, addDefaultBinding ); // Init with default profile filepath // default JS to Joystick mapping - can be changed and reloaded from XML - if ( m_JS.Count > 0 ) { m_JS[0].JSAssignment = 1; m_AT.ActionMaps.js1 = m_JS[0].DevName; m_AT.ActionMaps.js1GUID = m_JS[0].DevInstanceGUID; } - if ( m_JS.Count > 1 ) { m_JS[1].JSAssignment = 2; m_AT.ActionMaps.js2 = m_JS[1].DevName; m_AT.ActionMaps.js2GUID = m_JS[1].DevInstanceGUID; } - if ( m_JS.Count > 2 ) { m_JS[2].JSAssignment = 0; } // unmapped ones go with default 0 - if ( m_JS.Count > 3 ) { m_JS[3].JSAssignment = 0; } - if ( m_JS.Count > 4 ) { m_JS[4].JSAssignment = 0; } - if ( m_JS.Count > 5 ) { m_JS[5].JSAssignment = 0; } - if ( m_JS.Count > 6 ) { m_JS[6].JSAssignment = 0; } - if ( m_JS.Count > 7 ) { m_JS[7].JSAssignment = 0; } + if ( m_Joystick.Count > 0 ) { m_Joystick[0].JSAssignment = 1; m_AT.ActionMaps.jsN[0] = m_Joystick[0].DevName; m_AT.ActionMaps.jsNGUID[0] = m_Joystick[0].DevInstanceGUID; } + if ( m_Joystick.Count > 1 ) { m_Joystick[1].JSAssignment = 2; m_AT.ActionMaps.jsN[1] = m_Joystick[1].DevName; m_AT.ActionMaps.jsNGUID[1] = m_Joystick[1].DevInstanceGUID; } + if ( m_Joystick.Count > 2 ) { m_Joystick[2].JSAssignment = 0; } // unmapped ones go with default 0 + if ( m_Joystick.Count > 3 ) { m_Joystick[3].JSAssignment = 0; } + if ( m_Joystick.Count > 4 ) { m_Joystick[4].JSAssignment = 0; } + if ( m_Joystick.Count > 5 ) { m_Joystick[5].JSAssignment = 0; } + if ( m_Joystick.Count > 6 ) { m_Joystick[6].JSAssignment = 0; } + if ( m_Joystick.Count > 7 ) { m_Joystick[7].JSAssignment = 0; } } @@ -298,7 +299,7 @@ public bool InitDirectInput( ) log.Debug( "Create Joystick instance" ); js = new JoystickCls( jsDevice, this, tabs + 1, uUC_JoyPanelNew, tc1.TabPages[tabs] ); // does all device related activities for that particular item } - m_JS.Add( js ); // add to joystick list + m_Joystick.Add( js ); // add to joystick list tc1.TabPages[tabs].Tag = js.DevName; // used to find the tab via JS mapping tc1.TabPages[tabs].BackColor = MyColors.JColor[tabs]; // each tab has its own color @@ -355,62 +356,32 @@ private void Grab( ) { log.Debug( "Grab - Entry" ); - m_JS.ResetJsNAssignment( ); + m_Joystick.ResetJsNAssignment( ); m_AT.ActionMaps.fromXML( rtb.Text ); - // JS mapping for js1 .. js4 can be changed and reloaded from XML + // JS mapping for js1 .. js8 can be changed and reloaded from XML // note - unmapped ones remain what they were // This is includes similar procedures as reassigning of the jsN items JoystickCls j = null; - if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js1GUID ) ) { - j = m_JS.Find_jsInstance( m_AT.ActionMaps.js1GUID ); - } - else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js1 ) ) { - j = m_JS.Find_jsDev( m_AT.ActionMaps.js1 ); - } - if ( j != null ) { - m_AT.ActionMaps.js1GUID = j.DevInstanceGUID; // subst for missing one (version up etc.) - j.JSAssignment = 1; + + // for all supported jsN + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + j = null; + if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsNGUID[i] ) ) { + j = m_Joystick.Find_jsInstance( m_AT.ActionMaps.jsNGUID[i] ); + } + else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.jsN[i] ) ) { + j = m_Joystick.Find_jsDev( m_AT.ActionMaps.jsN[i] ); + } + if ( j != null ) { + m_AT.ActionMaps.jsNGUID[i] = j.DevInstanceGUID; // subst for missing one (version up etc.) + j.JSAssignment = i+1; + } } - j = null; ; - if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js2GUID ) ) { - j = m_JS.Find_jsInstance( m_AT.ActionMaps.js2GUID ); - } - else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js2 ) ) { - j = m_JS.Find_jsDev( m_AT.ActionMaps.js2 ); - } - if ( j != null ) { - m_AT.ActionMaps.js2GUID = j.DevInstanceGUID; // subst for missing one (version up etc.) - j.JSAssignment = 2; - } - - j = null; ; - if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js3GUID ) ) { - j = m_JS.Find_jsInstance( m_AT.ActionMaps.js3GUID ); - } - else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js3 ) ) { - j = m_JS.Find_jsDev( m_AT.ActionMaps.js3 ); - } - if ( j != null ) { - m_AT.ActionMaps.js3GUID = j.DevInstanceGUID; // subst for missing one (version up etc.) - j.JSAssignment = 3; - } - - j = null; ; - if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js4GUID ) ) { - j = m_JS.Find_jsInstance( m_AT.ActionMaps.js4GUID ); - } - else if ( !String.IsNullOrEmpty( m_AT.ActionMaps.js4 ) ) { - j = m_JS.Find_jsDev( m_AT.ActionMaps.js4 ); - } - if ( j != null ) { - m_AT.ActionMaps.js4GUID = j.DevInstanceGUID; // subst for missing one (version up etc.) - j.JSAssignment = 4; - } // maintain the new JsN assignment and update the colorlist List newL = new List( ); - foreach ( JoystickCls jj in m_JS ) { + foreach ( JoystickCls jj in m_Joystick ) { newL.Add(jj.JSAssignment); } JoystickCls.ReassignJsColor( newL ); @@ -458,8 +429,8 @@ private void MainForm_FormClosing( object sender, FormClosingEventArgs e ) private void timer1_Tick( object sender, System.EventArgs e ) { - foreach ( JoystickCls jsc in m_JS ) { jsc.GetData( ); } // poll the devices - String ctrl = JSStr( ) + m_JS[tc1.SelectedIndex].GetLastChange( ); // show last handled JS control + foreach ( JoystickCls jsc in m_Joystick ) { jsc.GetData( ); } // poll the devices + String ctrl = JSStr( ) + m_Joystick[tc1.SelectedIndex].GetLastChange( ); // show last handled JS control lblLastJ.Text = ctrl; if ( JoystickCls.CanThrottle( ctrl ) ) { cbxThrottle.Enabled = true; @@ -773,7 +744,7 @@ private void btSettings_Click( object sender, EventArgs e ) // indicates (in)valid folders SCFileIndication( ); // now update the contents according to new settings - foreach ( JoystickCls j in m_JS ) j.ApplySettings( ); // update Seetings + foreach ( JoystickCls j in m_Joystick ) j.ApplySettings( ); // update Seetings m_AT.IgnoreMaps = m_AppSettings.IgnoreActionmaps; // and start over with an empty tree InitActionTree( false ); @@ -786,38 +757,21 @@ private void btJsReassign_Click( object sender, EventArgs e ) { // have to stop polling while the Reassign window is open timer1.Enabled = false; - if ( m_JS.ShowReassign( ) != System.Windows.Forms.DialogResult.Cancel ) { + if ( m_Joystick.ShowReassign( ) != System.Windows.Forms.DialogResult.Cancel ) { // copy the action tree while reassigning the jsN mappings from OLD to NEW - ActionTree newTree = m_AT.ReassignJsN( m_JS.JsReassingList ); + ActionTree newTree = m_AT.ReassignJsN( m_Joystick.JsReassingList ); + // we have still the old assignment in the ActionMap - change it here (map does not know about the devices) JoystickCls j = null; - j = m_JS.Find_jsN( 1 ); - if ( j != null ) { - newTree.ActionMaps.js1 = j.DevName; newTree.ActionMaps.js1GUID = j.DevInstanceGUID; - } - else { - newTree.ActionMaps.js1 = ""; newTree.ActionMaps.js1GUID = ""; - } - j = m_JS.Find_jsN( 2 ); - if ( j != null ) { - newTree.ActionMaps.js2 = j.DevName; newTree.ActionMaps.js2GUID = j.DevInstanceGUID; - } - else { - newTree.ActionMaps.js2 = ""; newTree.ActionMaps.js2GUID = ""; - } - j = m_JS.Find_jsN( 3 ); - if ( j != null ) { - newTree.ActionMaps.js3 = j.DevName; newTree.ActionMaps.js3GUID = j.DevInstanceGUID; - } - else { - newTree.ActionMaps.js3 = ""; newTree.ActionMaps.js3GUID = ""; - } - j = m_JS.Find_jsN( 4 ); - if ( j != null ) { - newTree.ActionMaps.js4 = j.DevName; newTree.ActionMaps.js4GUID = j.DevInstanceGUID; - } - else { - newTree.ActionMaps.js4 = ""; newTree.ActionMaps.js4GUID = ""; + // for all supported jsN devices + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + j = m_Joystick.Find_jsN( i+1 ); + if ( j != null ) { + newTree.ActionMaps.jsN[i] = j.DevName; newTree.ActionMaps.jsNGUID[i] = j.DevInstanceGUID; + } + else { + newTree.ActionMaps.jsN[i] = ""; newTree.ActionMaps.jsNGUID[i] = ""; + } } m_AT = newTree; // make it the valid one diff --git a/Joystick/ActionMapsCls.cs b/Joystick/ActionMapsCls.cs index 89aacd2..a410b01 100644 --- a/Joystick/ActionMapsCls.cs +++ b/Joystick/ActionMapsCls.cs @@ -23,22 +23,33 @@ class ActionMapsCls : List private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType ); // actionmap names to gather (do we need them to be cofigurable ??) - public static String[] ActionMaps = { "multiplayer", "singleplayer", "player", "spaceship_general", "spaceship_view", "spaceship_movement", "spaceship_targeting", "spaceship_weapons", "spaceship_missiles", - "spaceship_defensive", "spaceship_auto_weapons", "spaceship_radar" , "spaceship_hud" , "IFCS_controls" }; + public static String[] ActionMaps = { "multiplayer", "singleplayer", "player", "flycam", "spaceship_general", "spaceship_view", "spaceship_movement", "spaceship_targeting", "spaceship_turret", + "spaceship_weapons", "spaceship_missiles", "spaceship_defensive", "spaceship_auto_weapons", "spaceship_radar" , "spaceship_hud" , "IFCS_controls" }; public String version { get; set; } - // own additions for JS mapping - should not harm.. - public String js1 { get; set; } - public String js2 { get; set; } - public String js3 { get; set; } - public String js4 { get; set; } - public String js1GUID { get; set; } - public String js2GUID { get; set; } - public String js3GUID { get; set; } - public String js4GUID { get; set; } + // own additions for JS mapping - should not harm.. + private String[] m_js; + private String[] m_GUIDs; + + /// + /// get/set jsN assignment (use 0-based index i.e. js1 -> [0]) + /// + public String[] jsN + { + get { return m_js; } + } + + /// + /// get/set jsN GUID assignment (use 0-based index i.e. js1GUID -> [0]) + /// + public String[] jsNGUID + { + get { return m_GUIDs; } + } + /// /// ctor @@ -46,8 +57,13 @@ class ActionMapsCls : List public ActionMapsCls( ) { version = "0"; - js1 = ""; js2 = ""; js3 = ""; js4 = ""; - js1GUID = ""; js2GUID = ""; js3GUID = ""; js4GUID = ""; + + // create the Joystick assignments + Array.Resize( ref m_js, JoystickCls.JSnum_MAX + 1 ); + Array.Resize( ref m_GUIDs, JoystickCls.JSnum_MAX + 1 ); + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + m_js[i] = ""; m_GUIDs[i] = ""; + } } @@ -60,10 +76,9 @@ public ActionMapsCls ReassignJsN( Dictionary newJsList ) { ActionMapsCls newMaps = new ActionMapsCls( ); // full copy from 'this' - newMaps.js1 = this.js1; newMaps.js1GUID = this.js1GUID; - newMaps.js2 = this.js2; newMaps.js2GUID = this.js2GUID; - newMaps.js3 = this.js3; newMaps.js3GUID = this.js3GUID; - newMaps.js4 = this.js4; newMaps.js4GUID = this.js4GUID; + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + newMaps.jsN[i] = this.jsN[i]; newMaps.jsNGUID[i] = this.jsNGUID[i]; + } foreach ( ActionMapCls am in this ) { newMaps.Add( am.ReassignJsN( newJsList ) ); @@ -103,15 +118,12 @@ public String toXML( ) log.Debug( "toXML - Entry" ); String r = String.Format( "\n"); + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + if ( !String.IsNullOrEmpty( jsN[i] ) ) r += String.Format( "\tjs{0}=\"{1}\" ", i+1, jsN[i] ); + if ( !String.IsNullOrEmpty( jsNGUID[i] ) ) r += String.Format( "js{0}G=\"{1}\" \n", i + 1, jsNGUID[i] ); + } + + r += String.Format( ">\n" ); foreach ( ActionMapCls amc in this ) { r += String.Format( "{0}\n", amc.toXML( ) ); } @@ -143,14 +155,10 @@ public Boolean fromXML( String xml ) if ( reader.HasAttributes ) { version = reader["version"]; // get the joystick mapping if there is one - js1 = reader["js1"]; - js2 = reader["js2"]; - js3 = reader["js3"]; - js4 = reader["js4"]; - js1GUID = reader["js1G"]; - js2GUID = reader["js2G"]; - js3GUID = reader["js3G"]; - js4GUID = reader["js4G"]; + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + jsN[i] = reader[String.Format( "js{0}", i + 1 )]; + jsNGUID[i] = reader[String.Format( "js{0}G", i + 1 )]; + } } else { return false; diff --git a/Joystick/ActionTree.cs b/Joystick/ActionTree.cs index 1ac6b47..0b373aa 100644 --- a/Joystick/ActionTree.cs +++ b/Joystick/ActionTree.cs @@ -426,10 +426,9 @@ public String ReportActions( ) String repList = ""; // JS assignments - if ( !String.IsNullOrEmpty( ActionMaps.js1 ) ) repList += String.Format( "** js1 = {0}\n", ActionMaps.js1 ); - if ( !String.IsNullOrEmpty( ActionMaps.js2 ) ) repList += String.Format( "** js2 = {0}\n", ActionMaps.js2 ); - if ( !String.IsNullOrEmpty( ActionMaps.js3 ) ) repList += String.Format( "** js3 = {0}\n", ActionMaps.js3 ); - if ( !String.IsNullOrEmpty( ActionMaps.js4 ) ) repList += String.Format( "** js4 = {0}\n", ActionMaps.js4 ); + for ( int i=0; i < JoystickCls.JSnum_MAX; i++ ) { + if ( !String.IsNullOrEmpty( ActionMaps.jsN[i] ) ) repList += String.Format( "** js{0} = {1}\n", i+1, ActionMaps.jsN[i] ); + } // now the mapped actions repList += String.Format( "\n" ); foreach ( ActionMapCls acm in ActionMaps ) { diff --git a/Joystick/FormReassign.Designer.cs b/Joystick/FormReassign.Designer.cs index 9045591..6ccf31a 100644 --- a/Joystick/FormReassign.Designer.cs +++ b/Joystick/FormReassign.Designer.cs @@ -121,7 +121,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick8.Location = new System.Drawing.Point(562, 217); this.cbxStick8.Name = "cbxStick8"; this.cbxStick8.Size = new System.Drawing.Size(84, 21); @@ -135,7 +139,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick7.Location = new System.Drawing.Point(562, 189); this.cbxStick7.Name = "cbxStick7"; this.cbxStick7.Size = new System.Drawing.Size(84, 21); @@ -149,7 +157,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick6.Location = new System.Drawing.Point(562, 161); this.cbxStick6.Name = "cbxStick6"; this.cbxStick6.Size = new System.Drawing.Size(84, 21); @@ -163,7 +175,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick5.Location = new System.Drawing.Point(562, 133); this.cbxStick5.Name = "cbxStick5"; this.cbxStick5.Size = new System.Drawing.Size(84, 21); @@ -177,7 +193,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick4.Location = new System.Drawing.Point(562, 105); this.cbxStick4.Name = "cbxStick4"; this.cbxStick4.Size = new System.Drawing.Size(84, 21); @@ -191,7 +211,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick3.Location = new System.Drawing.Point(562, 77); this.cbxStick3.Name = "cbxStick3"; this.cbxStick3.Size = new System.Drawing.Size(84, 21); @@ -205,7 +229,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick2.Location = new System.Drawing.Point(562, 49); this.cbxStick2.Name = "cbxStick2"; this.cbxStick2.Size = new System.Drawing.Size(84, 21); @@ -219,7 +247,11 @@ private void InitializeComponent( ) "js1", "js2", "js3", - "js4"}); + "js4", + "js5", + "js6", + "js7", + "js8"}); this.cbxStick1.Location = new System.Drawing.Point(562, 21); this.cbxStick1.Name = "cbxStick1"; this.cbxStick1.Size = new System.Drawing.Size(84, 21); diff --git a/Joystick/FormReassign.cs b/Joystick/FormReassign.cs index bc6c806..cf0ced5 100644 --- a/Joystick/FormReassign.cs +++ b/Joystick/FormReassign.cs @@ -52,7 +52,7 @@ private void LoadSettings( ) m_owner.JsReassingList.Clear( ); m_owner.NewJsList.Clear( ); foreach ( JoystickCls j in m_owner ) { - m_cb[textIdx].SelectedIndex = ( j.JSAssignment <= 4 ) ? j.JSAssignment : 0; + m_cb[textIdx].SelectedIndex = ( j.JSAssignment <= 8 ) ? j.JSAssignment : 0; m_owner.NewJsList.Add( m_cb[textIdx].SelectedIndex ); // old for now - new depends on Leave Button textIdx++; } @@ -77,12 +77,12 @@ private void SaveSettings( ) private Boolean IsOK( ) { - int[] jsx = {0,0,0,0,0}; + int[] jsx = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; foreach ( ComboBox cb in m_cb ) { if ( cb.SelectedIndex>0) jsx[cb.SelectedIndex]++; } - return ( ( jsx[1] < 2 ) && ( jsx[2] < 2 ) && ( jsx[3] < 2 ) && ( jsx[4] < 2 ) ); // each Js can be set only once + return ( ( jsx[1] < 2 ) && ( jsx[2] < 2 ) && ( jsx[3] < 2 ) && ( jsx[4] < 2 ) && ( jsx[5] < 2 ) && ( jsx[6] < 2 ) && ( jsx[7] < 2 ) && ( jsx[8] < 2 ) ); // each Js can be set only once } diff --git a/Joystick/JoystickCls.cs b/Joystick/JoystickCls.cs index 4097920..4815480 100644 --- a/Joystick/JoystickCls.cs +++ b/Joystick/JoystickCls.cs @@ -28,7 +28,7 @@ class JoystickCls public const String BlendedJsInput = JsUnknown + "reserved"; // the device name used throughout this app static private int JSnum_UNKNOWN = 0; - static private int JSnum_MAX = 4; // can only assign 4 jsN devices in SC + static public int JSnum_MAX = 8; // can only assign 4 jsN devices in SC static public System.Drawing.Color[] JColor = (System.Drawing.Color[])MyColors.JColor.Clone(); // default diff --git a/Joystick/UC_JoyPanel.Designer.cs b/Joystick/UC_JoyPanel.Designer.cs index 3ce878a..4173278 100644 --- a/Joystick/UC_JoyPanel.Designer.cs +++ b/Joystick/UC_JoyPanel.Designer.cs @@ -62,11 +62,8 @@ private void InitializeComponent( ) this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.rbJsNA = new System.Windows.Forms.RadioButton(); - this.rbJs4 = new System.Windows.Forms.RadioButton(); - this.rbJs3 = new System.Windows.Forms.RadioButton(); - this.rbJs2 = new System.Windows.Forms.RadioButton(); - this.rbJs1 = new System.Windows.Forms.RadioButton(); + this.label1 = new System.Windows.Forms.Label(); + this.lblJsAssignment = new System.Windows.Forms.Label(); this.gBox.SuspendLayout(); this.gBoxCap.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -434,11 +431,8 @@ private void InitializeComponent( ) // // groupBox1 // - this.groupBox1.Controls.Add(this.rbJsNA); - this.groupBox1.Controls.Add(this.rbJs4); - this.groupBox1.Controls.Add(this.rbJs3); - this.groupBox1.Controls.Add(this.rbJs2); - this.groupBox1.Controls.Add(this.rbJs1); + this.groupBox1.Controls.Add(this.lblJsAssignment); + this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(3, 236); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(232, 46); @@ -446,62 +440,24 @@ private void InitializeComponent( ) this.groupBox1.TabStop = false; this.groupBox1.Text = "jsN - Assignment"; // - // rbJsNA + // label1 // - this.rbJsNA.AutoSize = true; - this.rbJsNA.Checked = true; - this.rbJsNA.Enabled = false; - this.rbJsNA.Location = new System.Drawing.Point(182, 19); - this.rbJsNA.Name = "rbJsNA"; - this.rbJsNA.Size = new System.Drawing.Size(37, 17); - this.rbJsNA.TabIndex = 4; - this.rbJsNA.TabStop = true; - this.rbJsNA.Text = "jsx"; - this.rbJsNA.UseVisualStyleBackColor = true; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 21); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(119, 13); + this.label1.TabIndex = 0; + this.label1.Text = "This device is listed as: "; // - // rbJs4 + // lblJsAssignment // - this.rbJs4.AutoSize = true; - this.rbJs4.Enabled = false; - this.rbJs4.Location = new System.Drawing.Point(138, 19); - this.rbJs4.Name = "rbJs4"; - this.rbJs4.Size = new System.Drawing.Size(38, 17); - this.rbJs4.TabIndex = 3; - this.rbJs4.Text = "js4"; - this.rbJs4.UseVisualStyleBackColor = true; - // - // rbJs3 - // - this.rbJs3.AutoSize = true; - this.rbJs3.Enabled = false; - this.rbJs3.Location = new System.Drawing.Point(94, 19); - this.rbJs3.Name = "rbJs3"; - this.rbJs3.Size = new System.Drawing.Size(38, 17); - this.rbJs3.TabIndex = 2; - this.rbJs3.Text = "js3"; - this.rbJs3.UseVisualStyleBackColor = true; - // - // rbJs2 - // - this.rbJs2.AutoSize = true; - this.rbJs2.Enabled = false; - this.rbJs2.Location = new System.Drawing.Point(50, 19); - this.rbJs2.Name = "rbJs2"; - this.rbJs2.Size = new System.Drawing.Size(38, 17); - this.rbJs2.TabIndex = 1; - this.rbJs2.Text = "js2"; - this.rbJs2.UseVisualStyleBackColor = true; - // - // rbJs1 - // - this.rbJs1.AutoSize = true; - this.rbJs1.Enabled = false; - this.rbJs1.Location = new System.Drawing.Point(6, 19); - this.rbJs1.Name = "rbJs1"; - this.rbJs1.Size = new System.Drawing.Size(38, 17); - this.rbJs1.TabIndex = 0; - this.rbJs1.Text = "js1"; - this.rbJs1.UseVisualStyleBackColor = true; + this.lblJsAssignment.AutoSize = true; + this.lblJsAssignment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblJsAssignment.Location = new System.Drawing.Point(134, 21); + this.lblJsAssignment.Name = "lblJsAssignment"; + this.lblJsAssignment.Size = new System.Drawing.Size(22, 13); + this.lblJsAssignment.TabIndex = 1; + this.lblJsAssignment.Text = "jsx"; // // UC_JoyPanel // @@ -559,10 +515,7 @@ private void InitializeComponent( ) private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.RadioButton rbJsNA; - private System.Windows.Forms.RadioButton rbJs4; - private System.Windows.Forms.RadioButton rbJs3; - private System.Windows.Forms.RadioButton rbJs2; - private System.Windows.Forms.RadioButton rbJs1; + private System.Windows.Forms.Label lblJsAssignment; + private System.Windows.Forms.Label label1; } } diff --git a/Joystick/UC_JoyPanel.cs b/Joystick/UC_JoyPanel.cs index cbab871..566f39b 100644 --- a/Joystick/UC_JoyPanel.cs +++ b/Joystick/UC_JoyPanel.cs @@ -265,15 +265,11 @@ public int JsAssignment set { m_jsAssignment = value; - switch ( m_jsAssignment ) { - case 1: rbJs1.Checked = true; break; - case 2: rbJs2.Checked = true; break; - case 3: rbJs3.Checked = true; break; - case 4: rbJs4.Checked = true; break; - default: - rbJsNA.Checked = true; - m_jsAssignment = value; - break; + if ( ( m_jsAssignment >= 1 ) && ( m_jsAssignment <= 8 ) ) { + lblJsAssignment.Text = String.Format( "js{0}", m_jsAssignment ); + } + else { + lblJsAssignment.Text = "not assigned"; } } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index c750e9b..ef00dc7 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 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.3.0.23" )] -[assembly: AssemblyFileVersion( "2.3.0.23" )] +[assembly: AssemblyVersion( "2.4.0.24" )] +[assembly: AssemblyFileVersion( "2.4.0.24" )] diff --git a/SCJMapper-V2.csproj b/SCJMapper-V2.csproj index 2534413..be0a433 100644 --- a/SCJMapper-V2.csproj +++ b/SCJMapper-V2.csproj @@ -26,8 +26,8 @@ false false true - 23 - 2.3.0.%2a + 24 + 2.4.0.%2a false true diff --git a/defaultProfile.xml b/defaultProfile.xml index f44673d..d231f81 100644 --- a/defaultProfile.xml +++ b/defaultProfile.xml @@ -10,6 +10,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -19,39 +80,38 @@ - - - - + - + - + + - - - + + + + @@ -127,12 +187,9 @@ - - - - + @@ -140,16 +197,22 @@ - - - + + + + + + + + + + - @@ -158,11 +221,6 @@ - - - - - @@ -175,6 +233,9 @@ + + + @@ -186,8 +247,7 @@ - - + @@ -222,7 +282,7 @@ - + @@ -238,10 +298,8 @@ - - + - @@ -273,112 +331,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -389,11 +341,18 @@ + + + + + + + @@ -401,139 +360,202 @@ - + - - + - - + - + - - - + + - - - - - - + + + - - + + - - - + + + - - - + + + - - - - + + + + - + + - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -550,6 +572,24 @@ + + + + + + + + + + @@ -577,18 +617,18 @@ - + - - - - - - - + + + + + + + @@ -622,12 +662,14 @@ - + - - + + + + @@ -640,6 +682,8 @@ + + - - - - - - - - - - - - - - - + + + + + + + @@ -679,32 +716,50 @@ + + + + - - - - - - - - - - - - - - - - - @@ -712,18 +767,4 @@ - - - - - - - - - - - - - - diff --git a/doc/ReadMe.txt b/doc/ReadMe.txt index aa459c2..5aaa2ec 100644 --- a/doc/ReadMe.txt +++ b/doc/ReadMe.txt @@ -1,5 +1,5 @@ -SC Joystick Mapper V 2.3 -(c) Cassini, StandardToaster - 31-August-2014 +SC Joystick Mapper V 2.4 +(c) Cassini, StandardToaster - 14-September-2014 Contains 9 files: @@ -11,7 +11,7 @@ Ionic.Zip.Reduced.dll Managed Zip Assembly - MUST be in th log4net.dll Managed Logging Assembly - MUST be in the same folder as the Exe file log4net.config.OFF Config file for logging - To use it - rename as log4net.config and run the program then look for trace.log in the same folder -SCJMapper_QGuide V2.3.pdf Quick Guide +SCJMapper_QGuide V2.4.pdf Quick Guide ReadMe.txt This file Read the Guide first RTFM ;-) @@ -24,6 +24,10 @@ Scanned for viruses before packing... cassini@burri-web.org Changelog: +V 2.4 +- improvement - add new actionmaps for AC 0.9 (flycam, spaceship_turret) +- improvement - supports now assignment of js1 .. js8 - SC may not support all though... +- Update of the Guide for V2.4 V 2.3 - new feature - allow reassignment of the jsN group - improvement - uniquely identified devices with the same name (use GUID) @@ -31,17 +35,19 @@ V 2.3 - improvement - detection of the SC install path extended to one more Registry entry - fix - blend unmapped works properly now - fix - manual entry of SC directory works now +- Update of the Guide for V2.3 V 2.2 - new feature - option to ignore actionmaps in Settings - improvement - add actionmaps for multiplayer, singleplayer, player - improvement - GUI layout of Joystick tabs for more than 4 devices +- Update of the Guide for V2.2 V 2.1 - program is maintained at "https://github.com/SCToolsfactory/SCJMapper-V2/releases" - new feature - option to blend unmapped actions - improvement - ignore buttons in Settings - improvement - override the built in detection of the SC folder in Settings - added - trace log for resolving crash and other issues -- Update of the Guide for V2.0 +- Update of the Guide for V2.1 V 2.0 - program is maintained at "https://github.com/bm98/SCJMapper-V2/releases" - new feature - get defaultProfile.xml from game assets diff --git a/doc/SCJMapper_QGuide V2.4.pdf b/doc/SCJMapper_QGuide V2.4.pdf new file mode 100644 index 0000000..cd04e30 Binary files /dev/null and b/doc/SCJMapper_QGuide V2.4.pdf differ diff --git a/doc/SCJMapper_QGuide.pptx b/doc/SCJMapper_QGuide.pptx index 3411051..4a1501d 100644 Binary files a/doc/SCJMapper_QGuide.pptx and b/doc/SCJMapper_QGuide.pptx differ