V 2.25 - BETA Build 59

- fix - an issue in parsing options from imported maps
- add - an option to show the actiontree as CSV list with more/less details (change in Settings)
- improvement - In table view add possibility to Blend All visible unmapped entries
pull/104/head
bm98 8 years ago
parent f60c49ccc8
commit d49b0bf934

@ -263,6 +263,22 @@ namespace SCJMapper_V2
set { this["UsePTU"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean UseCSVListing
{
get { return ( Boolean )this["UseCSVListing"]; }
set { this["UseCSVListing"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean ListModifiers
{
get { return ( Boolean )this["ListModifiers"]; }
set { this["ListModifiers"] = value; }
}
//**** Form Table

@ -908,7 +908,11 @@ namespace SCJMapper_V2
private void btDumpList_Click( object sender, EventArgs e )
{
rtb.Text = String.Format( "-- {0} - SC Joystick Mapping --\n{1}", DateTime.Now, m_AT.ReportActions( ) );
if ( m_AppSettings.UseCSVListing )
rtb.Text = String.Format( "-- {0} - SC Joystick Mapping --\n{1}", DateTime.Now, m_AT.ReportActionsCSV( m_AppSettings.ListModifiers ) );
else
rtb.Text = String.Format( "-- {0} - SC Joystick Mapping --\n{1}", DateTime.Now, m_AT.ReportActions( ) );
}
private void btDumpLog_Click( object sender, EventArgs e )

@ -64,6 +64,8 @@
this.btCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.cbxListModifiers = new System.Windows.Forms.CheckBox();
this.cbxCSVListing = new System.Windows.Forms.CheckBox();
this.cbxPTU = new System.Windows.Forms.CheckBox();
this.cbxDetectGamepad = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
@ -418,10 +420,11 @@
this.label1.TabIndex = 26;
this.label1.Text = "Note: Accepting changes will clear the action tree to apply the new settings; Can" +
"cel now if you want to save your work first.";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.cbxListModifiers);
this.groupBox4.Controls.Add(this.cbxCSVListing);
this.groupBox4.Controls.Add(this.cbxPTU);
this.groupBox4.Controls.Add(this.cbxDetectGamepad);
this.groupBox4.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -432,6 +435,26 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Advanced Options ...";
//
// cbxListModifiers
//
this.cbxListModifiers.AutoSize = true;
this.cbxListModifiers.Location = new System.Drawing.Point(420, 44);
this.cbxListModifiers.Name = "cbxListModifiers";
this.cbxListModifiers.Size = new System.Drawing.Size(97, 17);
this.cbxListModifiers.TabIndex = 9;
this.cbxListModifiers.Text = "List Modifiers";
this.cbxListModifiers.UseVisualStyleBackColor = true;
//
// cbxCSVListing
//
this.cbxCSVListing.AutoSize = true;
this.cbxCSVListing.Location = new System.Drawing.Point(400, 21);
this.cbxCSVListing.Name = "cbxCSVListing";
this.cbxCSVListing.Size = new System.Drawing.Size(106, 17);
this.cbxCSVListing.TabIndex = 8;
this.cbxCSVListing.Text = "Use CSV Listing";
this.cbxCSVListing.UseVisualStyleBackColor = true;
//
// cbxPTU
//
this.cbxPTU.AutoSize = true;
@ -525,5 +548,7 @@
private System.Windows.Forms.TextBox txJS10;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txJS9;
private System.Windows.Forms.CheckBox cbxCSVListing;
private System.Windows.Forms.CheckBox cbxListModifiers;
}
}

@ -73,6 +73,10 @@ namespace SCJMapper_V2
// Use PTU
cbxPTU.Checked = m_owner.UsePTU;
// Use CSV Listing
cbxCSVListing.Checked = m_owner.UseCSVListing;
cbxListModifiers.Checked = m_owner.ListModifiers;
}
@ -118,6 +122,10 @@ namespace SCJMapper_V2
}
m_owner.UsePTU = cbxPTU.Checked;
// Use CSV Listing
m_owner.UseCSVListing = cbxCSVListing.Checked;
m_owner.ListModifiers = cbxListModifiers.Checked;
m_owner.Save( );
}
@ -182,11 +190,6 @@ namespace SCJMapper_V2
}
}
private void label1_Click( object sender, EventArgs e )
{
}
}
}

