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>
2014-08-02 22:10:55 +00:00
public DialogResult ShowSettings ( )
2014-07-06 00:14:57 +00:00
{
if ( FS = = null ) FS = new FormSettings ( this ) ;
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( )]
[DefaultSettingValueAttribute( "defaultProfile" )] // from Game Bundle
public String DefProfileName
{
get { return ( String ) this [ "DefProfileName" ] ; }
set { this [ "DefProfileName" ] = value ; }
}
[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-07-06 16:13:32 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean BlendUnmapped
{
get { return ( Boolean ) this [ "BlendUnmapped" ] ; }
set { this [ "BlendUnmapped" ] = value ; }
}
2014-06-28 20:31:31 +00:00
2014-07-06 00:14:57 +00:00
// Seetings Window
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS1
{
get { return ( String ) this [ "IgnoreJS1" ] ; }
set { this [ "IgnoreJS1" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS2
{
get { return ( String ) this [ "IgnoreJS2" ] ; }
set { this [ "IgnoreJS2" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS3
{
get { return ( String ) this [ "IgnoreJS3" ] ; }
set { this [ "IgnoreJS3" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS4
{
get { return ( String ) this [ "IgnoreJS4" ] ; }
set { this [ "IgnoreJS4" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS5
{
get { return ( String ) this [ "IgnoreJS5" ] ; }
set { this [ "IgnoreJS5" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS6
{
get { return ( String ) this [ "IgnoreJS6" ] ; }
set { this [ "IgnoreJS6" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS7
{
get { return ( String ) this [ "IgnoreJS7" ] ; }
set { this [ "IgnoreJS7" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String IgnoreJS8
{
get { return ( String ) this [ "IgnoreJS8" ] ; }
set { this [ "IgnoreJS8" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "" )] // empty
public String UserSCPath
{
get { return ( String ) this [ "UserSCPath" ] ; }
set { this [ "UserSCPath" ] = value ; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean UserSCPathUsed
{
get { return ( Boolean ) this [ "UserSCPathUsed" ] ; }
set { this [ "UserSCPathUsed" ] = value ; }
}
2014-08-02 20:28:13 +00:00
[UserScopedSettingAttribute( )]
2014-09-14 17:51:42 +00:00
[DefaultSettingValueAttribute( ",multiplayer,player,flycam,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-09-19 23:07:53 +00:00
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "False" )] // false
public Boolean ForceIgnoreversion
{
get { return ( Boolean ) this [ "ForceIgnoreversion" ] ; }
set { this [ "ForceIgnoreversion" ] = value ; }
}
2014-07-06 00:14:57 +00:00
#endregion
2014-06-28 20:31:31 +00:00
}
}