1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-29 01:00:13 +00:00
msfs-popout-panel-manager/UserDataAgent/AppSetting.cs

169 lines
5 KiB
C#
Raw Normal View History

2022-07-23 19:23:32 +00:00
using MSFSPopoutPanelManager.Shared;
using Newtonsoft.Json;
using PropertyChanged;
namespace MSFSPopoutPanelManager.UserDataAgent
{
public class AppSetting : ObservableObject
{
public AppSetting()
{
// Set defaults
AutoUpdaterUrl = "https://raw.githubusercontent.com/hawkeye-stan/msfs-popout-panel-manager/master/autoupdate.xml";
LastUsedProfileId = -1;
MinimizeToTray = false;
AlwaysOnTop = true;
UseAutoPanning = true;
AutoPanningKeyBinding = "0";
StartMinimized = false;
AutoDisableTrackIR = true;
AutoPopOutPanels = true;
OnScreenMessageDuration = 1;
UseLeftRightControlToPopOut = false;
IsEnabledTouchPanelServer = false;
AfterPopOutCameraView = new AfterPopOutCameraView();
AfterPopOutCameraView.PropertyChanged += (source, e) =>
{
var arg = e as PropertyChangedExtendedEventArgs;
OnPropertyChanged(arg.PropertyName, arg.OldValue, arg.NewValue);
};
TouchScreenSettings = new TouchScreenSettings();
TouchScreenSettings.PropertyChanged += (source, e) =>
{
var arg = e as PropertyChangedExtendedEventArgs;
OnPropertyChanged(arg.PropertyName, arg.OldValue, arg.NewValue);
};
TouchPanelSettings = new TouchPanelSettings();
TouchPanelSettings.PropertyChanged += (source, e) =>
{
var arg = e as PropertyChangedExtendedEventArgs;
OnPropertyChanged(arg.PropertyName, arg.OldValue, arg.NewValue);
};
}
public string AutoUpdaterUrl { get; set; }
public int LastUsedProfileId { get; set; }
public bool MinimizeToTray { get; set; }
public bool AlwaysOnTop { get; set; }
public bool UseAutoPanning { get; set; }
public string AutoPanningKeyBinding { get; set; }
public bool StartMinimized { get; set; }
public bool IncludeBuiltInPanel { get; set; }
public bool AutoPopOutPanels { get; set; }
public bool AutoDisableTrackIR { get; set; }
public int OnScreenMessageDuration { get; set; }
public bool UseLeftRightControlToPopOut { get; set; }
public bool IsEnabledTouchPanelServer { get; set; }
public AfterPopOutCameraView AfterPopOutCameraView { get; set; }
public TouchScreenSettings TouchScreenSettings { get; set; }
public TouchPanelSettings TouchPanelSettings { get; set; }
[JsonIgnore, DoNotNotify]
public bool AutoStart
{
get
{
return AppAutoStart.CheckIsAutoStart();
}
set
{
if (value)
AppAutoStart.Activate();
else
AppAutoStart.Deactivate();
}
}
}
public class AfterPopOutCameraView : ObservableObject
{
public AfterPopOutCameraView()
{
// Default values
EnableReturnToCameraView = true;
CameraView = AfterPopOutCameraViewType.CockpitCenterView;
CustomCameraKeyBinding = "1";
}
public bool EnableReturnToCameraView { get; set; }
public AfterPopOutCameraViewType CameraView { get; set; }
public string CustomCameraKeyBinding { get; set; }
// Use for MVVM binding only
[JsonIgnore]
public bool IsReturnToCustomCameraView { get { return CameraView == AfterPopOutCameraViewType.CustomCameraView; } }
// Use for MVVM binding only
[JsonIgnore]
public bool IsEnabledCustomCameraKeyBinding { get { return EnableReturnToCameraView && CameraView == AfterPopOutCameraViewType.CustomCameraView; } }
}
public enum AfterPopOutCameraViewType
{
CockpitCenterView,
CustomCameraView
}
public class TouchScreenSettings : ObservableObject
{
public TouchScreenSettings()
{
2022-07-30 02:29:20 +00:00
TouchDownUpDelay = 0;
2022-07-23 19:23:32 +00:00
RefocusGameWindow = true;
2022-07-30 02:29:20 +00:00
RefocusGameWindowDelay = 500;
2022-07-23 19:23:32 +00:00
}
2022-07-30 02:29:20 +00:00
public int TouchDownUpDelay { get; set; }
2022-07-23 19:23:32 +00:00
public bool RefocusGameWindow { get; set; }
2022-07-30 02:29:20 +00:00
public int RefocusGameWindowDelay { get; set; }
2022-07-23 19:23:32 +00:00
}
public class TouchPanelSettings : ObservableObject
{
public TouchPanelSettings()
{
// Default values
EnableTouchPanelIntegration = false;
DataRefreshInterval = 200;
MapRefreshInterval = 250;
UseArduino = false;
EnableSound = true;
}
public bool EnableTouchPanelIntegration { get; set; }
public bool AutoStart { get; set; }
public int DataRefreshInterval { get; set; }
public int MapRefreshInterval { get; set; }
public bool UseArduino { get; set; }
public bool EnableSound { get; set; }
}
}