@ -302,34 +302,36 @@ namespace SCJMapper_V2.Joystick
}
}
// we may have a nonlin curve...
reader.Read( );
if ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant( ) == "nonlinearity_curve" ) {
m_PtsIn.Clear( ); m_PtsOut.Clear( ); // reset pts
reader.Read( );
while ( !reader.EOF ) {
String ptIn = "";
String ptOut = "";
if ( reader.Name.ToLowerInvariant( ) == "point" ) {
if ( reader.HasAttributes ) {
ptIn = reader["in"];
ptOut = reader["out"];
m_PtsIn.Add( ptIn ); m_PtsOut.Add( ptOut ); m_ptsEnabled = true;
if ( ! reader.IsEmptyElement ) {
reader.Read( );
if ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant( ) == "nonlinearity_curve" ) {
m_PtsIn.Clear( ); m_PtsOut.Clear( ); // reset pts
reader.Read( );
while ( !reader.EOF ) {
String ptIn = "";
String ptOut = "";
if ( reader.Name.ToLowerInvariant( ) == "point" ) {
if ( reader.HasAttributes ) {
ptIn = reader["in"];
ptOut = reader["out"];
m_PtsIn.Add( ptIn ); m_PtsOut.Add( ptOut ); m_ptsEnabled = true;
}
}
reader.Read( );
}//while
// sanity check - we've have to have 3 pts here - else we subst
// add 2nd
if ( m_PtsIn.Count < 2 ) {
m_PtsIn.Add( "0.5" ); m_PtsOut.Add( "0.5" );
log.Info( "Options_fromXML: got only one nonlin point, added (0.5|0.5)" );
}
// add 3rd
if ( m_PtsIn.Count < 3 ) {
m_PtsIn.Add( "0.75" ); m_PtsOut.Add( "0.75" );
log.Info( "Options_fromXML: got only two nonlin points, added (0.75|0.75)" );
}
reader.Read( );
}//while
// sanity check - we've have to have 3 pts here - else we subst
// add 2nd
if ( m_PtsIn.Count < 2 ) {
m_PtsIn.Add( "0.5" ); m_PtsOut.Add( "0.5" );
log.Info( "Options_fromXML: got only one nonlin point, added (0.5|0.5)" );
}
// add 3rd
if ( m_PtsIn.Count < 3 ) {
m_PtsIn.Add( "0.75" ); m_PtsOut.Add( "0.75" );
log.Info( "Options_fromXML: got only two nonlin points, added (0.75|0.75)" );
}
}
}

@ -23,17 +23,22 @@ namespace SCJMapper_V2.Joystick
/// [option] : instance, sensitivity, exponent, nonlinearity *instance is a bug that will be fixed to 'invert' in the future
/// [value] : for invert use 0/1; for others use 0.0 to 2.0
///
/// options are given per deviceClass and instance - it seems
/// </summary>
public class Options
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
// Support only one set of independent options (string storage)
List<String> m_stringOptions = new List<String>( );
// Support only one set of TuningParameters (there is only ONE Joystick Pitch, Yaw, Roll control possible, they can be on different instances however)
DeviceTuningParameter m_tuningP = null; // pitch
DeviceTuningParameter m_tuningY = null; // yaw
DeviceTuningParameter m_tuningR = null; // roll
List<OptionsInvert> m_inverter = new List<OptionsInvert>( ); // all invertes
// Have to support Inverters for all possible JS Instances here - right now 4 are supported - provide them for all 12 we support..
public List<OptionsInvert> m_inverter = new List<OptionsInvert>( ); // all inverters
private List<CheckBox> m_invertCB = null; // Options owns and handles all Inversions
@ -45,9 +50,9 @@ namespace SCJMapper_V2.Joystick
m_tuningR = new DeviceTuningParameter( );
// create inverters (
for (int i=0; i<(int)OptionsInvert.Inversions.I_LAST; i++) {
for ( int i = 0; i < ( int )OptionsInvert.Inversions.I_LAST; i++ ) {
OptionsInvert inv = new OptionsInvert((OptionsInvert.Inversions)i);
m_inverter.Add(inv);
m_inverter.Add( inv );
}
}
@ -89,6 +94,7 @@ namespace SCJMapper_V2.Joystick
/// <returns>An Inverter object</returns>
public OptionsInvert Inverter( OptionsInvert.Inversions item )
{
// instance is 1.. - array is 0...
return m_inverter[( int )item];
}
@ -97,8 +103,8 @@ namespace SCJMapper_V2.Joystick
/// </summary>
public List<CheckBox> InvertCheckList
{
set {
m_invertCB = value;
set {
m_invertCB = value;
// assuming the ENUM sequence of Checkboxes here...
// Note: the flight Flight ones above are not handled twice i.e. are assigned below but not used
int i = 0;
@ -114,7 +120,7 @@ namespace SCJMapper_V2.Joystick
public void ResetInverter( )
{
foreach ( OptionsInvert inv in m_inverter ) {
inv.Reset();
inv.Reset( );
}
}
@ -125,8 +131,7 @@ namespace SCJMapper_V2.Joystick
try {
XDocument doc = XDocument.Parse( xml );
return doc.ToString( ).Split( new String[] { String.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries );
}
catch ( Exception ) {
} catch ( Exception ) {
return new String[] { xml };
}
}
@ -215,17 +220,18 @@ namespace SCJMapper_V2.Joystick
reader.Read( );
String type = "";
String instance = "";
String instance = ""; int nInstance = 0;
if ( reader.HasAttributes ) {
type = reader["type"];
if ( !(( type.ToLowerInvariant( ) == "joystick") || (type.ToLowerInvariant( ) == "xboxpad") ) ) {
if ( !( ( type.ToLowerInvariant( ) == "joystick" ) || ( type.ToLowerInvariant( ) == "xboxpad" ) ) ) {
// save as plain text
if ( !m_stringOptions.Contains( xml ) ) m_stringOptions.Add( xml );
return true;
}
// further on..
instance = reader["instance"];
if ( !int.TryParse( instance, out nInstance ) ) nInstance = 0;
reader.Read( );
// try to disassemble the items
@ -259,46 +265,33 @@ namespace SCJMapper_V2.Joystick
*/
while ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant() == "flight_move_pitch" ) {
if ( reader.Name.ToLowerInvariant( ) == "flight_move_pitch" ) {
m_tuningP.Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_move_yaw" ) {
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_yaw" ) {
m_tuningY.Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_move_roll" ) {
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_roll" ) {
m_tuningR.Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_vertical" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_lateral" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_longitudinal" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_pitch" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_yaw" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_aim_yaw].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_view_pitch" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_view_pitch].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_view_yaw" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_view_yaw].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_vertical" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_lateral" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_longitudinal" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_pitch" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_yaw" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_aim_yaw].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_view_pitch" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_view_pitch].Options_fromXML( reader, type, int.Parse( instance ) );
}
else if ( reader.Name.ToLowerInvariant( ) == "flight_view_yaw" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_view_yaw].Options_fromXML( reader, type, int.Parse( instance ) );
}
// Throttle abs/rel are treated the same and use the throttle group only
else if ( reader.Name.ToLowerInvariant( ) == "flight_throttle" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_throttle].Options_fromXML( reader, type, int.Parse( instance ) );
}
// Throttle abs/rel are treated the same and use the throttle group only
else if ( reader.Name.ToLowerInvariant( ) == "flight_throttle" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_throttle].Options_fromXML( reader, type, int.Parse( instance ) );
else {
} else if ( reader.NodeType != XmlNodeType.EndElement ) {
//??
log.InfoFormat( "Options.fromXML: unknown node - {0} - stored as is", reader.Name );
if ( !m_stringOptions.Contains( xml ) ) m_stringOptions.Add( xml );

@ -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.24.0.58" )]
[assembly: AssemblyFileVersion( "2.24.0.58" )]
[assembly: AssemblyVersion( "2.25.0.59" )]
[assembly: AssemblyFileVersion( "2.25.0.59" )]

@ -26,8 +26,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>58</ApplicationRevision>
<ApplicationVersion>2.24.0.%2a</ApplicationVersion>
<ApplicationRevision>59</ApplicationRevision>
<ApplicationVersion>2.25.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>

@ -53,6 +53,7 @@
this.chkGamepad = new System.Windows.Forms.CheckBox();
this.chkJoystick = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.btBlendAll = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dS_ActionMaps)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dSActionMapsBindingSource)).BeginInit();
@ -143,6 +144,7 @@
//
// panel1
//
this.panel1.Controls.Add(this.btBlendAll);
this.panel1.Controls.Add(this.btCancelEdit);
this.panel1.Controls.Add(this.chkEditBlend);
this.panel1.Controls.Add(this.btUpdateFromEdit);
@ -182,7 +184,7 @@
this.chkEditBlend.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.chkEditBlend.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkEditBlend.ForeColor = System.Drawing.Color.Firebrick;
this.chkEditBlend.Location = new System.Drawing.Point(184, 145);
this.chkEditBlend.Location = new System.Drawing.Point(76, 126);
this.chkEditBlend.Name = "chkEditBlend";
this.chkEditBlend.Size = new System.Drawing.Size(96, 17);
this.chkEditBlend.TabIndex = 12;
@ -270,7 +272,7 @@
// chkKbd
//
this.chkKbd.AutoSize = true;
this.chkKbd.Location = new System.Drawing.Point(222, 105);
this.chkKbd.Location = new System.Drawing.Point(222, 93);
this.chkKbd.Name = "chkKbd";
this.chkKbd.Size = new System.Drawing.Size(46, 17);
this.chkKbd.TabIndex = 4;
@ -281,7 +283,7 @@
// chkMouse
//
this.chkMouse.AutoSize = true;
this.chkMouse.Location = new System.Drawing.Point(158, 105);
this.chkMouse.Location = new System.Drawing.Point(158, 93);
this.chkMouse.Name = "chkMouse";
this.chkMouse.Size = new System.Drawing.Size(61, 17);
this.chkMouse.TabIndex = 4;
@ -292,7 +294,7 @@
// chkGamepad
//
this.chkGamepad.AutoSize = true;
this.chkGamepad.Location = new System.Drawing.Point(80, 105);
this.chkGamepad.Location = new System.Drawing.Point(80, 93);
this.chkGamepad.Name = "chkGamepad";
this.chkGamepad.Size = new System.Drawing.Size(75, 17);
this.chkGamepad.TabIndex = 4;
@ -303,7 +305,7 @@
// chkJoystick
//
this.chkJoystick.AutoSize = true;
this.chkJoystick.Location = new System.Drawing.Point(10, 105);
this.chkJoystick.Location = new System.Drawing.Point(10, 93);
this.chkJoystick.Name = "chkJoystick";
this.chkJoystick.Size = new System.Drawing.Size(65, 17);
this.chkJoystick.TabIndex = 3;
@ -320,6 +322,17 @@
this.label1.TabIndex = 2;
this.label1.Text = "Action Filter";
//
// btBlendAll
//
this.btBlendAll.Enabled = false;
this.btBlendAll.Location = new System.Drawing.Point(183, 122);
this.btBlendAll.Name = "btBlendAll";
this.btBlendAll.Size = new System.Drawing.Size(97, 23);
this.btBlendAll.TabIndex = 14;
this.btBlendAll.Text = "Blend All";
this.btBlendAll.UseVisualStyleBackColor = true;
this.btBlendAll.Click += new System.EventHandler(this.btBlendAll_Click);
//
// FormTable
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -372,5 +385,6 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.CheckBox chkEditBlend;
private System.Windows.Forms.Button btCancelEdit;
private System.Windows.Forms.Button btBlendAll;
}
}

