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;
|
2022-08-08 06:07:24 +00:00
|
|
|
|
MinimizeAfterPopOut = false;
|
2022-07-23 19:23:32 +00:00
|
|
|
|
AutoPanningKeyBinding = "0";
|
|
|
|
|
StartMinimized = false;
|
|
|
|
|
AutoDisableTrackIR = true;
|
|
|
|
|
AutoPopOutPanels = true;
|
|
|
|
|
OnScreenMessageDuration = 1;
|
|
|
|
|
UseLeftRightControlToPopOut = false;
|
|
|
|
|
IsEnabledTouchPanelServer = false;
|
|
|
|
|
|
2022-08-08 06:07:24 +00:00
|
|
|
|
|
2022-07-23 19:23:32 +00:00
|
|
|
|
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; }
|
|
|
|
|
|
2022-08-08 06:07:24 +00:00
|
|
|
|
public bool MinimizeAfterPopOut { get; set; }
|
|
|
|
|
|
2022-07-23 19:23:32 +00:00
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
}
|