forked from SubnauticaNitrox/Nitrox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLauncherConfig.cs
76 lines (70 loc) · 2.3 KB
/
LauncherConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System.ComponentModel;
using System.Runtime.CompilerServices;
using NitroxLauncher.Properties;
using NitroxModel.Helper;
namespace NitroxLauncher
{
internal sealed class LauncherConfig : INotifyPropertyChanged
{
// Is the Nitrox version the latest available
private bool isUpToDate = true;
public bool IsUpToDate
{
get => isUpToDate;
set
{
isUpToDate = value;
OnPropertyChanged();
}
}
// Subnautica game files path
public string SubnauticaPath
{
get => NitroxUser.GamePath;
set
{
// Ensures the path looks alright (no mixed / and \ path separators)
NitroxUser.GamePath = value;
OnPropertyChanged();
}
}
public const string DEFAULT_LAUNCH_ARGUMENTS = "-vrmode none";
// Launch arguments used to launch Subnautica
private string subnauticaLaunchArguments = Settings.Default.LaunchArgs ?? DEFAULT_LAUNCH_ARGUMENTS;
public string SubnauticaLaunchArguments
{
get => subnauticaLaunchArguments;
set
{
if (value != subnauticaLaunchArguments)
{
subnauticaLaunchArguments = value;
Settings.Default.LaunchArgs = value;
Settings.Default.Save();
OnPropertyChanged();
}
}
}
// Is server external by default
private bool isExternalServer = Settings.Default.IsExternalServer;
public bool IsExternalServer
{
get => isExternalServer;
set
{
if (value != isExternalServer)
{
isExternalServer = value;
Settings.Default.IsExternalServer = value;
Settings.Default.Save();
OnPropertyChanged();
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}