@ -276,6 +276,8 @@ namespace SCJMapper_V2.Table
{
// toggle the Edit mode of the Blend Column
btUpdateFromEdit.Enabled = chkEditBlend.Checked;
btBlendAll.Enabled = chkEditBlend.Checked;
DGV.ReadOnly = !chkEditBlend.Checked;
}
@ -286,6 +288,17 @@ namespace SCJMapper_V2.Table
}
private void btBlendAll_Click( object sender, EventArgs e )
{
if ( !chkEditBlend.Checked ) return; // only if Edit is allowed
foreach ( DataGridViewRow row in DGV.Rows ) {
if (string.IsNullOrEmpty((string) row.Cells[DGV.Columns["Usr_Binding"].Index].Value ))
row.Cells[DGV.Columns["Blended"].Index].Value = true;
}
}
private void DGV_CurrentCellDirtyStateChanged( object sender, EventArgs e )
{
// Immediately handle changes of the Blended Checkbox - workaround the regular DGV behavior

@ -111,7 +111,7 @@ namespace SCJMapper_V2
/// <summary>
/// Try to derive the device class from the input string
/// Try to derive the device class from the devInput string (mo1_, kb1_, xi1_, jsN_)
/// </summary>
/// <param name="devInput">The input command string dev_input format</param>
/// <returns>A proper DeviceClass string</returns>
@ -130,15 +130,27 @@ namespace SCJMapper_V2
// others..
return deviceClass;
}
/// <summary>
/// Returns the ActionDevice from a deviceID or devInput string (mo1_, kb1_, xi1_, jsN_)
/// Returns the ActionDevice from a deviceID (a trailing _ is added if not there)
/// </summary>
/// <param name="devID">DeviceID or devInput string</param>
/// <param name="devID">DeviceID</param>
/// <returns>The ActionDevice</returns>
static public ActionDevice ADeviceFromDevID( string devID )
{
return ADevice( DeviceClassFromInput( devID ) );
string val = devID;
if ( !devID.EndsWith( "_" ) ) val += "_";
return ADevice( DeviceClassFromInput( val ) );
}
/// <summary>
/// Returns the ActionDevice from the devInput string (mo1_, kb1_, xi1_, jsN_)
/// </summary>
/// <param name="devInput">The input command string dev_input format</param>
/// <returns>The ActionDevice</returns>
static public ActionDevice ADeviceFromInput( string devInput )
{
return ADevice( DeviceClassFromInput( devInput ) );
}
/// <summary>
@ -214,7 +226,7 @@ namespace SCJMapper_V2
static public System.Drawing.Color DeviceColor( string devInput )
{
// background is along the input
ActionDevice aDevice = ADeviceFromDevID( devInput);
ActionDevice aDevice = ADeviceFromInput( devInput);
switch ( aDevice ) {
case ActionDevice.AD_Gamepad: return GamepadCls.XiColor( );
case ActionDevice.AD_Joystick: {

@ -56,7 +56,7 @@ namespace SCJMapper_V2
private JoystickList m_joystickList = null;
private UICustHeader m_uiCustHeader = null;
private Options m_options = null;
private Options m_options = null; // options are given per deviceClass and instance - it seems
private Deviceoptions m_deviceOptions = null;
private Modifiers m_modifiers = null;

@ -1105,7 +1105,7 @@ namespace SCJMapper_V2
int countChanges = 0;
foreach ( DS_ActionMaps.T_ActionRow ar in dsa.T_Action ) {
if ( ar.RowState== System.Data.DataRowState.Modified ) {
if ( ar.RowState == System.Data.DataRowState.Modified ) {
countChanges++;
ActionCommandCls acc = FindActionInputObject(nTree, DS_ActionMap.ActionMap(ar), DS_ActionMap.ActionKey(ar), DS_ActionMap.ActionCommandIndex(ar));
if ( acc != null ) {
@ -1123,8 +1123,7 @@ namespace SCJMapper_V2
nTree.Dirty = true;
return nTree;
}
else {
} else {
return null;
}
@ -1182,5 +1181,113 @@ namespace SCJMapper_V2
}
/// <summary>
/// Reports a summary list of the mapped items
/// </summary>
/// <returns></returns>
public String ReportActionsCSV( bool listModifiers )
{
log.Debug( "FindCtrl - ReportActions2" );
String repList = "";
// JS assignments
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" );
repList += "actionmap;action"; // col description line
if (listModifiers ) {
repList += ";kbd-tag;kbd-input;kbd-mod-tag;kbd-mod-mode;kbd-mod-multi"; // col description line
repList += ";mouse-tag;mouse-input;mouse-mod-tag;mouse-mod-mode;mouse-mod-multi";
repList += ";xpad-tag;xpad-input;xpad-mod-tag;xpad-mod-mode;xpad-mod-multi";
repList += ";js1-tag;js1-input;js1-mod-tag;js1-mod-mode;js1-mod-multi";
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 {
repList += ";kbd-tag;kbd-input"; // col description line
repList += ";mouse-tag;mouse-input";
repList += ";xpad-tag;xpad-input";
repList += ";js1-tag;js1-input";
repList += ";js2-tag;js2-input";
repList += ";js3-tag;js3-input";
repList += ";js4-tag;js4-input";
}
repList += string.Format( "\n" );
string action = "";
string rep = ""; string kbA = ""; string moA = ""; string xbA = ""; string[] jsA = new string[] { "", "", "", "" };
foreach ( ActionMapCls acm in ActionMaps ) {
foreach ( ActionCls ac in acm ) {
// we get an action for each device class here - sort it out
if ( ac.name != action ) {
// dump if not empty
if ( !string.IsNullOrEmpty( action ) ) {
// compose one action
rep += string.Format( "{0};{1};{2};{3};{4};{5};{6}\n", kbA, moA, xbA, jsA[0], jsA[1], jsA[2], jsA[3] ); // should be one line now
repList += String.Format( "{0}", rep ); // add to list
}
// action changed - restart collection
action = ac.name;
rep = string.Format( "{0};{1};", acm.name, ac.name ); // actionmap; action
// 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 {
kbA = "n.a.;"; // defaults tag;input
}
moA = kbA; xbA = kbA;
jsA = new string[] { kbA, kbA, kbA, kbA };
}
foreach ( ActionCommandCls acc in ac.inputList ) {
// this is for add binds
if ( ShowAction( ac.actionDevice, acc.Input ) ) {
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 );
// 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 );
if ( listModifiers ) {
switch ( ActionCls.ADeviceFromDevID( acc.DevID ) ) {
case ActionCls.ActionDevice.AD_Keyboard: kbA = string.Format( "{0};{1};{2}", aTag, acc.Input, aMode ); break;
case ActionCls.ActionDevice.AD_Mouse: moA = string.Format( "{0};{1};{2}", aTag, acc.Input, aMode ); break;
case ActionCls.ActionDevice.AD_Joystick:
int jsNum = JoystickCls.JSNum(acc.DevInput) - 1;
if ( jsNum >= 0 ) jsA[jsNum] = string.Format( "{0};{1};{2}", aTag, acc.Input, aMode ); break;
case ActionCls.ActionDevice.AD_Gamepad: xbA = string.Format( "{0};{1};{2}", aTag, acc.Input, aMode ); break;
default: break;
}//switch
} 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;
case ActionCls.ActionDevice.AD_Joystick:
int jsNum = JoystickCls.JSNum(acc.DevInput) - 1;
if ( jsNum >= 0 ) jsA[jsNum] = string.Format( "{0};{1}", aTag, acc.Input ); break;
case ActionCls.ActionDevice.AD_Gamepad: xbA = string.Format( "{0};{1}", aTag, acc.Input ); break;
default: break;
}//switch
}
}
}// show
}// for aCmd
}// for action
}
// add the last one
// compose one action
rep += string.Format( "{0};{1};{2};{3};{4};{5};{6}\n", kbA, moA, xbA, jsA[0], jsA[1], jsA[2], jsA[3] ); // should be one line now
repList += String.Format( "{0}", rep ); // add to list
return repList;
}
}
}

@ -1,10 +1,10 @@
SC Joystick Mapper V 2.24 - Build 58 BETA
(c) Cassini, StandardToaster - 31-May-2016
SC Joystick Mapper V 2.25 - Build 59 BETA
(c) Cassini, StandardToaster - 01-Jul-2016
Contains 9 files:
SCJMapper.exe The program (V2.24)
SCJMapper.exe.config Program config (V2.24) - MUST be in the same folder as the Exe file
SCJMapper.exe The program (V2.25)
SCJMapper.exe.config Program config (V2.25) - 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.23beta.pdf Quick Guide
SCJMapper_QGuide V2.25beta.pdf Quick Guide
ReadMe.txt This file
graphics folder Skybox Images - graphics folder MUST be in the same folder as the Exe file
@ -29,6 +29,10 @@ Scanned for viruses before packing...
cassini@burri-web.org
Changelog:
V 2.25 - BETA Build 59
- fix - an issue in parsing options from imported maps
- add - an option to show the actiontree as CSV list with more/less details (change in Settings)
- improvement - In table view add possibility to Blend All visible unmapped entries
V 2.24 - BETA Build 58
- fix - some trouble in SC path finding
V 2.23 - BETA Build 57

Loading…
Cancel
Save