2014-06-28 20:31:31 +00:00
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using System.Configuration ;
using System.Drawing ;
2014-08-02 22:10:55 +00:00
using System.Windows.Forms ;
2014-06-28 20:31:31 +00:00
namespace SCJMapper_V2
{
sealed class AppSettings : ApplicationSettingsBase
{
2014-07-06 00:14:57 +00:00
FormSettings FS = null ;
2014-08-02 20:28:13 +00:00
public AppSettings ( )
{
if ( this . FirstRun ) {
// migrate the settings to the new version if the app runs the rist time
try {
this . Upgrade ( ) ;
}
catch { }
this . FirstRun = false ;
this . Save ( ) ;
}
}
/// <summary>
/// Show the Settings Dialog
/// </summary>
2015-12-26 22:16:25 +00:00
public DialogResult ShowSettings ( String pasteString )
2014-07-06 00:14:57 +00:00
{
if ( FS = = null ) FS = new FormSettings ( this ) ;
2015-12-26 22:16:25 +00:00
FS . PasteString = pasteString ; // propagate joyinput
2014-07-06 00:14:57 +00:00
FS . ShowDialog ( ) ;
2014-08-02 22:10:55 +00:00
return ( FS . Canceled ) ? DialogResult . Cancel : DialogResult . OK ;
2014-07-06 00:14:57 +00:00
}
#region Setting Properties
2014-08-02 20:28:13 +00:00
// manages Upgrade
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean FirstRun
{
get { return ( Boolean ) this [ "FirstRun" ] ; }
set { this [ "FirstRun" ] = value ; }
}
2014-07-06 00:14:57 +00:00
2014-06-28 20:31:31 +00:00
// Control bound settings
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "1000, 900" )]
public Size FormSize
{
get { return ( Size ) this [ "FormSize" ] ; }
set { this [ "FormSize" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "10, 10" )]
public Point FormLocation
{
get { return ( Point ) this [ "FormLocation" ] ; }
set { this [ "FormLocation" ] = value ; }
}
// User Config Settings
[UserScopedSettingAttribute( )]
2014-06-28 21:50:07 +00:00
[DefaultSettingValueAttribute( "layout_joystick_spacesim" )] // from Game Bundle
public String DefMappingName
2014-06-28 20:31:31 +00:00
{
2014-06-28 21:50:07 +00:00
get { return ( String ) this [ "DefMappingName" ] ; }
set { this [ "DefMappingName" ] = value ; }
2014-06-28 20:31:31 +00:00
}
2014-06-29 01:26:39 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "layout_my_joystick" )] // just a default
public String MyMappingName
{
get { return ( String ) this [ "MyMappingName" ] ; }
set { this [ "MyMappingName" ] = value ; }
}
2014-12-22 00:34:09 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowJoystick
{
get { return ( Boolean ) this [ "ShowJoystick" ] ; }
set { this [ "ShowJoystick" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowGamepad
{
get { return ( Boolean ) this [ "ShowGamepad" ] ; }
set { this [ "ShowGamepad" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowKeyboard
{
get { return ( Boolean ) this [ "ShowKeyboard" ] ; }
set { this [ "ShowKeyboard" ] = value ; }
}
2015-12-22 00:47:23 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "True" )]
public Boolean ShowMouse // 20151220BM: add mouse device (from AC 2.0 defaultProfile usage)
{
get { return ( Boolean ) this [ "ShowMouse" ] ; }
set { this [ "ShowMouse" ] = value ; }
}
2014-12-22 00:34:09 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean ShowMapped
{
get { return ( Boolean ) this [ "ShowMapped" ] ; }
set { this [ "ShowMapped" ] = value ; }
}
2014-06-28 20:31:31 +00:00
2014-07-06 00:14:57 +00:00
// Seetings Window
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS1
{
get { return ( String ) this [ "IgnoreJS1" ] ; }
set { this [ "IgnoreJS1" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS2
{
get { return ( String ) this [ "IgnoreJS2" ] ; }
set { this [ "IgnoreJS2" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS3
{
get { return ( String ) this [ "IgnoreJS3" ] ; }
set { this [ "IgnoreJS3" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS4
{
get { return ( String ) this [ "IgnoreJS4" ] ; }
set { this [ "IgnoreJS4" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS5
{
get { return ( String ) this [ "IgnoreJS5" ] ; }
set { this [ "IgnoreJS5" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS6
{
get { return ( String ) this [ "IgnoreJS6" ] ; }
set { this [ "IgnoreJS6" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS7
{
get { return ( String ) this [ "IgnoreJS7" ] ; }
set { this [ "IgnoreJS7" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String IgnoreJS8
{
get { return ( String ) this [ "IgnoreJS8" ] ; }
set { this [ "IgnoreJS8" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "" )]
2014-07-06 00:14:57 +00:00
public String UserSCPath
{
get { return ( String ) this [ "UserSCPath" ] ; }
set { this [ "UserSCPath" ] = value ; }
}
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "False" )]
2014-07-06 00:14:57 +00:00
public Boolean UserSCPathUsed
{
get { return ( Boolean ) this [ "UserSCPathUsed" ] ; }
set { this [ "UserSCPathUsed" ] = value ; }
}
2014-08-02 20:28:13 +00:00
[UserScopedSettingAttribute( )]
2014-10-19 12:13:11 +00:00
[DefaultSettingValueAttribute( ",multiplayer,player,flycam,vehicle_driver,singleplayer," )] // empty Note: comma separated list, must have a comma at the begining and the end (to find 'player' on its own...)
2014-08-02 20:28:13 +00:00
public String IgnoreActionmaps
{
get { return ( String ) this [ "IgnoreActionmaps" ] ; }
set { this [ "IgnoreActionmaps" ] = value ; }
}
2014-07-06 00:14:57 +00:00
2014-11-16 23:36:17 +00:00
[UserScopedSettingAttribute( )]
2014-12-22 00:34:09 +00:00
[DefaultSettingValueAttribute( "False" )]
2014-11-16 23:36:17 +00:00
public Boolean DetectGamepad
{
get { return ( Boolean ) this [ "DetectGamepad" ] ; }
set { this [ "DetectGamepad" ] = value ; }
}
2015-12-26 22:16:25 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )]
public Boolean UsePTU
{
get { return ( Boolean ) this [ "UsePTU" ] ; }
set { this [ "UsePTU" ] = value ; }
}
2014-11-16 23:36:17 +00:00
2014-07-06 00:14:57 +00:00
#endregion
2014-06-28 20:31:31 +00:00
}
}