V 2.41 - BETA Build 76

- update for SC Alpha PTU 3.6.0 and launcher 1.2.0 - new PTU path (#86)
- update Log File from game includes also used Pathes - revisit those if the progam does not find them
- NOTE: Gampad may not yet work and other new stuff is not complete so you're on your own here
V 2.40 - BETA Build 75
- update for SC Alpha PTU 3.5.0 defaultProfile now using gamepad instead of xboxpad (#83)
- NOTE: other new stuff is not complete so you're on your own here
This commit is contained in:
bm98 2019-07-11 21:01:35 +02:00
parent 490f241bd9
commit 275bdd281a
20 changed files with 805 additions and 767 deletions

View File

@ -22,8 +22,8 @@ MINIMUM EXPORT:
</devices>
<categories />
</CustomisationUIHeader>
<options type="keyboard" instance="1"/>
<options type="joystick" instance="1"/>
<options type="keyboard" instance="1" Product="Tastatur {6F1D2B61-D5A0-11CF-BFC7-444553540000}"/>
<options type="joystick" instance="1" Product="vJoy Device {BEAD1234-0000-0000-0000-504944564944}">
<options type="joystick" instance="2"/>
<modifiers />
</ActionMaps>

View File

@ -42,6 +42,10 @@ static public bool IsUndefined( string deviceClass )
/// The DX ProductName property
/// </summary>
public abstract string DevName { get; }
/// <summary>
/// The DX ProductGUID property
/// </summary>
public abstract string DevGUID { get; }
/// <summary>
/// The DX instance number of the object (from enum) - 0 based

View File

@ -23,10 +23,12 @@ public class GamepadCls : DeviceCls
#region Static Items
public new const string DeviceClass = "xboxpad"; // the device name used throughout this app
public new const string DeviceClass = "xboxpad"; // the device name used throughout this app (3.5 still in user mapping ??)
public const string DeviceClass_3_5 = "gamepad"; // defaultProfile from Alpha 3.5 onwards
public new const string DeviceID = "xi1_";
static public int RegisteredDevices = 0;
public const string DevNameCIG = "Controller (Gamepad)"; // seems CIG names the Gamepad always like this - and not as the device replies
public const string DevGUIDCIG = "{}"; // @@@ t.b.d.
public const string JsUnknown = "xi_";
public new const string DisabledInput = DeviceID + DeviceCls.DisabledInput;
@ -53,7 +55,7 @@ static public System.Drawing.Color XiColor()
/// <returns></returns>
static public new bool IsDeviceClass( string deviceClass )
{
return ( deviceClass == DeviceClass );
return ( deviceClass == DeviceClass ) || ( deviceClass == DeviceClass_3_5 ); // handle Alpha 3.5+
}
/// <summary>
@ -146,6 +148,7 @@ static public string FromAC1( string input )
private Controller m_device;
private string m_devName = DevNameCIG;
private string m_devGUID = DevGUIDCIG;
private Capabilities m_gpCaps = new Capabilities( );
private State m_state = new State( );
@ -181,6 +184,9 @@ static public string FromAC1( string input )
/// </summary>
public override string DevName { get { return m_devName; } }
/// <summary>
/// The ProductGUID property
/// </summary>
public override string DevGUID { get { return m_devGUID; } }
public void SetDeviceName( string devName )
{

View File

@ -381,6 +381,10 @@ private string HatDir( int value )
/// </summary>
public override string DevName { get { return m_device.Properties.ProductName; } }
/// <summary>
/// The ProductGUID property
/// </summary>
public override string DevGUID { get { return "{" + m_device.Information.ProductGuid.ToString().ToUpperInvariant() + "}"; } }
/// <summary>
/// The JS Instance GUID for multiple device support (VJoy gets 2 of the same name)
/// </summary>
public override string DevInstanceGUID { get { return m_device.Information.InstanceGuid.ToString( ); } }

View File

@ -293,6 +293,11 @@ static public string MakeCtrl( string input, string modifiers )
/// The JS ProductName property
/// </summary>
public override string DevName { get { return m_device.Properties.ProductName; } }
/// <summary>
/// The ProductGUID property
/// </summary>
public override string DevGUID { get { return "{" + m_device.Information.ProductGuid.ToString( ).ToUpperInvariant( ) + "}"; } }
/// <summary>
/// The JS Instance GUID for multiple device support (VJoy gets 2 of the same name)
/// </summary>

View File

@ -158,6 +158,10 @@ static public string MakeCtrl( string input, string modifiers )
/// </summary>
public override string DevName { get { return "Mouse"; } } // no props in directX
/// <summary>
/// The ProductGUID property
/// </summary>
public override string DevGUID { get { return "{}"; } } // @@@ tbd
/// <summary>
/// The JS Instance GUID for multiple device support (VJoy gets 2 of the same name)
/// </summary>
public override string DevInstanceGUID { get { return m_device.Information.InstanceGuid.ToString( ); } }

View File

@ -308,7 +308,7 @@ public string Options_toXML()
string type = m_devClass;
if ( MouseCls.IsDeviceClass( type ) ) type = KeyboardCls.DeviceClass;
tmp += string.Format( "\t<options type=\"{0}\" instance=\"{1}\">\n", type, m_devInstanceNo.ToString( ) );
tmp += $"\t<options type=\"{type}\" instance=\"{m_devInstanceNo.ToString( )}\" Product=\"{m_deviceRef.DevName + " " + m_deviceRef.DevGUID}\">\n";// 3.5 do we need Product here ??
tmp += string.Format( "\t\t<{0} ", m_option );
if ( InvertUsed ) {

View File

@ -139,7 +139,7 @@ public DeviceTuningParameter TuningItem( string optionName )
private string[] FormatXml( string xml )
{
try {
XDocument doc = XDocument.Parse( xml );
var doc = XDocument.Parse( xml );
return doc.ToString( ).Split( new string[] { string.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries );
}
catch ( Exception ) {
@ -193,7 +193,7 @@ public bool fromXML( XElement options )
</options>
*
<options type="joystick" instance="1">
<options type="joystick" instance="2" Product="Saitek Pro Flight X-55 Rhino Stick {22150738-0000-0000-0000-504944564944}">
<flight>
<nonlinearity_curve>
<point in="0.1" out="0.001"/>
@ -213,6 +213,7 @@ public bool fromXML( XElement options )
string instance = (string)options.Attribute( "instance" ); // mandadory
string type = (string)options.Attribute( "type" ); // mandadory
if ( !int.TryParse( instance, out int nInstance ) ) nInstance = 0; // get the one from the map if given (else it's a map error...)
string productS = (string)options.Attribute( "Product" ); // optional 3.5 ??
string devClass = DeviceCls.DeviceClass; // the generic one
if ( !string.IsNullOrEmpty(type)) devClass = type; // get the one from the map if given (else it's a map error...)

View File

@ -1022,7 +1022,7 @@ private void meDumpMappingList_Click( object sender, EventArgs e )
private void meDumpLogfile_Click( object sender, EventArgs e )
{
AutoTabXML_Assignment( EATabXML.Tab_XML );
rtb.Text = string.Format( "-- {0} - SC Joystick AC Log Controller Detection --\n{1}", DateTime.Now, SCLogExtract.ExtractLog( ) );
rtb.Text = string.Format( "-- {0} - SC Joystick AC Path and Logfile --\n\n{1}\n{2}", DateTime.Now, SCPath.Summary(), SCLogExtract.ExtractLog( ) );
}
private void meDumpDefaultProfile_Click( object sender, EventArgs e )

View File

@ -2,7 +2,7 @@ The MIT License (MIT)
For SCJMapper:
Copyright (c) 2018 Martin Burri
Copyright (c) 2019 Martin Burri
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "Cassini (SC handle)" )]
[assembly: AssemblyProduct( "SCJMapper" )]
[assembly: AssemblyCopyright( "Copyright (c) 2018 M.Burri + see LICENSE file" )]
[assembly: AssemblyCopyright( "Copyright (c) 2019 M.Burri + see LICENSE file" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
@ -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.39.0.74" )]
[assembly: AssemblyFileVersion( "2.39.0.74" )]
[assembly: AssemblyVersion( "2.41.0.76" )]
[assembly: AssemblyFileVersion( "2.41.0.76" )]

View File

@ -4,6 +4,9 @@ SCJMapper-V2<br>
SC Joystick Mapper (.Net 4.5.2; using sharpDX/OpenTK wrapper)<br>
this should work with Win7, Win8.x Win 10 out of the box<br>
<br>
On RSI Spectrum see https://robertsspaceindustries.com/spectrum/community/SC/forum/51473/thread/scjmapper-news-and-updates
<br>
<br>
Built using Windows Forms - Issues with display scaling may be encountered - set display scaling to 100%.
<br>
using sharpDX 2.6.3 .net wrapper (http://sharpdx.org/)<br>

View File

@ -1,12 +1,12 @@
SC Joystick Mapper V 2.39 - Build 74 BETA
(c) Cassini, StandardToaster - 04-Aug-2018
SC Joystick Mapper V 2.41 - Build 76 BETA
(c) Cassini, StandardToaster - 11-Jul-2019
Contains 14 files + graphics:
SCJMapper.exe The program (V2.38)
SCJMapper.exe.config Program config (V2.38) - MUST be in the same folder as the Exe file
de\SCJMapper.resources.dll German language (V2.38) - MUST be in the same folder as the Exe file
fr\SCJMapper.resources.dll French language (V2.38) - MUST be in the same folder as the Exe file
SCJMapper.exe The program (V2.41)
SCJMapper.exe.config Program config (V2.41) - MUST be in the same folder as the Exe file
de\SCJMapper.resources.dll German language (V2.41) - MUST be in the same folder as the Exe file
fr\SCJMapper.resources.dll French language (V2.41) - MUST be in the same folder as the Exe file
Storage\*.scj Folder for collected assets (V2.35) - MUST be in the same folder as the Exe file
PTU_Storage\*.scj Folder for collected PTU (V2.37) - 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
@ -24,11 +24,11 @@ ReadMe.txt This file
graphics folder Skybox Images (V2.32) - graphics folder MUST be in the same folder as the Exe file
NOTE V 2.35+:
NOTE V 2.41+:
search order for defaultProfile.xml to build the action tree is:
1. directory where SCJMapper Exe is located
2. directory of <SC>\LIVE\USER
3. extract from <SC>\LIVE\Data.p4k (using stored asset)
2. directory of <SC>\LIVE\USER or <SC>\PTU\USER
3. extract from <SC>\LIVE\Data.p4k <SC>\PTU\Data.p4k (preferred - using stored asset)
4. extract from SCJMapper exe file (derived from 3.2i build 790942)
--> in order to get always the most current one use 3. (and therefore remove the ones in 1. and 2.)
@ -40,10 +40,19 @@ Put all files into one folder and hit SCJMapper.exe to run it
For Updates and information visit:
https://github.com/SCToolsfactory/SCJMapper-V2
Or CIG Spectrum https://robertsspaceindustries.com/spectrum/community/SC/forum/51473/thread/scjmapper-news-and-updates
Scanned for viruses before packing...
cassini@burri-web.org
Changelog:
V 2.41 - BETA Build 76
- update for SC Alpha PTU 3.6.0 and launcher 1.2.0 - new PTU path (#86)
- update Log File from game includes also used Pathes - revisit those if the progam does not find them
- NOTE: Gampad may not yet work and other new stuff is not complete so you're on your own here
V 2.40 - BETA Build 75
- update for SC Alpha PTU 3.5.0 defaultProfile now using gamepad instead of xboxpad (#83)
- NOTE: other new stuff is not complete so you're on your own here
V 2.39 - BETA Build 74
- fix - processing gamefile (PTU 3.2.1i) causes exception
- NOTE: other new stuff is not complete so you're on your own here

View File

@ -232,6 +232,7 @@ private bool ReadAction( XElement action )
KInput( ref kAC, action, (string)action.Attribute( KeyboardCls.DeviceClass ) );
MInput( ref mAC, action, (string)action.Attribute( MouseCls.DeviceClass ) );
XInput( ref xAC, action, (string)action.Attribute( GamepadCls.DeviceClass ) );
XInput( ref xAC, action, (string)action.Attribute( GamepadCls.DeviceClass_3_5 ) );// Handle either or Alpha 3.5+
// then nested ones - they may or may not exist from the initial scan
foreach ( XElement l1action in action.Elements( ) ) {

View File

@ -22,20 +22,31 @@ static private string ExtractValuableInfo( string inLine )
if ( l.StartsWith( "host cpu" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "windows:" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "current display mode" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "gamename" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "buildtime" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "windows:" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "physical memory" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "--- dedicated video memory" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "- final rating" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "vendor " ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "dedicated video memory" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "feature level" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "final rating" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "benchmark" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "performance" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "64 bit" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "keyboard" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "display mode" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "- connected" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "reset controls" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "- connected" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "faceware" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "reset controls" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.Contains( "enjoy" ) ) return string.Format( "\t{0}\n", inLine );
return retVal;
}

View File

@ -19,6 +19,7 @@ class SCPath
/// <summary>
/// Try to locate the launcher from Alpha 3.0.0 public - e.g. E:\G\StarCitizen\RSI Launcher
/// Alpha 3.6.0 PTU launcher 1.2.0 has the same entry (but PTU location changed)
/// </summary>
static private string SCLauncherDir6
{
@ -67,15 +68,16 @@ static private string SCLauncherDir5
/// <summary>
/// Checks if the base path is correct - i.e. the subfolders can be found
/// Changed for Patcher 1.2.0 again
/// </summary>
/// <param name="basePath"></param>
/// <returns></returns>
/// <returns>An empty string if OK - else the issue found</returns>
static public string CheckSCBasePath( string basePath )
{
string issue = "";
if ( string.IsNullOrEmpty( basePath ) ) {
issue = Tx.Translate("scpEmptyString" ); // string.Format( "There is no vaild path given (empty string)" );
issue = Tx.Translate( "scpEmptyString" ); // string.Format( "There is no vaild path given (empty string)" );
return issue; // no valid one can be found
}
@ -84,25 +86,33 @@ static public string CheckSCBasePath( string basePath )
return issue; // no valid one can be found
}
// 20180321 New PTU 3.1 another change in setup path - Testing for PTU first
if ( Directory.Exists( Path.Combine( basePath, "StarCitizenPTU" ) ) ) {
basePath = Path.Combine( basePath, "StarCitizenPTU" );
}
else {
// then try the retail path (was valid so far..)
basePath = Path.Combine( basePath, "StarCitizen" );
}
// 20190711 Lanuncher 1.2 - PTU has moved - change detection to find this one first.
basePath = Path.Combine( basePath, "StarCitizen" );
string scpX = "";
// SC 3.0 try LIVE
scpX = Path.Combine( basePath, "LIVE" );
if ( !Directory.Exists( scpX ) ) {
issue = string.Format( Tx.Translate( "scpClientDirNotFound" ).Replace("\\n","\n") , scpX );
scpX = Path.Combine( basePath, "PTU" );
if ( Directory.Exists( scpX ) ) {
return ""; // OK at least PTU folder exists - seems legit
}
else {
// may be there is only LIVE ?
scpX = Path.Combine( basePath, "LIVE" );
if ( Directory.Exists( scpX ) ) {
return ""; // OK LIVE folder exists - seems legit
}
// for now it failed
issue = string.Format( Tx.Translate( "scpClientDirNotFound" ).Replace( "\\n", "\n" ), scpX );
//"Cannot find the SC Client Directory !!\n\nTried to look for:\n{0} \n\nPlease adjust the path in Settings\n"
return issue;
}
return issue;
// last resort is old style PTU only
// This would be pre 1.2 laucher and PTU only
basePath += "PTU"; // makes it "StarCitizenPTU"
if ( Directory.Exists( basePath ) ) {
return ""; // OK at least old PTU folder exists - seems legit
}
return issue; // OK exit
}
/// <summary>
@ -167,11 +177,11 @@ static private string SCBasePath
// nothing found
log.Warn( "SCBasePath - cannot find any valid SC path" );
// Issue a warning here to let the user know
string issue = Tx.Translate( "scpAutoPathFailed" ).Replace( "\\n", "\n" );
string issue = Tx.Translate( "scpAutoPathFailed" ).Replace( "\\n", "\n" );
//string.Format( "Cannot find the SC Installation Path !!\nUse Settings to provide the path manually" );
if ( !m_hasInformed )
System.Windows.Forms.MessageBox.Show( issue, Tx.Translate( "setMsgBox"),
System.Windows.Forms.MessageBox.Show( issue, Tx.Translate( "setMsgBox" ),
System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation );
m_hasInformed = true;
}
@ -212,28 +222,29 @@ static public string SCClientPath
string issue = "";
if ( string.IsNullOrEmpty( scp ) ) return ""; // no valid one can be found
// 20180321 New PTU 3.1 another change in setup path - Testing for PTU first
if (AppSettings.Instance.UsePTU && Directory.Exists( Path.Combine( scp, "StarCitizenPTU" ) ) ) {
scp = Path.Combine( scp, "StarCitizenPTU" );
// 20190711 Lanuncher 1.2 - PTU has moved - change detection to find this one first.
if ( AppSettings.Instance.UsePTU ) {
if ( Directory.Exists( Path.Combine( scp, @"StarCitizen\PTU" )) ) {
scp = Path.Combine( scp, @"StarCitizen\PTU" );
}
else if ( Directory.Exists( Path.Combine( scp, @"StarCitizenPTU\LIVE" ) ) ) {
// this would be old style
scp = Path.Combine( scp, @"StarCitizenPTU\LIVE" );
}
}
else {
// then try the retail path (was valid so far..)
scp = Path.Combine( scp, "StarCitizen" );
// no PTU ..
scp = Path.Combine( scp, @"StarCitizen\LIVE" );
}
if ( Directory.Exists( scp ) ) return scp; // EXIT Success
string scpX = "";
// SC 3.0 try LIVE
scpX = Path.Combine( scp, "LIVE" );
if ( Directory.Exists( scpX ) ) return scpX;
log.WarnFormat( "SCClientPath - StarCitizen\\LIVE or PTU subfolder does not exist: {0}", scp );
// Issue a warning here to let the user know
issue = string.Format( Tx.Translate( "scpClientDirNotFound" ).Replace( "\\n", "\n" ), scpX );
issue = string.Format( Tx.Translate( "scpClientDirNotFound" ).Replace( "\\n", "\n" ), scp );
//"Cannot find the SC Client Directory !!\n\nTried to look for:\n{0} \n\nPlease adjust the path in Settings\n"
log.WarnFormat( "SCClientPath - StarCitizen\\Live subfolder does not exist: {0}", scp );
// Issue a warning here to let the user know
if ( !m_hasInformed ) System.Windows.Forms.MessageBox.Show( issue, Tx.Translate( "setMsgBox" ), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation );
m_hasInformed = true;
@ -425,6 +436,25 @@ static public string DefaultProfileName
}
}
/// <summary>
/// Returns a summary of the detected pathes
/// </summary>
/// <returns>A formatted string</returns>
static public string Summary()
{
string ret = $"SC Path:\n";
ret += $" InstallPath:\t{SCInstallPath}\n";
ret += $" BasePath:\t\t{SCBasePath}\n";
ret += $" Client:\t\t{SCClientPath}\n";
ret += $" ClientData:\t\t{SCClientDataPath}\n";
ret += $" ClientUSER:\t\t{SCClientUSERPath}\n";
ret += $" ClientMapping:\t{SCClientMappingPath}\n";
return ret;
}
}
}

View File

@ -27,8 +27,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>74</ApplicationRevision>
<ApplicationVersion>2.39.0.%2a</ApplicationVersion>
<ApplicationRevision>76</ApplicationRevision>
<ApplicationVersion>2.41.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>

View File

@ -190,7 +190,7 @@ private void ComposeFilter()
else {
deviceFilter = "( Device='X'"
+ ( ( cbxShowJoystick.Checked ) ? string.Format( " OR Device = 'joystick'" ) : "" )
+ ( ( cbxShowGamepad.Checked ) ? string.Format( " OR Device = 'xboxpad'" ) : "" )
+ ( ( cbxShowGamepad.Checked ) ? string.Format( " OR Device = 'xboxpad' OR Device = 'gamepad'" ) : "" ) // Alpha 3.5+
+ ( ( cbxShowMouse.Checked ) ? string.Format( " OR Device = 'mouse'" ) : "" )
+ ( ( cbxShowKeyboard.Checked ) ? string.Format( " OR Device = 'keyboard'" ) : "" )
+ " )";

File diff suppressed because it is too large Load Diff

Binary file not shown.