diff --git a/AppSettings.cs b/AppSettings.cs index f31c5ee..b18a9be 100644 --- a/AppSettings.cs +++ b/AppSettings.cs @@ -295,6 +295,15 @@ namespace SCJMapper_V2 set { this["ListModifiers"] = value; } } + [UserScopedSettingAttribute( )] + [DefaultSettingValueAttribute( "False" )] + public Boolean AutoTabXML + { + get { return (Boolean)this["AutoTabXML"]; } + set { this["AutoTabXML"] = value; } + } + + //**** Form Table diff --git a/FormMain.Designer.cs b/FormMain.Designer.cs index 2f9d931..3cdfa86 100644 --- a/FormMain.Designer.cs +++ b/FormMain.Designer.cs @@ -120,16 +120,20 @@ this.lblPTU = new System.Windows.Forms.Label(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.label2 = new System.Windows.Forms.Label(); - this.txFilter = new System.Windows.Forms.TextBox(); this.lblProfileUsed = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.btClearFilter = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); this.cbxShowMappedOnly = new System.Windows.Forms.CheckBox(); this.cbxShowMouse = new System.Windows.Forms.CheckBox(); this.cbxShowKeyboard = new System.Windows.Forms.CheckBox(); this.cbxShowJoystick = new System.Windows.Forms.CheckBox(); this.cbxShowGamepad = new System.Windows.Forms.CheckBox(); + this.txFilter = new System.Windows.Forms.TextBox(); + this.tcXML = new System.Windows.Forms.TabControl(); + this.tPageOther = new System.Windows.Forms.TabPage(); + this.lbxOther = new System.Windows.Forms.ListBox(); + this.tPageDump = new System.Windows.Forms.TabPage(); this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); this.tsBtReset = new System.Windows.Forms.ToolStripDropDownButton(); this.resetDefaultsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -157,6 +161,9 @@ this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); + this.tcXML.SuspendLayout(); + this.tPageOther.SuspendLayout(); + this.tPageDump.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -177,10 +184,9 @@ this.rtb.DetectUrls = false; this.rtb.Dock = System.Windows.Forms.DockStyle.Fill; this.rtb.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rtb.Location = new System.Drawing.Point(686, 81); + this.rtb.Location = new System.Drawing.Point(3, 3); this.rtb.Name = "rtb"; - this.tlpanel.SetRowSpan(this.rtb, 2); - this.rtb.Size = new System.Drawing.Size(362, 686); + this.rtb.Size = new System.Drawing.Size(348, 654); this.rtb.TabIndex = 21; this.rtb.Text = ""; this.rtb.WordWrap = false; @@ -354,6 +360,7 @@ this.lblLastJ.Size = new System.Drawing.Size(224, 22); this.lblLastJ.TabIndex = 14; this.lblLastJ.Text = "..."; + this.lblLastJ.TextChanged += new System.EventHandler(this.lblLastJ_TextChanged); this.lblLastJ.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lblLastJ_KeyDown); // // cmMouseEntry @@ -614,6 +621,7 @@ // tdiTxDefActivationMode // this.tdiTxDefActivationMode.BackColor = System.Drawing.Color.PapayaWhip; + this.tdiTxDefActivationMode.Font = new System.Drawing.Font("Segoe UI", 9F); this.tdiTxDefActivationMode.Name = "tdiTxDefActivationMode"; this.tdiTxDefActivationMode.ReadOnly = true; this.tdiTxDefActivationMode.Size = new System.Drawing.Size(160, 23); @@ -814,8 +822,8 @@ this.tlpanel.Controls.Add(this.tableLayoutPanel2, 1, 3); this.tlpanel.Controls.Add(this.tableLayoutPanel3, 2, 3); this.tlpanel.Controls.Add(this.tableLayoutPanel4, 1, 1); - this.tlpanel.Controls.Add(this.rtb, 2, 1); this.tlpanel.Controls.Add(this.tableLayoutPanel5, 0, 3); + this.tlpanel.Controls.Add(this.tcXML, 2, 1); 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); @@ -1057,28 +1065,6 @@ this.tableLayoutPanel5.Size = new System.Drawing.Size(364, 78); this.tableLayoutPanel5.TabIndex = 29; // - // label2 - // - this.tableLayoutPanel5.SetColumnSpan(this.label2, 2); - this.label2.Location = new System.Drawing.Point(3, 32); - this.label2.Margin = new System.Windows.Forms.Padding(3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(83, 23); - this.label2.TabIndex = 27; - this.label2.Text = "Action Filter:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // txFilter - // - this.tableLayoutPanel5.SetColumnSpan(this.txFilter, 2); - this.txFilter.Dock = System.Windows.Forms.DockStyle.Top; - this.txFilter.Location = new System.Drawing.Point(147, 32); - this.txFilter.Name = "txFilter"; - this.txFilter.Size = new System.Drawing.Size(138, 22); - this.txFilter.TabIndex = 25; - this.txFilter.WordWrap = false; - this.txFilter.TextChanged += new System.EventHandler(this.txFilter_TextChanged); - // // lblProfileUsed // this.tableLayoutPanel5.SetColumnSpan(this.lblProfileUsed, 4); @@ -1114,6 +1100,17 @@ this.btClearFilter.UseVisualStyleBackColor = true; this.btClearFilter.Click += new System.EventHandler(this.btClearFilter_Click); // + // label2 + // + this.tableLayoutPanel5.SetColumnSpan(this.label2, 2); + this.label2.Location = new System.Drawing.Point(3, 32); + this.label2.Margin = new System.Windows.Forms.Padding(3); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(83, 23); + this.label2.TabIndex = 27; + this.label2.Text = "Action Filter:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // cbxShowMappedOnly // this.cbxShowMappedOnly.AutoSize = true; @@ -1175,6 +1172,63 @@ this.cbxShowGamepad.UseVisualStyleBackColor = true; this.cbxShowGamepad.CheckedChanged += new System.EventHandler(this.cbxShowTreeOptions_CheckedChanged); // + // txFilter + // + this.tableLayoutPanel5.SetColumnSpan(this.txFilter, 2); + this.txFilter.Dock = System.Windows.Forms.DockStyle.Top; + this.txFilter.Location = new System.Drawing.Point(147, 32); + this.txFilter.Name = "txFilter"; + this.txFilter.Size = new System.Drawing.Size(138, 22); + this.txFilter.TabIndex = 25; + this.txFilter.WordWrap = false; + this.txFilter.TextChanged += new System.EventHandler(this.txFilter_TextChanged); + // + // tcXML + // + this.tcXML.Controls.Add(this.tPageDump); + this.tcXML.Controls.Add(this.tPageOther); + this.tcXML.Dock = System.Windows.Forms.DockStyle.Fill; + this.tcXML.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tcXML.Location = new System.Drawing.Point(686, 81); + this.tcXML.Name = "tcXML"; + this.tlpanel.SetRowSpan(this.tcXML, 2); + this.tcXML.SelectedIndex = 0; + this.tcXML.Size = new System.Drawing.Size(362, 686); + this.tcXML.TabIndex = 30; + // + // tPageOther + // + this.tPageOther.Controls.Add(this.lbxOther); + this.tPageOther.Location = new System.Drawing.Point(4, 22); + this.tPageOther.Name = "tPageOther"; + this.tPageOther.Padding = new System.Windows.Forms.Padding(3); + this.tPageOther.Size = new System.Drawing.Size(354, 660); + this.tPageOther.TabIndex = 0; + this.tPageOther.Text = "All Mappings"; + this.tPageOther.UseVisualStyleBackColor = true; + // + // lbxOther + // + this.lbxOther.Dock = System.Windows.Forms.DockStyle.Fill; + this.lbxOther.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbxOther.FormattingEnabled = true; + this.lbxOther.ItemHeight = 14; + this.lbxOther.Location = new System.Drawing.Point(3, 3); + this.lbxOther.Name = "lbxOther"; + this.lbxOther.Size = new System.Drawing.Size(348, 654); + this.lbxOther.TabIndex = 0; + // + // tPageDump + // + this.tPageDump.Controls.Add(this.rtb); + this.tPageDump.Location = new System.Drawing.Point(4, 22); + this.tPageDump.Name = "tPageDump"; + this.tPageDump.Padding = new System.Windows.Forms.Padding(3); + this.tPageDump.Size = new System.Drawing.Size(354, 660); + this.tPageDump.TabIndex = 1; + this.tPageDump.Text = "Dumps (XML, Logs etc.)"; + this.tPageDump.UseVisualStyleBackColor = true; + // // toolStripStatusLabel2 // this.toolStripStatusLabel2.BackColor = System.Drawing.Color.DarkKhaki; @@ -1350,6 +1404,9 @@ this.tableLayoutPanel4.ResumeLayout(false); this.tableLayoutPanel5.ResumeLayout(false); this.tableLayoutPanel5.PerformLayout(); + this.tcXML.ResumeLayout(false); + this.tPageOther.ResumeLayout(false); + this.tPageDump.ResumeLayout(false); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); @@ -1468,6 +1525,10 @@ private System.Windows.Forms.Label label5; private System.Windows.Forms.Label lblAssigned; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.TabControl tcXML; + private System.Windows.Forms.TabPage tPageOther; + private System.Windows.Forms.ListBox lbxOther; + private System.Windows.Forms.TabPage tPageDump; } } diff --git a/FormMain.cs b/FormMain.cs index b0e795b..1247ec6 100644 --- a/FormMain.cs +++ b/FormMain.cs @@ -87,19 +87,21 @@ namespace SCJMapper_V2 // take care of the sequence.. mouse overrides key but both override joy and game if ( m_mouseIn ) { // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage) return ActionCls.ActionDevice.AD_Mouse; - } else if ( m_keyIn ) { + } + else if ( m_keyIn ) { return ActionCls.ActionDevice.AD_Keyboard; - } else { + } + else { if ( IsGamepadTab( tc1.SelectedTab ) ) { return ActionCls.ActionDevice.AD_Gamepad; - } else { + } + else { return ActionCls.ActionDevice.AD_Joystick; } } } } - /// /// Get the current JsN string for the active device tab /// @@ -110,8 +112,25 @@ namespace SCJMapper_V2 return jp.JsName; } - #endregion + // tab index for the tcXML control + private enum EATabXML + { + Tab_XML = 0, + Tab_Assignment, + } + private void AutoTabXML_Assignment( EATabXML tab ) + { + if ( m_AppSettings.AutoTabXML ) { + if ( tcXML.SelectedIndex != (int)tab ) { + tcXML.SelectedTab = tcXML.TabPages[(int)tab]; + if ( tab == EATabXML.Tab_Assignment ) + lblLastJ.Select( ); // select again as when changing the Tabs + } + } + } + + #endregion #region Main Form Handling @@ -230,7 +249,8 @@ namespace SCJMapper_V2 Grab( ); m_AppSettings.MyMappingName = txMappingName.Text; m_AppSettings.Save( );// last used - persist txMappingName.BackColor = MyColors.SuccessColor; - } else { + } + else { log.WarnFormat( "Last used mapping not available ({0})", txMappingName.Text ); txMappingName.BackColor = MyColors.ErrorColor; } @@ -260,10 +280,16 @@ namespace SCJMapper_V2 lblPTU.Visible = m_AppSettings.UsePTU; if ( m_AppSettings.UsePTU ) log.Debug( "Using PTU Folders" ); + // poll the XInput log.Debug( "Start XInput polling" ); + timer1_Tick( null,null ); + timer1.Start( ); // this one polls the joysticks to show the props + // Select XML tab to start with + AutoTabXML_Assignment( EATabXML.Tab_XML ); + m_appLoading = false; // no longer } @@ -319,7 +345,8 @@ namespace SCJMapper_V2 } tabRegion.Exclude( TabItemRect ); e.Graphics.FillRegion( backBrush, tabRegion ); - } else { + } + else { f = e.Font; foreBrush = new SolidBrush( e.ForeColor ); } @@ -340,7 +367,8 @@ namespace SCJMapper_V2 if ( e.Index == this.tc1.SelectedIndex ) { f.Dispose( ); backBrush.Dispose( ); - } else { + } + else { backBrush.Dispose( ); foreBrush.Dispose( ); } @@ -389,7 +417,8 @@ namespace SCJMapper_V2 // valid Device Tab if ( IsGamepadTab( tc1.TabPages[deviceTabIndex] ) ) { ; // ignore gamepads - } else if ( DeviceInst.JoystickListRef.Count > joyStickIndex ) { + } + else if ( DeviceInst.JoystickListRef.Count > joyStickIndex ) { // there is a joystick device left.. DeviceInst.JoystickListRef[joyStickIndex].JSAssignment = joyStickIndex + 1; // assign number 1.. m_AT.ActionMaps.jsN[deviceTabIndex] = DeviceInst.JoystickListRef[joyStickIndex].DevName; @@ -458,7 +487,8 @@ namespace SCJMapper_V2 break; // get only the first one } } - } else { + } + else { myDxJoystick myJs = new myDxJoystick( ); myJs.js = new SharpDX.DirectInput.Joystick( directInput, instance.InstanceGuid ); myJs.prodName = instance.ProductName; @@ -502,7 +532,8 @@ namespace SCJMapper_V2 // first panel - The Tab content exists already log.Debug( "Add first Joystick panel" ); uUC_JoyPanelNew = UC_JoyPanel; - } else { + } + else { log.Debug( "Add next Joystick panel" ); // setup the further tab contents along the reference one in TabPage[0] (the control named UC_JoyPanel) tc1.TabPages.Add( "" ); // numbering is 1 based for the user @@ -510,7 +541,7 @@ namespace SCJMapper_V2 uUC_JoyPanelNew.Size = UC_JoyPanel.Size; uUC_JoyPanelNew.Location = UC_JoyPanel.Location; //uUC_JoyPanelNew.Dock = UC_JoyPanel.Dock; uUC_JoyPanelNew.Anchor = UC_JoyPanel.Anchor; //uUC_JoyPanelNew.AutoScaleMode = UC_JoyPanel.AutoScaleMode; uUC_JoyPanelNew.AutoSize = UC_JoyPanel.AutoSize; - + } // common part tc1.TabPages[tabs].Text = string.Format( "Joystick {0}", nJs + 1 ); // numbering is 1 based for the user @@ -607,6 +638,8 @@ namespace SCJMapper_V2 { log.Debug( "Dump - Entry" ); + AutoTabXML_Assignment( EATabXML.Tab_XML ); + rtb.Text = string.Format( "\n{2}", DateTime.Now, txMappingName.Text, m_AT.toXML( txMappingName.Text ) ); btDump.BackColor = btClear.BackColor; btDump.UseVisualStyleBackColor = btClear.UseVisualStyleBackColor; // neutral again @@ -663,14 +696,16 @@ namespace SCJMapper_V2 ctrl = DeviceInst.GamepadRef.GetLastChange( ); timer1.Interval = 750; // allow more time to release buttons [msec] } - } else { + } + else { // poll active Joystick DeviceInst.JoystickRef.GetData( ); // poll the device // add keyboard modifier - if there are .. if ( DeviceInst.KeyboardRef == null ) { // no keyboard => no modifier ctrl = JSStr( ) + DeviceInst.JoystickRef.GetLastChange( ); // show last handled JS control - } else { + } + else { UpdateModifiers( ); // get the last keyboard modifer to compose the command, also handles the modifier lifetime ctrl = JSStr( ) + m_persistentMods + DeviceInst.JoystickRef.GetLastChange( ); // show last handled JS control } @@ -682,7 +717,8 @@ namespace SCJMapper_V2 // Handle Throttle checkbox if ( JoystickCls.CanThrottle( ctrl ) ) { cbxThrottle.Enabled = true; - } else { + } + else { cbxThrottle.Checked = false; cbxThrottle.Enabled = false; } // Update joystick modifiers - not currently used @@ -696,7 +732,7 @@ namespace SCJMapper_V2 private void treeView1_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e ) { if ( e.Button == MouseButtons.Right ) { - treeView1.SelectedNode = e.Node; + treeView1.SelectedNode = e.Node; // trigger ActionTree events.. } } @@ -736,7 +772,8 @@ namespace SCJMapper_V2 if ( m_AT.UpdateSelectedItem( JoystickCls.MakeThrottle( lblLastJ.Text, cbxThrottle.Checked ), InputMode, true ) ) { if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor; UpdateTableSelectedItem( ); - } else MySounds.PlayNotfound( ); + } + else MySounds.PlayNotfound( ); } private void btBlend_Click( object sender, EventArgs e ) @@ -745,7 +782,8 @@ namespace SCJMapper_V2 m_AT.BlendBinding( ); UpdateTableSelectedItem( ); if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor; - } else MySounds.PlayCannot( ); + } + else MySounds.PlayCannot( ); } private void btClear_Click( object sender, EventArgs e ) @@ -754,7 +792,8 @@ namespace SCJMapper_V2 m_AT.ClearBinding( ); UpdateTableSelectedItem( ); if ( m_AT.Dirty ) btDump.BackColor = MyColors.DirtyColor; - } else MySounds.PlayCannot( ); + } + else MySounds.PlayCannot( ); } //TODO @@ -777,6 +816,8 @@ namespace SCJMapper_V2 private void btDumpList_Click( object sender, EventArgs e ) { + AutoTabXML_Assignment( EATabXML.Tab_XML ); + if ( m_AppSettings.UseCSVListing ) rtb.Text = string.Format( "-- {0} - SC Joystick Mapping --\n{1}", DateTime.Now, m_AT.ReportActionsCSV( m_AppSettings.ListModifiers ) ); else @@ -786,12 +827,15 @@ namespace SCJMapper_V2 private void btDumpLog_Click( object sender, EventArgs e ) { - rtb.Text = string.Format( "-- {0} - SC Joystick AC Log Controller Detection --\n{1}", DateTime.Now, SCLogExtract.ExtractLog( ) ); + AutoTabXML_Assignment( EATabXML.Tab_XML ); + rtb.Text = string.Format( "-- {0} - SC Joystick AC Log Controller Detection --\n{1}", DateTime.Now, SCLogExtract.ExtractLog( ) ); } private void btDumpProfile_Click( object sender, EventArgs e ) { + AutoTabXML_Assignment( EATabXML.Tab_XML ); + rtb.Text = SCDefaultProfile.DefaultProfile( SCDefaultProfile.DefaultProfileName ); } @@ -1078,13 +1122,15 @@ namespace SCJMapper_V2 break; } } - } else { + } + else { dropEnabled = false; } if ( dropEnabled ) { e.Effect = DragDropEffects.Copy; - } else { + } + else { e.Effect = DragDropEffects.None; } } @@ -1100,6 +1146,9 @@ namespace SCJMapper_V2 private void btSaveMyMapping_Click( object sender, EventArgs e ) { bool cancel = false; + + AutoTabXML_Assignment( EATabXML.Tab_XML ); + if ( SCMappings.IsValidMappingName( txMappingName.Text ) ) { Dump( ); if ( SCMappings.MappingFileExists( txMappingName.Text ) ) { @@ -1116,7 +1165,8 @@ namespace SCJMapper_V2 m_AppSettings.MyMappingName = txMappingName.Text; m_AppSettings.Save( );// last used - persist txMappingName.BackColor = MyColors.SuccessColor; } - } else { + } + else { txMappingName.BackColor = MyColors.ErrorColor; } } @@ -1125,7 +1175,8 @@ namespace SCJMapper_V2 { if ( SCMappings.IsValidMappingName( txMappingName.Text ) ) { txMappingName.BackColor = MyColors.ValidColor; - } else { + } + else { txMappingName.BackColor = MyColors.InvalidColor; } } @@ -1140,7 +1191,7 @@ namespace SCJMapper_V2 private void btClip_Click( object sender, EventArgs e ) { - System.Windows.Forms.Clipboard.SetText( txRebind.Text ); + Clipboard.SetText( txRebind.Text ); } @@ -1183,7 +1234,8 @@ namespace SCJMapper_V2 j = DeviceInst.JoystickListRef.Find_jsN( i + 1 ); if ( j != null ) { newTree.ActionMaps.jsN[i] = j.DevName; newTree.ActionMaps.jsNGUID[i] = j.DevInstanceGUID; - } else { + } + else { newTree.ActionMaps.jsN[i] = ""; newTree.ActionMaps.jsNGUID[i] = ""; } } @@ -1280,9 +1332,9 @@ namespace SCJMapper_V2 tuning.AssignDynamicItems( dev, null, nodeText ); } } - // GP commands that are supported - else if ( nodeText.ToLowerInvariant( ).Contains( "_thumblx" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbrx" ) - || nodeText.ToLowerInvariant( ).Contains( "_thumbly" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbry" ) ) { + // GP commands that are supported + else if ( nodeText.ToLowerInvariant( ).Contains( "_thumblx" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbrx" ) + || nodeText.ToLowerInvariant( ).Contains( "_thumbly" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbry" ) ) { // update dynamic properties tuning.GameDevice = dev; tuning.NodeText = nodeText; @@ -1294,7 +1346,8 @@ namespace SCJMapper_V2 tuning.AssignDynamicItems( dev, null, nodeText ); } } - } else if ( tuning != null && tuning.DevInstanceNo > 0 ) { + } + else if ( tuning != null && tuning.DevInstanceNo > 0 ) { // a device was assigned but the action is not mapped // try to find the gamedevice here ?? if ( JoystickCls.IsDeviceClass( tuning.DeviceClass ) ) { @@ -1346,8 +1399,7 @@ namespace SCJMapper_V2 UpdateOptionItem( "turret_aim_pitch", "v_aim_pitch", "spaceship_turret" ); UpdateOptionItem( "turret_aim_yaw", "v_aim_yaw", "spaceship_turret" ); } - - + private void btJSTuning_Click( object sender, EventArgs e ) { @@ -1385,7 +1437,6 @@ namespace SCJMapper_V2 } devlist.AddRange( DeviceInst.JoystickListRef ); - OPT.TuningOptions = m_AT.ActionMaps.TuningOptions; OPT.DeviceOptions = m_AT.ActionMaps.DeviceOptions; OPT.Devicelist = devlist; @@ -1401,14 +1452,11 @@ namespace SCJMapper_V2 } - - // Keyboard Input bool m_keyIn = false; bool m_mouseIn = false; - private void btJsKbd_Click( object sender, EventArgs e ) { m_keyIn = ( !m_keyIn ); @@ -1425,7 +1473,8 @@ namespace SCJMapper_V2 lblLastJ.Focus( ); DeviceInst.KeyboardRef.Activate( ); DeviceInst.KeyboardRef.GetData( ); // poll to aquire once - } else { + } + else { m_mouseIn = false; // not longer lblLastJ.BackColor = MyColors.ValidColor; btJsKbd.ImageKey = "J"; @@ -1444,7 +1493,8 @@ namespace SCJMapper_V2 // don't override modifiers when we are in mouse mode and the mod is the same and there is no kbd entry.... if ( m_mouseIn && ( keyModS == modS ) && ( m_persistentMods == ( modS + "+" ) ) ) { ; // nothing here - - } else { + } + else { lblLastJ.Text = DeviceInst.KeyboardRef.GetLastChange( true ); m_mouseIn = false; // clear on kbd input } @@ -1456,6 +1506,22 @@ namespace SCJMapper_V2 e.Handled = true; } + // text of input has changed + private void lblLastJ_TextChanged( object sender, EventArgs e ) + { + AutoTabXML_Assignment( EATabXML.Tab_Assignment ); + + string devInput = ActionCls.DevInput( lblLastJ.Text, InputMode ); + List r = m_AT.FindAllActions( devInput ); + lbxOther.Items.Clear( ); + foreach ( string s in r ) lbxOther.Items.Add( s ); + // have to check if throttle is used and if - add those to the list + string altDevInput = JoystickCls.MakeThrottle( devInput, true ); + if ( altDevInput != devInput ) { + r = m_AT.FindAllActions( altDevInput ); + foreach ( string s in r ) lbxOther.Items.Add( s ); + } + } // maintain the global modifier store @@ -1469,11 +1535,13 @@ namespace SCJMapper_V2 if ( modS.Contains( KeyboardCls.ClearMods ) ) { // allow to cancel modifiers m_persistentMods = ""; // kill persistent ones - } else { + } + else { m_persistentMods = modS + "+"; m_modifierTimeout = c_modifierTime; // restart show interval } - } else { + } + else { if ( m_modifierTimeout <= 0 ) { m_persistentMods = ""; // modifier timed out m_mouseIn = false; @@ -1502,7 +1570,8 @@ namespace SCJMapper_V2 if ( int.TryParse( (string)ts.Tag, out btNum ) ) { // got a button (most likely..) item = "mouse" + btNum.ToString( ); - } else if ( (string)ts.Tag == "X" ) + } + else if ( (string)ts.Tag == "X" ) item = "maxis_x"; else if ( (string)ts.Tag == "Y" ) item = "maxis_y"; @@ -1521,12 +1590,14 @@ namespace SCJMapper_V2 if ( DeviceInst.KeyboardRef == null ) { // no keyboard = no modifier ctrl = MouseCls.MakeCtrl( item, "" ); // show last handled JS control - } else { + } + else { UpdateModifiers( ); ctrl = MouseCls.MakeCtrl( item, m_persistentMods ); // show last handled JS control } m_mouseIn = true; // for this one only - } else if ( KeyboardCls.IsDeviceClass( device ) ) { + } + else if ( KeyboardCls.IsDeviceClass( device ) ) { UpdateModifiers( ); ctrl = KeyboardCls.MakeCtrl( item, m_persistentMods ); // show last handled JS control } @@ -1577,7 +1648,8 @@ namespace SCJMapper_V2 m_AppSettings.FormTableColumnWidth = FTAB.LastColSize; FTAB.Hide( ); - } else { + } + else { FTAB.Show( ); if ( created ) { @@ -1615,5 +1687,6 @@ namespace SCJMapper_V2 { m_AT.FindAndSelectActionKey( e.Actionmap, e.Actionkey, e.Nodeindex ); } + } } diff --git a/FormMain.resx b/FormMain.resx index 066cd00..44b4ee7 100644 --- a/FormMain.resx +++ b/FormMain.resx @@ -120,6 +120,92 @@ 300, 17 + + 494, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA8 + EAAAAk1TRnQBSQFMAgEBCQEAAZgBEQGYAREBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBA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f8BgAEBBAAB4AH/AcABAQQAAeEB/wHAAQEEAAGAAf8BwAEDBAABgQH/AeABAwQA + AQMB/wHgAQcEAAEHA/8EAAHHA/8L + + + + 761, 17 + + + 652, 17 + @@ -384,89 +470,15 @@ x1//2Q== - - 652, 17 + + 133, 17 - - 494, 17 + + 209, 17 + + + 421, 17 - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA8 - EAAAAk1TRnQBSQFMAgEBCQEAAYgBEQGIAREBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo - AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA - AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 - AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA - AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm - AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM - AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA - ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz - AWYC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f8I8wHyAfcB8gH3AfIB9wHzBv8BHAN4Bv8B7QHr - AbwC7w4AAvEG8gLxAwAB/wHzDf8B7wf/AZkBUAj/ARMB8AHqHAAg/wIAAfMB9wH/GwABQgFNAT4HAAE+ - AwABKAMAAUADAAEwAwABAQEAAQEFAAGAAQEWAAP/AQAB4AcAAeAvAAHgBwAB4AcAAeAHAAHgBwAB4AcA - AeAHAAHgAQEGAAHgAQMGAAHgAQcGAAH3Bf8B+AEPAcAB/wGfAf0C/wHwAQcBwAF/AY8B+AHfAf0B4AED - AYABfwGPAfABjwHwAcABAQGAAT8BAwHgAQcB8AGAAQEBgAEfAwACgAEBAYABHwGAAQABgAEAAYABAQHA - AR8BgAEAAYABAAGAAQEBwAEfAYABAAGAAQABgAEBAeABHwGAAQEBgAEAAYABAQHgAR8BwAEBAcABAQGA - AQEB8AF/AcABAQHDAeEBwAEDAf8BIwHgAQMB5wHjAeABBwH/AY0E/wHwAQ8B/wH9Dv8EAAH8AT8C/wQA - AfgBDwHgAQMEAAHwAQ8BwAEBBAABwAEHAYABAQQAAYABBwGAAQEEAAGAAQABgAEBBAABwAEAAYABAQQA - AeABAQGAAQEEAAHgAf8BgAEBBAAB4AH/AcABAQQAAeEB/wHAAQEEAAGAAf8BwAEDBAABgQH/AeABAwQA - AQMB/wHgAQcEAAEHA/8EAAHHA/8L - - iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH @@ -539,18 +551,6 @@ Tesk88046SuRb2gfwdMB6S/DHs/UzS4d0QAAAABJRU5ErkJggg== - - 761, 17 - - - 133, 17 - - - 209, 17 - - - 421, 17 - iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 diff --git a/FormSettings.Designer.cs b/FormSettings.Designer.cs index 3c80a93..bdd9f0b 100644 --- a/FormSettings.Designer.cs +++ b/FormSettings.Designer.cs @@ -68,6 +68,7 @@ this.cbxCSVListing = new System.Windows.Forms.CheckBox(); this.cbxPTU = new System.Windows.Forms.CheckBox(); this.cbxDetectGamepad = new System.Windows.Forms.CheckBox(); + this.cbxAutoTabXML = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -424,6 +425,7 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.cbxAutoTabXML); this.groupBox4.Controls.Add(this.cbxListModifiers); this.groupBox4.Controls.Add(this.cbxCSVListing); this.groupBox4.Controls.Add(this.cbxPTU); @@ -460,7 +462,7 @@ // this.cbxPTU.AutoSize = true; this.cbxPTU.BackColor = System.Drawing.Color.SandyBrown; - this.cbxPTU.Location = new System.Drawing.Point(145, 21); + this.cbxPTU.Location = new System.Drawing.Point(9, 67); this.cbxPTU.Name = "cbxPTU"; this.cbxPTU.Size = new System.Drawing.Size(108, 17); this.cbxPTU.TabIndex = 7; @@ -477,6 +479,16 @@ this.cbxDetectGamepad.Text = "Use Gamepad"; this.cbxDetectGamepad.UseVisualStyleBackColor = true; // + // cbxAutoTabXML + // + this.cbxAutoTabXML.AutoSize = true; + this.cbxAutoTabXML.Location = new System.Drawing.Point(9, 44); + this.cbxAutoTabXML.Name = "cbxAutoTabXML"; + this.cbxAutoTabXML.Size = new System.Drawing.Size(247, 17); + this.cbxAutoTabXML.TabIndex = 10; + this.cbxAutoTabXML.Text = "Switch XML/Assignment tab automatically"; + this.cbxAutoTabXML.UseVisualStyleBackColor = true; + // // FormSettings // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -552,5 +564,6 @@ private System.Windows.Forms.TextBox txJS9; private System.Windows.Forms.CheckBox cbxCSVListing; private System.Windows.Forms.CheckBox cbxListModifiers; + private System.Windows.Forms.CheckBox cbxAutoTabXML; } } \ No newline at end of file diff --git a/FormSettings.cs b/FormSettings.cs index d71c883..07b92cb 100644 --- a/FormSettings.cs +++ b/FormSettings.cs @@ -75,6 +75,9 @@ namespace SCJMapper_V2 // Use PTU cbxPTU.Checked = m_owner.UsePTU; + // AutoTabXML + cbxAutoTabXML.Checked = m_owner.AutoTabXML; + // Use CSV Listing cbxCSVListing.Checked = m_owner.UseCSVListing; cbxListModifiers.Checked = m_owner.ListModifiers; @@ -124,6 +127,9 @@ namespace SCJMapper_V2 } m_owner.UsePTU = cbxPTU.Checked; + // AutoTabXML + m_owner.AutoTabXML = cbxAutoTabXML.Checked; + // Use CSV Listing m_owner.UseCSVListing = cbxCSVListing.Checked; m_owner.ListModifiers = cbxListModifiers.Checked; diff --git a/Joystick/JoystickCls.cs b/Joystick/JoystickCls.cs index 947a3bf..a5ded19 100644 --- a/Joystick/JoystickCls.cs +++ b/Joystick/JoystickCls.cs @@ -657,24 +657,6 @@ namespace SCJMapper_V2.Joystick /// The last action as CryEngine compatible string public override string GetLastChange( ) { - // TODO: Expand this out into a joystick class (see commit for details) - Dictionary axies = new Dictionary( ) - { - {"X","x"}, - {"Y","y"}, - {"Z","z"}, - {"RotationX","rotx"}, - {"RotationY","roty"}, - {"RotationZ","rotz"} - }; - - foreach ( KeyValuePair entry in axies ) { - PropertyInfo axisProperty = typeof( JoystickState ).GetProperty( entry.Key ); - - if ( DidAxisChange2( ( int )axisProperty.GetValue( this.m_state, null ), ( int )axisProperty.GetValue( this.m_prevState, null ) ) ) - this.m_lastItem = entry.Value; - } - int[] slider = m_state.Sliders; int[] pslider = m_prevState.Sliders; if ( DidAxisChange2( slider[0], pslider[0] ) ) m_lastItem = "slider1"; @@ -695,6 +677,25 @@ namespace SCJMapper_V2.Joystick m_lastItem = "button" + ( bi + 1 ).ToString( ); } } + + // TODO: Expand this out into a joystick class (see commit for details) + Dictionary axies = new Dictionary( ) + { + {"X","x"}, + {"Y","y"}, + {"Z","z"}, + {"RotationX","rotx"}, + {"RotationY","roty"}, + {"RotationZ","rotz"} + }; + + foreach ( KeyValuePair entry in axies ) { + PropertyInfo axisProperty = typeof( JoystickState ).GetProperty( entry.Key ); + + if ( DidAxisChange2( (int)axisProperty.GetValue( this.m_state, null ), (int)axisProperty.GetValue( this.m_prevState, null ) ) ) + this.m_lastItem = entry.Value; + } + return m_lastItem; } diff --git a/Options/Tuningoptions.cs b/Options/Tuningoptions.cs index f6b92dd..0f0f90e 100644 --- a/Options/Tuningoptions.cs +++ b/Options/Tuningoptions.cs @@ -345,7 +345,8 @@ namespace SCJMapper_V2.Options } else if ( type.ToLowerInvariant( ) == "xboxpad" ) { string toID = TuneOptionID( GamepadCls.DeviceClass, nInstance ); - this[toID].fromXML( xml ); + if ( this.ContainsKey( toID ) ) // 20170513: bugfix if gamepad is in the XML but not connected right now - ignore + this[toID].fromXML( xml ); } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 82fb508..cdc9a5f 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.29.0.63" )] -[assembly: AssemblyFileVersion( "2.29.0.63" )] +[assembly: AssemblyVersion( "2.30.0.64" )] +[assembly: AssemblyFileVersion( "2.30.0.64" )] diff --git a/SCJMapper-V2.csproj b/SCJMapper-V2.csproj index 186e08a..b7d8605 100644 --- a/SCJMapper-V2.csproj +++ b/SCJMapper-V2.csproj @@ -26,8 +26,8 @@ false false true - 63 - 2.29.0.%2a + 64 + 2.30.0.%2a false true diff --git a/actions/ActionTree.cs b/actions/ActionTree.cs index 08f5738..b0c0bf7 100644 --- a/actions/ActionTree.cs +++ b/actions/ActionTree.cs @@ -107,7 +107,7 @@ namespace SCJMapper_V2 { if ( disposing ) { // dispose managed resources - if (m_MasterTree !=null ) m_MasterTree.Dispose( ); + if ( m_MasterTree != null ) m_MasterTree.Dispose( ); } // free native resources } @@ -259,30 +259,6 @@ namespace SCJMapper_V2 } - /// - /// Gets the JS device that is used for one of the Inversion Items supported - /// - /// The Inversion item - /// The device used or null - private DeviceCls GetActionInstance( OptionsInvert.Inversions item ) - { - // must get the jsN information used for Options - string nodeText = ""; - nodeText = FindAction( OptionsInvert.MappedActions[(int)item].Map, OptionsInvert.MappedActions[(int)item].Action ); - if ( !string.IsNullOrWhiteSpace( nodeText ) ) { - DeviceCls dev = DeviceInst.JoystickListRef.Find_jsN( JoystickCls.JSNum( ActionTreeNode.CommandFromNodeText( nodeText ) ) ); - if ( dev != null ) return dev; - else { - // could be a gamepad then - if ( ActionTreeNode.CommandFromNodeText( nodeText ).Contains( "xi_" ) ) { - return DeviceInst.GamepadRef; - } else return null; // nope... - } - } - return null; - } - - /// /// Dumps the actions to an XML string /// @@ -291,7 +267,8 @@ namespace SCJMapper_V2 { if ( ActionMaps != null ) { return ActionMaps.toXML( fileName ); // just propagate if possible - } else { + } + else { log.Error( "ActionTree-toXML: Program error - ActionMaps not yet created" ); return ""; } @@ -370,7 +347,8 @@ namespace SCJMapper_V2 foreach ( ActionTreeNode stn in tn.Nodes ) { if ( ( stn.Tag != null ) && ( (bool)stn.Tag == true ) ) { ; // don't create it i.e hide it - though you cannot hide TreeViewNodes at all... - } else { + } + else { ActionTreeNode tnAction = new ActionTreeNode( stn ); tnMap.Nodes.Add( tnAction ); // copy level 1 nodes foreach ( ActionTreeInputNode istn in stn.Nodes ) { ActionTreeInputNode tnActionInput = new ActionTreeInputNode( istn ); tnAction.Nodes.Add( tnActionInput ); // copy level 2 nodes @@ -485,7 +463,8 @@ namespace SCJMapper_V2 cn.ImageKey = devID; cn.BackColor = Color.White; // some stuff does not work properly... if ( ActivationMode.IsDefault( defActivationModeName ) ) { cn.NodeFont = FontAction; - } else { + } + else { cn.NodeFont = FontActionActivated; } Array.Resize( ref cnl, cnl.Length + 1 ); cnl[cnl.Length - 1] = cn; @@ -508,7 +487,8 @@ namespace SCJMapper_V2 cn.Command = ac.defBinding; cn.BackColor = JoystickCls.JsNColor( jNum ); } } - } else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Gamepad ) { + } + else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Gamepad ) { acc.DevID = GamepadCls.DeviceID; if ( applyDefaults ) { if ( !string.IsNullOrEmpty( ac.defBinding ) ) { @@ -516,7 +496,8 @@ namespace SCJMapper_V2 cn.Command = ac.defBinding; cn.BackColor = GamepadCls.XiColor( ); } } - } else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Keyboard ) { + } + else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Keyboard ) { acc.DevID = KeyboardCls.DeviceID; if ( applyDefaults ) { if ( !string.IsNullOrEmpty( ac.defBinding ) ) { @@ -524,7 +505,8 @@ namespace SCJMapper_V2 cn.Command = ac.defBinding; cn.BackColor = KeyboardCls.KbdColor( ); } } - } else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Mouse ) { // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage) + } + else if ( ac.actionDevice == ActionCls.ActionDevice.AD_Mouse ) { // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage) acc.DevID = MouseCls.DeviceID; if ( applyDefaults ) { if ( !string.IsNullOrEmpty( ac.defBinding ) ) { @@ -584,7 +566,8 @@ namespace SCJMapper_V2 ActionCommandCls acc = ac.FindActionInputObject( ActionTreeNode.CommandFromNodeText( atn.Text ) ); if ( acc == null ) return am; // ERROR exit am = new ActivationModes( ac.defActivationMode, acc.ActivationMode ); // policy: get the default first, then the attached one return am; - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { // this is a child of an action with further commands ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 1 @@ -617,14 +600,16 @@ namespace SCJMapper_V2 // new am is either a named one or the Default from Profile (which is the default from the Action due to multiTaps..) if ( ActivationMode.IsDefault( newActivationModeName ) ) { acc.ActivationMode = new ActivationMode( ActivationMode.Default ); - } else { + } + else { acc.ActivationMode = ActivationModes.Instance.ActivationModeByName( newActivationModeName ); } atn.UpdateAction( acc ); UpdateMasterNode( atn ); NodeSelected( this.SelectedAction, this.SelectedCtrl ); // virtual event - as the selection does not change Dirty = true; - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { // this is a child of an action with further commands ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode from a level 2 ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 2 @@ -635,7 +620,8 @@ namespace SCJMapper_V2 // new am is either a named one or the Default from Profile (which is the default from the Action due to multiTaps..) if ( ActivationMode.IsDefault( newActivationModeName ) ) { acc.ActivationMode = new ActivationMode( ActivationMode.Default ); - } else { + } + else { acc.ActivationMode = ActivationModes.Instance.ActivationModeByName( newActivationModeName ); } atn.UpdateAction( acc ); UpdateMasterNode( atn ); @@ -672,7 +658,8 @@ namespace SCJMapper_V2 NodeSelected( this.SelectedAction, this.SelectedCtrl ); // virtual event - as the selection does not change Dirty = true; - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { // this is a child of an action with further commands ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode from a level 2 ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 2 @@ -804,7 +791,8 @@ namespace SCJMapper_V2 matn.UpdateAction( acc ); UpdateMasterNode( matn ); matn.Nodes.Clear( ); // clear add childs - those don't persist from newly loaded actionmaps first = false; - } else { + } + else { // have to recreate the action child nodes ActionTreeInputNode matin = new ActionTreeInputNode( "UNDEF" ); matin.ImageKey = "Add"; acc.NodeIndex = matin.Index; // assign visual reference @@ -846,7 +834,8 @@ namespace SCJMapper_V2 if ( Ctrl.SelectedNode == stn ) NodeSelected( this.SelectedAction, this.SelectedCtrl ); Ctrl.SelectedNode = stn; Ctrl.SelectedNode.EnsureVisible( ); - } else { + } + else { // have to search nodes of nodes int ni = 0; foreach ( ActionTreeInputNode sstn in stn.Nodes ) { @@ -931,93 +920,44 @@ namespace SCJMapper_V2 /// - /// Find a control that contains the Action (exact match) + /// Find all actions that are mapped to this input /// - /// The actionmap to find the string - /// The string to find - public string FindActionKey( string actionmap, string actionKey ) + /// The input string to find + public List FindAllActions( string input ) { - log.Debug( "FindActionKey - Entry" ); - - foreach ( ActionTreeNode tn in Ctrl.Nodes ) { - if ( string.IsNullOrEmpty( actionmap ) || ( tn.Text == actionmap ) ) { - // have to search nodes of nodes - foreach ( ActionTreeNode stn in tn.Nodes ) { - if ( stn.Name == actionKey ) { - return stn.Text; - } - } - } - } - return ""; - } - - /// - /// Find a control that contains the Action (exact match) - /// - /// The actionmap to find the string - /// The string to find - public string FindAction( string actionmap, string action ) - { - log.Debug( "FindAction - Entry" ); - - foreach ( ActionTreeNode tn in Ctrl.Nodes ) { - if ( string.IsNullOrEmpty( actionmap ) || ( tn.Text == actionmap ) ) { - // have to search nodes of nodes - foreach ( ActionTreeNode stn in tn.Nodes ) { - if ( stn.Action == action ) { - return stn.Text; - } + List ret = new List( ); + if ( string.IsNullOrEmpty( input ) ) return ret; // nothing to find here... + if ( ActionCls.IsBlendedInput(input) ) return ret; // nothing to find here... + + ret.Add( "Actions listed for Input: " + input ); + ret.Add( "" ); + ret.Add( "location - action - actionmap - activation mode" ); + ret.Add( "" ); + string aMode = ""; + foreach ( ActionMapCls acm in ActionMaps ) { + // have to search Actions in Maps + foreach ( ActionCls ac in acm ) { + string l = ""; // return line composition + if ( ac.defBinding == input ) { + ret.Add( "" ); + aMode = string.Format( "{0};{1}", ac.defActivationMode.Name, ac.defActivationMode.MultiTap ); + l = string.Format( "{0} - {1} - {2} - {3}", "profile",ac.name, acm.name, aMode ); + ret.Add( l ); } - } - } - return ""; - } - - /// - /// Find a control that contains the Action - /// - /// The string to find - public string FindAction( string action ) - { - return FindAction( "", action ); - } - - - /// - /// Find a control that contains the Command - /// - /// The actionmap to find the string - /// The string to find - public string FindCommand( string actionmap, string command ) - { - log.Debug( "FindCommand - Entry" ); - - foreach ( ActionTreeNode tn in Ctrl.Nodes ) { - if ( string.IsNullOrEmpty( actionmap ) || ( tn.Text == actionmap ) ) { - // have to search nodes of nodes - foreach ( ActionTreeNode stn in tn.Nodes ) { - foreach ( ActionTreeInputNode istn in stn.Nodes ) { - if ( istn.Command.Contains( command ) ) { - return stn.Text + " - " + istn.Text; - } + foreach ( ActionCommandCls acc in ac.inputList ) { + if ( acc.DevInput == input ) { + aMode = string.Format( "modified;{0};{1}", acc.ActivationMode.Name, acc.ActivationMode.MultiTap ); + if ( acc.ActivationMode == ActivationMode.Default ) + aMode = string.Format( "default" ); + l = string.Format( "{0} - {1} - {2} - {3}", "mapped ", ac.name, acm.name, aMode ); + ret.Add( l ); } } } } - return ""; + return ret; } - /// - /// Find a control that contains the Command - /// - /// The string to find - public string FindCommand( string command ) - { - return FindCommand( "", command ); - } - - /// /// Find a control the the actionmap that contains the Text /// @@ -1060,10 +1000,12 @@ namespace SCJMapper_V2 if ( Ctrl.SelectedNode.Level == 1 ) { ActionTreeNode matn = FindMasterAction( (ActionTreeNode)Ctrl.SelectedNode ); return ActionTreeNode.ActionFromNodeText( matn.Text ); - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { ActionTreeNode matn = FindMasterAction( (ActionTreeNode)Ctrl.SelectedNode.Parent ); // the parent treenode return ActionTreeNode.ActionFromNodeText( matn.Text ); - } else return ""; + } + else return ""; } } @@ -1089,7 +1031,8 @@ namespace SCJMapper_V2 string actionID = DS_ActionMap.ActionID( atn.Parent.Name, ac.key, acc.NodeIndex ); return actionID; - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { // this is a child of an action with further commands ActionTreeNode patn = ( Ctrl.SelectedNode.Parent as ActionTreeNode ); // the parent treenode from a level 2 ActionTreeNode atn = ( Ctrl.SelectedNode as ActionTreeNode ); // the treenode from a level 2 @@ -1101,7 +1044,8 @@ namespace SCJMapper_V2 string actionID = DS_ActionMap.ActionID( atn.Parent.Name, ac.key, acc.NodeIndex ); return actionID; - } else return ""; + } + else return ""; } } @@ -1115,10 +1059,12 @@ namespace SCJMapper_V2 if ( Ctrl.SelectedNode.Level == 1 ) { ActionTreeNode matn = FindMasterAction( (ActionTreeNode)Ctrl.SelectedNode ); return ActionTreeNode.CommandFromNodeText( matn.Text ); - } else if ( Ctrl.SelectedNode.Level == 2 ) { + } + else if ( Ctrl.SelectedNode.Level == 2 ) { ActionTreeNode matn = FindMasterAction( (ActionTreeNode)Ctrl.SelectedNode.Parent ); // the parent treenode return ActionTreeNode.CommandFromNodeText( matn.Text ); - } else return ""; + } + else return ""; } } @@ -1144,7 +1090,8 @@ namespace SCJMapper_V2 if ( acc != null ) { acc.UpdateCommandFromInput( ActionCls.DevInput( DS_ActionMap.DevInput( ar ), ActionCls.ADevice( ar.Device ) ), ActionCls.ADevice( ar.Device ) ); ar.Usr_Binding = acc.DevInput; // feedback the right one - } else { + } + else { ; // DEBUG should not happen... } } @@ -1157,7 +1104,8 @@ namespace SCJMapper_V2 NodeSelected( this.SelectedAction, this.SelectedCtrl ); nTree.Dirty = true; return nTree; - } else { + } + else { return null; } @@ -1195,12 +1143,14 @@ namespace SCJMapper_V2 if ( !string.IsNullOrEmpty( acc.Input ) /* && !( acc.Input == DeviceCls.BlendedInput )*/ ) { if ( acc.DevInput == ac.defBinding ) { rep = string.Format( " {0} . {1} _ {2}", ac.name.PadRight( padAction ), acc.DevID.PadRight( padDevice ), acc.Input.PadRight( padInput ) ); - } else { + } + else { rep = string.Format( " {0} + {1} _ {2}", ac.name.PadRight( padAction ), acc.DevID.PadRight( padDevice ), acc.Input.PadRight( padInput ) ); // my binding } if ( acc.ActivationMode == ActivationMode.Default ) { rep += string.Format( " . [{1}] {0}\n", ac.defActivationMode.Name, ac.defActivationMode.MultiTap ); - } else { + } + else { rep += string.Format( " # [{1}] {0}\n", acc.ActivationMode.Name, acc.ActivationMode.MultiTap ); } @@ -1241,7 +1191,8 @@ namespace SCJMapper_V2 repList += ";js2-tag;js2-input;js2-mod-tag;js2-mod-mode;js2-mod-multi"; repList += ";js3-tag;js3-input;js3-mod-tag;js3-mod-mode;js3-mod-multi"; repList += ";js4-tag;js4-input;js4-mod-tag;js4-mod-mode;js4-mod-multi"; - } else { + } + else { repList += ";kbd-tag;kbd-input"; // col description line repList += ";mouse-tag;mouse-input"; repList += ";xpad-tag;xpad-input"; @@ -1271,7 +1222,8 @@ namespace SCJMapper_V2 // note: don't add trailing semicolons as the are applied in the output formatting if ( listModifiers ) { kbA = "n.a.;;;;"; // defaults tag;input;mod-tag;mod-name;mod-mult - } else { + } + else { kbA = "n.a.;"; // defaults tag;input } moA = kbA; xbA = kbA; @@ -1284,7 +1236,7 @@ namespace SCJMapper_V2 if ( !string.IsNullOrEmpty( acc.Input ) ) { // set modified - note: don't add trailing semicolons as the are applied in the output formatting string aTag = "modified"; //default or modified - string aMode = string.Format( "modified;{0};{1}", ac.defActivationMode.Name, ac.defActivationMode.MultiTap ); + string aMode = string.Format( "modified;{0};{1}", acc.ActivationMode.Name, acc.ActivationMode.MultiTap ); // change if they are default mappings if ( acc.DevInput == ac.defBinding ) aTag = "default"; if ( acc.ActivationMode == ActivationMode.Default ) aMode = string.Format( "default;{0};{1}", ac.defActivationMode.Name, ac.defActivationMode.MultiTap ); @@ -1298,7 +1250,8 @@ namespace SCJMapper_V2 case ActionCls.ActionDevice.AD_Gamepad: xbA = string.Format( "{0};{1};{2}", aTag, acc.Input, aMode ); break; default: break; }//switch - } else { + } + else { switch ( ActionCls.ADeviceFromDevID( acc.DevID ) ) { case ActionCls.ActionDevice.AD_Keyboard: kbA = string.Format( "{0};{1}", aTag, acc.Input ); break; case ActionCls.ActionDevice.AD_Mouse: moA = string.Format( "{0};{1}", aTag, acc.Input ); break; diff --git a/doc/ReadMe.txt b/doc/ReadMe.txt index ecc86ac..f4eafe6 100644 --- a/doc/ReadMe.txt +++ b/doc/ReadMe.txt @@ -1,10 +1,10 @@ -SC Joystick Mapper V 2.29 - Build 63 BETA -(c) Cassini, StandardToaster - 06-May-2017 +SC Joystick Mapper V 2.30 - Build 64 BETA +(c) Cassini, StandardToaster - 13-May-2017 Contains 9 files: -SCJMapper.exe The program (V2.29) -SCJMapper.exe.config Program config (V2.29) - MUST be in the same folder as the Exe file +SCJMapper.exe The program (V2.30) +SCJMapper.exe.config Program config (V2.30) - MUST be in the same folder as the Exe file SharpDX.DirectInput.dll Managed DirectInput Assembly - MUST be in the same folder as the Exe file SharpDX.dll Managed DirectX Assembly - MUST be in the same folder as the Exe file OpenTK.dll Managed OpenGL Assembly - MUST be in the same folder as the Exe file @@ -13,7 +13,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.29beta.pdf Quick Guide +SCJMapper_QGuide V2.30beta.pdf Quick Guide ReadMe.txt This file graphics folder Skybox Images (V2.28) - graphics folder MUST be in the same folder as the Exe file @@ -28,6 +28,13 @@ https://github.com/SCToolsfactory/SCJMapper-V2 Scanned for viruses before packing... cassini@burri-web.org +Changelog: +V 2.30 - BETA Build 64 +- add - Tab to show all mappings for the current input (Tabbed with XML other Dump items) +- add - Setting (enabled, disabled -> default) to automatically switch the new tabs - either Input or Dump +- fix - issue with user activations modes while dumping the mapping list +- fix - issue with loading a map with gamepad mappings and the gamepad is not connected +- update - doc SCJMapper_QGuide V2.30beta.pdf Changelog: V 2.29 - BETA Build 63 - add - Calibrate gamepad thumb axes (press ABXY buttons all together and wait 2 sec - should zero all 4 axes)