V 2.34 - BETA Build 68

- internal cleanup - consistent type naming, others
pull/104/head
bm98 7 years ago
parent d2d1aa1664
commit 8a7819cca8

@ -44,7 +44,7 @@ namespace SCJMapper_V2
/// <summary>
/// Show the Settings Dialog
/// </summary>
public DialogResult ShowSettings( String pasteString )
public DialogResult ShowSettings( string pasteString )
{
if ( FS == null ) FS = new FormSettings( this );
FS.PasteString = pasteString; // propagate joyinput
@ -58,9 +58,9 @@ namespace SCJMapper_V2
// manages Upgrade
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean FirstRun
public bool FirstRun
{
get { return ( Boolean )this["FirstRun"]; }
get { return ( bool )this["FirstRun"]; }
set { this["FirstRun"] = value; }
}
@ -85,57 +85,57 @@ namespace SCJMapper_V2
// User Config Settings
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "layout_joystick_spacesim" )] // from Game Bundle
public String DefMappingName
public string DefMappingName
{
get { return ( String )this["DefMappingName"]; }
get { return ( string )this["DefMappingName"]; }
set { this["DefMappingName"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "layout_my_joystick" )] // just a default
public String MyMappingName
public string MyMappingName
{
get { return ( String )this["MyMappingName"]; }
get { return ( string )this["MyMappingName"]; }
set { this["MyMappingName"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowJoystick
public bool ShowJoystick
{
get { return ( Boolean )this["ShowJoystick"]; }
get { return ( bool )this["ShowJoystick"]; }
set { this["ShowJoystick"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowGamepad
public bool ShowGamepad
{
get { return ( Boolean )this["ShowGamepad"]; }
get { return ( bool )this["ShowGamepad"]; }
set { this["ShowGamepad"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowKeyboard
public bool ShowKeyboard
{
get { return ( Boolean )this["ShowKeyboard"]; }
get { return ( bool )this["ShowKeyboard"]; }
set { this["ShowKeyboard"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowMouse // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage)
public bool ShowMouse // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage)
{
get { return ( Boolean )this["ShowMouse"]; }
get { return ( bool )this["ShowMouse"]; }
set { this["ShowMouse"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean ShowMapped
public bool ShowMapped
{
get { return ( Boolean )this["ShowMapped"]; }
get { return ( bool )this["ShowMapped"]; }
set { this["ShowMapped"] = value; }
}
@ -144,162 +144,162 @@ namespace SCJMapper_V2
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS1
public string IgnoreJS1
{
get { return ( String )this["IgnoreJS1"]; }
get { return ( string )this["IgnoreJS1"]; }
set { this["IgnoreJS1"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS2
public string IgnoreJS2
{
get { return ( String )this["IgnoreJS2"]; }
get { return ( string )this["IgnoreJS2"]; }
set { this["IgnoreJS2"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS3
public string IgnoreJS3
{
get { return ( String )this["IgnoreJS3"]; }
get { return ( string )this["IgnoreJS3"]; }
set { this["IgnoreJS3"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS4
public string IgnoreJS4
{
get { return ( String )this["IgnoreJS4"]; }
get { return ( string )this["IgnoreJS4"]; }
set { this["IgnoreJS4"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS5
public string IgnoreJS5
{
get { return ( String )this["IgnoreJS5"]; }
get { return ( string )this["IgnoreJS5"]; }
set { this["IgnoreJS5"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS6
public string IgnoreJS6
{
get { return ( String )this["IgnoreJS6"]; }
get { return ( string )this["IgnoreJS6"]; }
set { this["IgnoreJS6"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS7
public string IgnoreJS7
{
get { return ( String )this["IgnoreJS7"]; }
get { return ( string )this["IgnoreJS7"]; }
set { this["IgnoreJS7"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS8
public string IgnoreJS8
{
get { return ( String )this["IgnoreJS8"]; }
get { return ( string )this["IgnoreJS8"]; }
set { this["IgnoreJS8"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS9
public string IgnoreJS9
{
get { return ( String )this["IgnoreJS9"]; }
get { return ( string )this["IgnoreJS9"]; }
set { this["IgnoreJS9"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS10
public string IgnoreJS10
{
get { return ( String )this["IgnoreJS10"]; }
get { return ( string )this["IgnoreJS10"]; }
set { this["IgnoreJS10"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS11
public string IgnoreJS11
{
get { return ( String )this["IgnoreJS11"]; }
get { return ( string )this["IgnoreJS11"]; }
set { this["IgnoreJS11"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String IgnoreJS12
public string IgnoreJS12
{
get { return ( String )this["IgnoreJS12"]; }
get { return ( string )this["IgnoreJS12"]; }
set { this["IgnoreJS12"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )]
public String UserSCPath
public string UserSCPath
{
get { return ( String )this["UserSCPath"]; }
get { return ( string )this["UserSCPath"]; }
set { this["UserSCPath"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean UserSCPathUsed
public bool UserSCPathUsed
{
get { return ( Boolean )this["UserSCPathUsed"]; }
get { return ( bool )this["UserSCPathUsed"]; }
set { this["UserSCPathUsed"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( ",default,multiplayer,singleplayer,player,flycam,vehicle_driver," )] // empty Note: comma separated list, must have a comma at the begining and the end (to find 'player' on its own...)
public String IgnoreActionmaps
public string IgnoreActionmaps
{
get { return ( String )this["IgnoreActionmaps"]; }
get { return ( string )this["IgnoreActionmaps"]; }
set { this["IgnoreActionmaps"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean DetectGamepad
public bool DetectGamepad
{
get { return ( Boolean )this["DetectGamepad"]; }
get { return ( bool )this["DetectGamepad"]; }
set { this["DetectGamepad"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean UsePTU
public bool UsePTU
{
get { return false; } // ( Boolean )this["UsePTU"]; } no longer used
get { return false; } // ( bool )this["UsePTU"]; } no longer used
set { this["UsePTU"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean UseCSVListing
public bool UseCSVListing
{
get { return ( Boolean )this["UseCSVListing"]; }
get { return ( bool )this["UseCSVListing"]; }
set { this["UseCSVListing"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean ListModifiers
public bool ListModifiers
{
get { return ( Boolean )this["ListModifiers"]; }
get { return ( bool )this["ListModifiers"]; }
set { this["ListModifiers"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean AutoTabXML
public bool AutoTabXML
{
get { return (Boolean)this["AutoTabXML"]; }
get { return (bool)this["AutoTabXML"]; }
set { this["AutoTabXML"] = value; }
}

@ -20,108 +20,108 @@ namespace SCJMapper_V2.Devices.Gamepad
/// <summary>
/// Return s only if length is max 12 (some crazy names may kill the layout...)
/// </summary>
/// <param name="s">String to return if length less than 12</param>
/// <param name="d">String to return if s length more than 12</param>
/// <param name="s">string to return if length less than 12</param>
/// <param name="d">string to return if s length more than 12</param>
/// <returns>A string</returns>
private String Chk( String s, String d )
private string Chk( string s, string d )
{
if ( s.Length > 12 ) return d; else return s;
}
public String Caption
public string Caption
{
set { gBoxCap.Text = value; }
}
public String DPad
public string DPad
{
set { iDPad.Text = value; }
}
public String TStickXL
public string TStickXL
{
set { iTStickXL.Text = value; }
}
public String TStickYL
public string TStickYL
{
set { iTStickYL.Text = value; }
}
public String TStickBtL
public string TStickBtL
{
set { iTStickBtL.Text = value; }
}
public String TStickXR
public string TStickXR
{
set { iTStickXR.Text = value; }
}
public String TStickYR
public string TStickYR
{
set { iTStickYR.Text = value; }
}
public String TStickBtR
public string TStickBtR
{
set { iTStickBtR.Text = value; }
}
public String TriggerL
public string TriggerL
{
set { iTrigL.Text = value; }
}
public String TriggerR
public string TriggerR
{
set { iTrigR.Text = value; }
}
public String ShoulderL
public string ShoulderL
{
set { iShL.Text = value; }
}
public String ShoulderR
public string ShoulderR
{
set { iShR.Text = value; }
}
public String Start
public string Start
{
set { iBtStart.Text = value; }
}
public String Back
public string Back
{
set { iBtBack.Text = value; }
}
public String Button
public string Button
{
set { lbl1Buttons.Text = value; }
}
// Caps
public String nButtons
public string nButtons
{
set { lblnButtons.Text = value; }
}
public String nDPads
public string nDPads
{
set { lblnDPad.Text = value; }
}
public String nTSticks
public string nTSticks
{
set { lblnTSticks.Text = value; }
}
public String nTriggers
public string nTriggers
{
set { lblnTriggers.Text = value; }
}
@ -132,52 +132,52 @@ namespace SCJMapper_V2.Devices.Gamepad
#region Enables
public Boolean DPadE
public bool DPadE
{
set { iDPad.Enabled = value; lDPad.Enabled = value; }
}
public Boolean TStickLE
public bool TStickLE
{
set { iTStickXL.Enabled = value; iTStickYL.Enabled = value; iTStickBtL.Enabled = true; lTStickL.Enabled = value; }
}
public Boolean TStickRE
public bool TStickRE
{
set { iTStickXR.Enabled = value; iTStickYR.Enabled = value; iTStickBtR.Enabled = true; lTStickR.Enabled = value; }
}
public Boolean TriggerLE
public bool TriggerLE
{
set { iTrigL.Enabled = value; lTrigL.Enabled = value; }
}
public Boolean TriggerRE
public bool TriggerRE
{
set { iTrigR.Enabled = value; lTrigR.Enabled = value; }
}
public Boolean ShoulderLE
public bool ShoulderLE
{
set { iShL.Enabled = value; lH0.Enabled = value; }
}
public Boolean ShoulderRE
public bool ShoulderRE
{
set { iShR.Enabled = value; lH1.Enabled = value; }
}
public Boolean StartE
public bool StartE
{
set { iBtStart.Enabled = value; lH2.Enabled = value; }
}
public Boolean BackE
public bool BackE
{
set { iBtBack.Enabled = value; lH3.Enabled = value; }
}
public Boolean ButtonE
public bool ButtonE
{
set { lbl1Buttons.Enabled = value; lB.Enabled = value; }
}

@ -169,7 +169,7 @@ namespace SCJMapper_V2.Devices.Joystick
/// </summary>
/// <param name="n">The device name</param>
/// <returns>The instance or null if not found</returns>
public JoystickCls Find_jsDev( String devName )
public JoystickCls Find_jsDev( string devName )
{
foreach ( JoystickCls j in this ) {
if ( j.DevName == devName ) return j;
@ -183,7 +183,7 @@ namespace SCJMapper_V2.Devices.Joystick
/// </summary>
/// <param name="n">The instance GUID</param>
/// <returns>The instance or null if not found</returns>
public JoystickCls Find_jsInstance( String instGUID )
public JoystickCls Find_jsInstance( string instGUID )
{
foreach ( JoystickCls j in this ) {
if ( j.DevInstanceGUID == instGUID ) return j;

@ -17,7 +17,7 @@ namespace SCJMapper_V2.Devices.Joystick
/// Returns a properly formatted Modifier entry
/// </summary>
/// <returns></returns>
public String toXML()
public string toXML()
{
string r = "";
r += string.Format( "\t<modifiers>\n" );
@ -35,14 +35,14 @@ namespace SCJMapper_V2.Devices.Joystick
/// </summary>
/// <param name="xml">the XML action fragment</param>
/// <returns>True if an action was decoded</returns>
private Boolean Instance_fromXML( XmlReader reader )
private bool Instance_fromXML( XmlReader reader )
{
reader.Read( );
while ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant() == "mod" ) {
String input = reader["input"];
if ( !String.IsNullOrWhiteSpace( input ) ) {
string input = reader["input"];
if ( !string.IsNullOrWhiteSpace( input ) ) {
this.Add( input );
}
}
@ -57,7 +57,7 @@ namespace SCJMapper_V2.Devices.Joystick
/// <summary>
/// Reads the Modifier entry from an action map file
/// </summary>
public Boolean fromXML( String xml )
public bool fromXML( string xml )
{
/*
<!-- Key modifiers -->

@ -24,157 +24,157 @@ namespace SCJMapper_V2.Devices.Joystick
/// <summary>
/// Return s only if length is max 12 (some crazy names may kill the layout...)
/// </summary>
/// <param name="s">String to return if length less than 12</param>
/// <param name="d">String to return if s length more than 12</param>
/// <param name="s">string to return if length less than 12</param>
/// <param name="d">string to return if s length more than 12</param>
/// <returns>A string</returns>
private String Chk( String s, String d )
private string Chk( string s, string d )
{
if ( s.Length > 12 ) return s.Substring(0,12) ; else return s;
}
public String Caption
public string Caption
{
set { gBoxCap.Text = value; }
}
public String X
public string X
{
set { lbl1X.Text = value; }
}
public String Xname
public string Xname
{
set { lX.Text = Chk( value, lX.Text ); }
}
public String Y
public string Y
{
set { lbl1Y.Text = value; }
}
public String Yname
public string Yname
{
set { lY.Text = Chk( value, lY.Text ); }
}
public String Z
public string Z
{
set { lbl1Z.Text = value; }
}
public String Zname
public string Zname
{
set { lZ.Text = Chk( value, lZ.Text ); }
}
public String Xr
public string Xr
{
set { lbl1Xr.Text = value; }
}
public String Xrname
public string Xrname
{
set { lXr.Text = Chk( value, lXr.Text ); }
}
public String Yr
public string Yr
{
set { lbl1Yr.Text = value; }
}
public String Yrname
public string Yrname
{
set { lYr.Text = Chk( value, lYr.Text ); }
}
public String Zr
public string Zr
{
set { lbl1Zr.Text = value; }
}
public String Zrname
public string Zrname
{
set { lZr.Text = Chk( value, lZr.Text ); }
}
public String S1
public string S1
{
set { lbl1S0.Text = value; }
}
public String S1name
public string S1name
{
set { lS0.Text = Chk( value, lS0.Text ); }
}
public String S2
public string S2
{
set { lbl1S1.Text = value; }
}
public String S2name
public string S2name
{
set { lS1.Text = Chk( value, lS1.Text ); }
}
public String H1
public string H1
{
set { lbl1Hat0.Text = value; }
}
public String H1name
public string H1name
{
set { lH0.Text = Chk( value, lH0.Text ); }
}
public String H2
public string H2
{
set { lbl1Hat1.Text = value; }
}
public String H2name
public string H2name
{
set { lH1.Text = Chk( value, lH1.Text ); }
}
public String H3
public string H3
{
set { lbl1Hat2.Text = value; }
}
public String H3name
public string H3name
{
set { lH2.Text = Chk( value, lH2.Text ); }
}
public String H4
public string H4
{
set { lbl1Hat3.Text = value; }
}
public String H4name
public string H4name
{
set { lH3.Text = Chk( value, lH3.Text ); }
}
public String Button
public string Button
{
set { lbl1Buttons.Text = value; }
}
public String nButtons
public string nButtons
{
set { lblnButtons.Text = value; }
}
public String nAxis
public string nAxis
{
set { lblnAxis.Text = value; }
}
public String nPOVs
public string nPOVs
{
set { lblnPOVs.Text = value; }
}
@ -185,67 +185,67 @@ namespace SCJMapper_V2.Devices.Joystick
#region Enables
public Boolean Xe
public bool Xe
{
set { lbl1X.Enabled = value; lX.Enabled = value; }
}
public Boolean Ye
public bool Ye
{
set { lbl1Y.Enabled = value; lY.Enabled = value; }
}
public Boolean Ze
public bool Ze
{
set { lbl1Z.Enabled = value; lZ.Enabled = value; }
}
public Boolean Xre
public bool Xre
{
set { lbl1Xr.Enabled = value; lXr.Enabled = value; }
}
public Boolean Yre
public bool Yre
{
set { lbl1Yr.Enabled = value; lYr.Enabled = value; }
}
public Boolean Zre
public bool Zre
{
set { lbl1Zr.Enabled = value; lZr.Enabled = value; }
}
public Boolean S1e
public bool S1e
{
set { lbl1S0.Enabled = value; lS0.Enabled = value; }
}
public Boolean S2e
public bool S2e
{
set { lbl1S1.Enabled = value; lS1.Enabled = value; }
}
public Boolean H1e
public bool H1e
{
set { lbl1Hat0.Enabled = value; lH0.Enabled = value; }
}
public Boolean H2e
public bool H2e
{
set { lbl1Hat1.Enabled = value; lH1.Enabled = value; }
}
public Boolean H3e
public bool H3e
{
set { lbl1Hat2.Enabled = value; lH2.Enabled = value; }
}
public Boolean H4e
public bool H4e
{
set { lbl1Hat3.Enabled = value; lH3.Enabled = value; }
}
public Boolean Buttone
public bool Buttone
{
set { lbl1Buttons.Enabled = value; lB.Enabled = value; }
}
@ -266,7 +266,7 @@ namespace SCJMapper_V2.Devices.Joystick
{
m_jsAssignment = value;
if ( ( m_jsAssignment >= 1 ) && ( m_jsAssignment <= JoystickCls.JSnum_MAX ) ) {
lblJsAssignment.Text = String.Format( "js{0}", m_jsAssignment );
lblJsAssignment.Text = string.Format( "js{0}", m_jsAssignment );
}
else {
lblJsAssignment.Text = "not assigned";
@ -274,7 +274,7 @@ namespace SCJMapper_V2.Devices.Joystick
}
}
public String JsName
public string JsName
{
get { return JoystickCls.JSTag(m_jsAssignment) + "_"; }
}

@ -334,7 +334,7 @@ namespace SCJMapper_V2.Devices.Options
/// <param name="reader">A prepared XML reader</param>
/// <param name="instance">the Joystick instance number</param>
/// <returns></returns>
public Boolean Options_fromXML( XElement option, string type, int instance )
public bool Options_fromXML( XElement option, string type, int instance )
{
/*
<flight_move_pitch exponent="1.00" >

@ -28,9 +28,9 @@ namespace SCJMapper_V2.Devices.Options
public struct MappedActionRec
{
public MappedActionRec( String m, String a ) { Map = m; Action = a; }
public String Map;
public String Action;
public MappedActionRec( string m, string a ) { Map = m; Action = a; }
public string Map;
public string Action;
}
// setup of mapped actions as of AC 1.0 (may need a change once in a while...)
@ -48,10 +48,10 @@ namespace SCJMapper_V2.Devices.Options
private CheckBox m_cbInvert = null;
private DeviceCls m_device = null;
private String m_type = ""; // joystick OR xboxpad
private string m_type = ""; // joystick OR xboxpad
private int m_devInstanceNo = -1; // jsN - instance in XML
String m_option = ""; // the option name (level where it applies)
string m_option = ""; // the option name (level where it applies)
// ctor
public OptionsInvert( Inversions item )
@ -112,21 +112,21 @@ namespace SCJMapper_V2.Devices.Options
/// Format an XML -options- node from the tuning contents
/// </summary>
/// <returns>The XML string or an empty string</returns>
public String Options_toXML( )
public string Options_toXML( )
{
if ( InvertUsed == false ) return ""; // not used
if ( DevInstanceNo <= 0 ) return ""; // not assigned or not valid...
String tmp = "";
tmp += String.Format( "\t<options type=\"{0}\" instance=\"{1}\">\n", m_type, m_devInstanceNo.ToString( ) );
tmp += String.Format( "\t\t<{0} ", m_option );
string tmp = "";
tmp += string.Format( "\t<options type=\"{0}\" instance=\"{1}\">\n", m_type, m_devInstanceNo.ToString( ) );
tmp += string.Format( "\t\t<{0} ", m_option );
if ( InvertUsed ) { // leave this IF in - to allow to extend the code for sensitivity
tmp += String.Format( "invert=\"1\" " );
tmp += string.Format( "invert=\"1\" " );
}
tmp += String.Format( "/> \n" );// CIG get to default expo 2.something if not set to 1 here
tmp += string.Format( "/> \n" );// CIG get to default expo 2.something if not set to 1 here
tmp += String.Format( "\t</options>\n \n" );
tmp += string.Format( "\t</options>\n \n" );
return tmp;
}
@ -138,17 +138,17 @@ namespace SCJMapper_V2.Devices.Options
/// <param name="reader">A prepared XML reader</param>
/// <param name="instance">the Joystick instance number</param>
/// <returns></returns>
public Boolean Options_fromXML( XmlReader reader, String type, int instance )
public bool Options_fromXML( XmlReader reader, string type, int instance )
{
m_type = type;
String invert = "";
string invert = "";
m_option = reader.Name;
m_devInstanceNo = instance;
if ( reader.HasAttributes ) {
invert = reader["invert"];
if ( !String.IsNullOrWhiteSpace( invert ) ) {
if ( !string.IsNullOrWhiteSpace( invert ) ) {
InvertUsed = false;
if ( invert == "1" ) InvertUsed = true;
}

@ -1521,8 +1521,8 @@ namespace SCJMapper_V2
; // nothing here -
}
else {
m_mouseIn = false; // clear on kbd input - 20171226 must prepend text change
lblLastJ.Text = DeviceInst.KeyboardRef.GetLastChange( true );
m_mouseIn = false; // clear on kbd input
}
// also maintain persistent mods
UpdateModifiers( );
@ -1591,8 +1591,7 @@ namespace SCJMapper_V2
string item = "";
string device = MouseCls.DeviceClass;
int btNum = 0;
if ( int.TryParse( (string)ts.Tag, out btNum ) ) {
if ( int.TryParse( (string)ts.Tag, out int btNum ) ) {
// got a button (most likely..)
item = "mouse" + btNum.ToString( );
}
@ -1625,6 +1624,7 @@ namespace SCJMapper_V2
else if ( KeyboardCls.IsDeviceClass( device ) ) {
UpdateModifiers( );
ctrl = KeyboardCls.MakeCtrl( item, m_persistentMods ); // show last handled JS control
m_mouseIn = false;
}
lblLastJ.Text = ctrl;

@ -16,9 +16,9 @@ namespace SCJMapper_V2
private readonly AppSettings m_owner = null; // owner class - access to settings
public Boolean Canceled { get; set; }
public bool Canceled { get; set; }
public String PasteString { get; set; } // used to copy, paste JS commands
public string PasteString { get; set; } // used to copy, paste JS commands
/// <summary>
/// ctor - gets the owning class instance
@ -110,7 +110,7 @@ namespace SCJMapper_V2
m_owner.IgnoreJS12 = txJS12.Text;
// Ignore actionmaps
String ignore = ",";
string ignore = ",";
for ( int i = 0; i < chkLbActionMaps.Items.Count; i++ ) {
if ( chkLbActionMaps.GetItemCheckState( i ) == CheckState.Checked ) {
ignore += chkLbActionMaps.Items[i].ToString( ) + ",";

@ -42,6 +42,7 @@ cassini@burri-web.org
Changelog:
V 2.34 - BETA Build 68
- improvement - complete rework of XML defaultProfile/mapping parsing
- internal cleanup - consistent type naming, others
V 2.33 - BETA Build 67
- update for SC 3.0.0 Alpha public
- fix - finding SC game folder - may work automatically for 3.0 Alpha else define it in Settings

@ -62,14 +62,14 @@ namespace SCJMapper_V2.CryXMLlib
{
/// <summary>
/// Converts a number of ASCII chars into a String
/// Converts a number of ASCII chars into a string
/// </summary>
/// <param name="bPtr">Mem Location of the ASCII Chars</param>
/// <param name="size">Max number of ASCII chars to convert, stops at \0 however</param>
/// <returns>The converted string</returns>
static public string ToString( byte[] byteArr, uint size = 999 )
{
String s = "";
string s = "";
for ( uint i = 0; i < size; i++ ) {
if ( byteArr[i] != 0 )
s += Char.ConvertFromUtf32( byteArr[i] );

@ -28,8 +28,8 @@ namespace SCJMapper_V2.CryXMLlib
Error,
}
private String m_errorDescription = "";
private void SetErrorDescription( String text )
private string m_errorDescription = "";
private void SetErrorDescription( string text )
{
m_errorDescription = text;
}
@ -38,7 +38,7 @@ namespace SCJMapper_V2.CryXMLlib
/// Get error information if something goes wrong
/// </summary>
/// <returns>The error description</returns>
public String GetErrorDescription( ) { return m_errorDescription; }
public string GetErrorDescription( ) { return m_errorDescription; }
/// <summary>
/// Load a Cry Binary XML file into memory and return the NodeRef for the root element
@ -46,7 +46,7 @@ namespace SCJMapper_V2.CryXMLlib
/// <param name="filename">The file to read</param>
/// <param name="result">Read result</param>
/// <returns>The NodeRef of the root element or NULL</returns>
public CryXmlNodeRef LoadFromFile( String filename, out EResult result )
public CryXmlNodeRef LoadFromFile( string filename, out EResult result )
{
m_errorDescription = "";
result = EResult.Error;

@ -10,43 +10,43 @@ namespace SCJMapper_V2.SC
{
static private String ExtractValuableInfo( String inLine )
static private string ExtractValuableInfo( string inLine )
{
String retVal = "";
string retVal = "";
string l = inLine.ToLowerInvariant( );
// detect what we would like to find..
if ( l.StartsWith( "log started" ) ) return String.Format("\t{0}\n", inLine);
if ( l.StartsWith( "executable:" ) ) return String.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "productversion" ) ) return String.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "host cpu" ) ) return String.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "log started" ) ) return string.Format("\t{0}\n", inLine);
if ( l.StartsWith( "executable:" ) ) return string.Format( "\t{0}\n", inLine );
if ( l.StartsWith( "productversion" ) ) return string.Format( "\t{0}\n", 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.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( "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( "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( "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( "enjoy" ) ) 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( "enjoy" ) ) return string.Format( "\t{0}\n", inLine );
return retVal;
}
static public String ExtractLog( )
static public string ExtractLog( )
{
String content = String.Format( "\n\n" );
string content = string.Format( "\n\n" );
String fname = SCPath.SCLastLog;
if ( String.IsNullOrEmpty( fname ) ) {
return String.Format( "\nCould not find a logfile\n" );
string fname = SCPath.SCLastLog;
if ( string.IsNullOrEmpty( fname ) ) {
return string.Format( "\nCould not find a logfile\n" );
}
// first choice a defaultProfile.xml in the app dir distributed with the application ??? to be deleted ???
if ( File.Exists( fname ) ) {
@ -56,7 +56,7 @@ namespace SCJMapper_V2.SC
}
}
}
return content += String.Format( "\n\n" ); ; ;
return content += string.Format( "\n\n" ); ; ;
}

@ -14,10 +14,10 @@ namespace SCJMapper_V2.SC
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
public const String c_MapStartsWith = "layout_"; // we only allow those mapping names
private const String c_UserMapStartsWith = c_MapStartsWith + "my_"; // we only allow those mapping names
public const string c_MapStartsWith = "layout_"; // we only allow those mapping names
private const string c_UserMapStartsWith = c_MapStartsWith + "my_"; // we only allow those mapping names
static private List<String> m_scMappings = new List<string>( );
static private List<string> m_scMappings = new List<string>( );
/// <summary>
@ -25,9 +25,9 @@ namespace SCJMapper_V2.SC
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>True if the file exists</returns>
static public Boolean MappingFileExists( String mapName )
static public bool MappingFileExists( string mapName )
{
Boolean retVal = false;
bool retVal = false;
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
retVal = File.Exists( Path.Combine( SCPath.SCClientMappingPath, mapName + ".xml" ) );
}
@ -39,7 +39,7 @@ namespace SCJMapper_V2.SC
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>A fully qualified filename</returns>
static public String MappingFileName( String mapName )
static public string MappingFileName( string mapName )
{
return Path.Combine( SCPath.SCClientMappingPath, mapName + ".xml" );
}
@ -50,7 +50,7 @@ namespace SCJMapper_V2.SC
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>True if it is a user mapping name</returns>
static public Boolean IsUserMapping( String mapName )
static public bool IsUserMapping( string mapName )
{
return mapName.StartsWith( c_UserMapStartsWith );
}
@ -60,9 +60,9 @@ namespace SCJMapper_V2.SC
/// </summary>
/// <param name="mapName">A map name</param>
/// <returns>True if valid</returns>
static public Boolean IsValidMappingName( String mapName )
static public bool IsValidMappingName( string mapName )
{
Boolean retVal = true; // for now
bool retVal = true; // for now
retVal &= mapName.StartsWith( c_UserMapStartsWith );
retVal &= ( mapName.IndexOfAny( new char[] { ' ', '\t', '\n', '\r', '\0' } ) < 0 ); // make sure we don't have spaces etc.
return retVal;
@ -73,7 +73,7 @@ namespace SCJMapper_V2.SC
{
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
m_scMappings.Clear( );
m_scMappings = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( );
m_scMappings = ( List<string> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( );
}
else {
log.Warn( "UpdateMappingNames - cannot find SC Mapping directory" );
@ -85,7 +85,7 @@ namespace SCJMapper_V2.SC
/// Returns a list of files found
/// </summary>
/// <returns>A list of filenames - can be empty</returns>
static public List<String> MappingNames
static public List<string> MappingNames
{
get
{
@ -102,10 +102,10 @@ namespace SCJMapper_V2.SC
/// </summary>
/// <param name="defaultProfileName">The filename of the profile to be extracted</param>
/// <returns>A string containing the file contents</returns>
static public String Mapping( String mappingName )
static public string Mapping( string mappingName )
{
String retVal = "";
String mFile = Path.Combine( SCPath.SCClientMappingPath, ( mappingName + ".xml" ) );
string retVal = "";
string mFile = Path.Combine( SCPath.SCClientMappingPath, ( mappingName + ".xml" ) );
if ( File.Exists( mFile ) ) {
using ( StreamReader sr = new StreamReader( mFile ) ) {
retVal = sr.ReadToEnd( );

@ -20,11 +20,11 @@ namespace SCJMapper_V2.SC
/// <summary>
/// Try to locate the launcher from Alpha 3.0.0 public - e.g. E:\G\StarCitizen\RSI Launcher
/// </summary>
static private String SCLauncherDir6
static private string SCLauncherDir6
{
get {
log.Debug( "SCLauncherDir6 - Entry" );
String scLauncher = (String)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\81bfc699-f883-50c7-b674-2483b6baae23", "InstallLocation", null );
string scLauncher = (string)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\81bfc699-f883-50c7-b674-2483b6baae23", "InstallLocation", null );
if ( scLauncher != null ) {
log.Info( "SCLauncherDir6 - Found HKLM -InstallLocation" );
if ( Directory.Exists( scLauncher ) ) {
@ -43,11 +43,11 @@ namespace SCJMapper_V2.SC
/// <summary>
/// Try to locate the launcher from Alpha 3.0.0 PTU - e.g. E:\G\StarCitizen\RSI PTU Launcher
/// </summary>
static private String SCLauncherDir5
static private string SCLauncherDir5
{
get {
log.Debug( "SCLauncherDir5 - Entry" );
String scLauncher = (String)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\94a6df8a-d3f9-558d-bb04-097c192530b9", "InstallLocation", null );
string scLauncher = (string)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\94a6df8a-d3f9-558d-bb04-097c192530b9", "InstallLocation", null );
if ( scLauncher != null ) {
log.Info( "SCLauncherDir5 - Found HKLM -InstallLocation (PTU)" );
if ( Directory.Exists( scLauncher ) ) {
@ -70,12 +70,12 @@ namespace SCJMapper_V2.SC
/// <summary>
/// Returns the base SC install path from something like "E:\G\StarCitizen"
/// </summary>
static private String SCBasePath
static private string SCBasePath
{
get {
log.Debug( "SCBasePath - Entry" );
appSettings.Reload( ); // local instance - reload as it might be changed outside
String scp = "";
string scp = "";
// User setting has Prio
if ( appSettings.UserSCPathUsed ) {
@ -150,7 +150,7 @@ namespace SCJMapper_V2.SC
/// <summary>
/// Returns the SC installation path or ""
/// </summary>
static public String SCInstallPath
static public string SCInstallPath
{
get {
log.Debug( "SCInstallPath - Entry" );
@ -164,11 +164,11 @@ namespace SCJMapper_V2.SC
/// Returns the SC Client path
/// SC 3.0.0: search path like E:\G\StarCitizen\StarCitizen\LIVE
/// </summary>
static public String SCClientPath
static public string SCClientPath
{
get {
log.Debug( "SCClientPath - Entry" );
String scp = SCBasePath;
string scp = SCBasePath;
#if DEBUG
//***************************************
// scp += "X"; // TEST not found (COMMENT OUT FOR PRODUCTIVE BUILD)
@ -176,7 +176,7 @@ namespace SCJMapper_V2.SC
#endif
string issue = "";
if ( String.IsNullOrEmpty( scp ) ) return ""; // no valid one can be found
if ( string.IsNullOrEmpty( scp ) ) return ""; // no valid one can be found
//
scp = Path.Combine( scp, "StarCitizen" );
string scpX = "";
@ -206,12 +206,12 @@ namespace SCJMapper_V2.SC
/// Returns the SC ClientData path
/// AC 3.0: E:\G\StarCitizen\StarCitizen\LIVE\Data
/// </summary>
static public String SCClientDataPath
static public string SCClientDataPath
{
get {
log.Debug( "SCClientDataPath - Entry" );
String scp = SCClientPath;
if ( String.IsNullOrEmpty( scp ) ) return ""; // no valid one can be found
string scp = SCClientPath;
if ( string.IsNullOrEmpty( scp ) ) return ""; // no valid one can be found
scp = Path.Combine( scp, "Data" );
#if DEBUG
@ -231,12 +231,12 @@ namespace SCJMapper_V2.SC
/// Returns the SC ClientData path
/// AC 3.0: E:\G\StarCitizen\StarCitizen\LIVE\USER
/// </summary>
static public String SCClientUSERPath
static public string SCClientUSERPath
{
get {
log.Debug( "SCClientUSERPath - Entry" );
String scp = SCClientPath;
if ( String.IsNullOrEmpty( scp ) ) return "";
string scp = SCClientPath;
if ( string.IsNullOrEmpty( scp ) ) return "";
//
scp = Path.Combine( scp, "USER" );
#if DEBUG
@ -256,12 +256,12 @@ namespace SCJMapper_V2.SC
/// Returns the SC ClientData path
/// AC 1.1.6: E:\G\StarCitizen\StarCitizen\Public
/// </summary>
static public String SCClientLogsPath
static public string SCClientLogsPath
{
get {
log.Debug( "SCClientLogsPath - Entry" );
String scp = SCClientPath;
if ( String.IsNullOrEmpty( scp ) ) return "";
string scp = SCClientPath;
if ( string.IsNullOrEmpty( scp ) ) return "";
#if DEBUG
//***************************************
// scp += "X"; // TEST not found (COMMENT OUT FOR PRODUCTIVE BUILD)
@ -279,12 +279,12 @@ namespace SCJMapper_V2.SC
/// Returns the SC ClientData path
/// AC 1.1.6: E:\G\StarCitizen\StarCitizen\Public\USER\Controls\Mappings
/// </summary>
static public String SCClientMappingPath
static public string SCClientMappingPath
{
get {
log.Debug( "SCClientMappingPath - Entry" );
String scp = SCClientUSERPath; // AC1.03 new here
if ( String.IsNullOrEmpty( scp ) ) return "";
string scp = SCClientUSERPath; // AC1.03 new here
if ( string.IsNullOrEmpty( scp ) ) return "";
//
scp = Path.Combine( scp, "Controls" );
scp = Path.Combine( scp, "Mappings" );
@ -305,12 +305,12 @@ namespace SCJMapper_V2.SC
/// Returns the SC Data.p4k file path
/// SC Alpha 3.0: E:\G\StarCitizen\StarCitizen\LIVE\Data.p4k (contains the binary XML now)
/// </summary>
static public String SCData_p4k
static public string SCData_p4k
{
get {
log.Debug( "SCDataXML_p4k - Entry" );
String scp = SCClientPath;
if ( String.IsNullOrEmpty( scp ) ) return "";
string scp = SCClientPath;
if ( string.IsNullOrEmpty( scp ) ) return "";
//
scp = Path.Combine( scp, "Data.p4k" );
#if DEBUG
@ -330,18 +330,18 @@ namespace SCJMapper_V2.SC
/// Returns the SC log file path to the latest logfile
/// AC 1.1.6: E:\G\StarCitizen\StarCitizen\Public\Game.log NOTE: 1.1.6 does not longer contain the needed entries .-((
/// </summary>
static public String SCLastLog
static public string SCLastLog
{
get {
log.Debug( "SCLastLog - Entry" );
String scp = SCClientLogsPath;
if ( String.IsNullOrEmpty( scp ) ) return "";
string scp = SCClientLogsPath;
if ( string.IsNullOrEmpty( scp ) ) return "";
//
try {
var files = Directory.EnumerateFiles( scp, "*.log", SearchOption.TopDirectoryOnly );
DateTime newestT = DateTime.FromFileTime( 1 ); // very old...
String newestF = "";
foreach ( String f in files ) {
string newestF = "";
foreach ( string f in files ) {
try {
FileInfo finfo = new FileInfo( f );
if ( finfo.LastWriteTime > newestT ) {
@ -364,7 +364,7 @@ namespace SCJMapper_V2.SC
/// Returns the relative path of DefaultProfile.xml
/// SC Alpha 2.2: still true .. but contains the binary XML now
/// </summary>
static public String DefaultProfilePath_rel
static public string DefaultProfilePath_rel
{
get {
log.Debug( "DefaultProfilePath_rel - Entry" );
@ -376,7 +376,7 @@ namespace SCJMapper_V2.SC
/// Returns the name part of the DefaultProfile w/o extension...
/// SC Alpha 2.2: still true .. but contains the binary XML now
/// </summary>
static public String DefaultProfileName
static public string DefaultProfileName
{
get {
log.Debug( "DefaultProfileName - Entry" );

@ -25,7 +25,7 @@ namespace SCJMapper_V2.p4kFile
/// ctor:
/// </summary>
/// <param name="filename">The filename</param>
public p4kRecReader( String filename )
public p4kRecReader( string filename )
{
Open( filename );
m_fileCreatedT = File.GetCreationTimeUtc( m_filestr.Name );
@ -36,7 +36,7 @@ namespace SCJMapper_V2.p4kFile
/// </summary>
/// <param name="filename">The filename</param>
/// <returns>True when successfull</returns>
private bool Open( String filename )
private bool Open( string filename )
{
if ( File.Exists( filename ) ) {
m_filestr = File.OpenRead( filename );

@ -19,12 +19,12 @@ namespace SCJMapper_V2
/// Creates the folder if needed
/// </summary>
/// <returns>Path to the Personal Program directory</returns>
static public String UserDir
static public string UserDir
{
get
{
log.Debug( "UserDir - Entry" );
String docPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.Personal ), Application.ProductName);
string docPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.Personal ), Application.ProductName);
if ( !Directory.Exists( docPath ) ) Directory.CreateDirectory( docPath );
return docPath;
}
@ -36,7 +36,7 @@ namespace SCJMapper_V2
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>A fully qualified filename</returns>
static public String MappingFileName( String mapName )
static public string MappingFileName( string mapName )
{
log.Debug( "MappingFileName - Entry" );
@ -48,11 +48,11 @@ namespace SCJMapper_V2
/// Create a backupfile from the given file
/// </summary>
/// <param name="mapName">The mapping name</param>
static public void BackupMappingFile( String mapName )
static public void BackupMappingFile( string mapName )
{
log.Debug( "BackupMappingFile - Entry" );
String mf = MappingFileName( mapName );
string mf = MappingFileName( mapName );
if ( File.Exists( mf ) ) File.Copy( mf, mf + ".backup", true );
}

@ -84,11 +84,11 @@ namespace SCJMapper_V2
}
[StringValidator( InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 10, MaxLength = 500 )]
public String scActionmaps
public string scActionmaps
{
get
{
return ( String )this["scActionmaps"];
return ( string )this["scActionmaps"];
}
set
{

Loading…
Cancel
Save