From 025246d6fa97bc14a1a56724993c93afd5c7c208 Mon Sep 17 00:00:00 2001 From: hawkeye Date: Thu, 29 Feb 2024 01:11:56 -0500 Subject: [PATCH] Version 4.1.0 beta --- DomainModel/DomainModel.csproj | 6 +- DomainModel/Profile/FloatingPanel.cs | 11 +++ DomainModel/Profile/PanelConfig.cs | 13 ++- DomainModel/Profile/PanelConfigItem.cs | 2 + DomainModel/Profile/UserProfile.cs | 15 ++++ MainApp/App.xaml.cs | 2 +- .../AppUserControl/PopOutPanelConfigCard.xaml | 43 ++++++--- .../PopOutPanelConfigCard.xaml.cs | 81 +++++++++++++++-- MainApp/MainApp.csproj | 6 +- .../PopOutPanelConfigCardViewModel.cs | 4 +- Orchestration/AppOrchestrator.cs | 2 +- Orchestration/KeyboardOrchestrator.cs | 90 ++++++++++++++++--- Orchestration/Orchestration.csproj | 6 +- .../PanelConfigurationOrchestrator.cs | 29 ++++++ RELEASENOTES.md | 6 +- Shared/QualifyFullName.cs | 14 +++ Shared/Shared.csproj | 6 +- SimconnectAgent/SimconnectAgent.csproj | 6 +- VERSION.md | 10 ++- WindowsAgent/InputHookManager.cs | 37 ++++++-- WindowsAgent/WindowActionManager.cs | 5 ++ WindowsAgent/WindowEventManager.cs | 6 ++ WindowsAgent/WindowsAgent.csproj | 6 +- 23 files changed, 339 insertions(+), 67 deletions(-) create mode 100644 DomainModel/Profile/FloatingPanel.cs create mode 100644 Shared/QualifyFullName.cs diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index 4bc947a..c03a46f 100644 --- a/DomainModel/DomainModel.csproj +++ b/DomainModel/DomainModel.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.DomainModel x64 - 4.1.0.1 - 4.1.0.1 - 4.1.0.1 + 4.1.0.2 + 4.1.0.2 + 4.1.0.2 win-x64 Embedded Debug;Release;Local diff --git a/DomainModel/Profile/FloatingPanel.cs b/DomainModel/Profile/FloatingPanel.cs new file mode 100644 index 0000000..e0e04e0 --- /dev/null +++ b/DomainModel/Profile/FloatingPanel.cs @@ -0,0 +1,11 @@ +using MSFSPopoutPanelManager.Shared; + +namespace MSFSPopoutPanelManager.DomainModel.Profile +{ + public class FloatingPanel : ObservableObject + { + public bool IsEnabled { get; set; } + + public string KeyBinding { get; set; } + } +} diff --git a/DomainModel/Profile/PanelConfig.cs b/DomainModel/Profile/PanelConfig.cs index 878f2a0..7e0c33e 100644 --- a/DomainModel/Profile/PanelConfig.cs +++ b/DomainModel/Profile/PanelConfig.cs @@ -18,15 +18,20 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile private void PanelConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { - if (e.PropertyName == "FullScreen" && FullScreen) + if (e.PropertyName == nameof(FullScreen) && FullScreen) { AlwaysOnTop = false; HideTitlebar = false; } - else if (e.PropertyName == "TouchEnabled" && TouchEnabled) + else if (e.PropertyName == nameof(TouchEnabled) && TouchEnabled) { AutoGameRefocus = true; } + else if (e.PropertyName == nameof(FloatingPanel)) + { + if(!FloatingPanel.IsEnabled) + FloatingPanel.KeyBinding = null; + } } public Guid Id { get; set; } @@ -53,6 +58,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile public bool AutoGameRefocus { get; set; } = true; + public FloatingPanel FloatingPanel { get; set; } = new(); + public PanelSource PanelSource { get; set; } = new(); public FixedCameraConfig FixedCameraConfig { get; set; } = new(); @@ -85,6 +92,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile [JsonIgnore] public bool IsShownPanelSource { get; set; } + [JsonIgnore] public bool IsFloating { get; set; } = true; + [JsonIgnore] public bool IsDeletablePanel => PanelType != PanelType.HudBarWindow && PanelType != PanelType.RefocusDisplay && PanelType != PanelType.NumPadWindow; diff --git a/DomainModel/Profile/PanelConfigItem.cs b/DomainModel/Profile/PanelConfigItem.cs index 15697ca..6f5bd56 100644 --- a/DomainModel/Profile/PanelConfigItem.cs +++ b/DomainModel/Profile/PanelConfigItem.cs @@ -21,6 +21,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile FullScreen, TouchEnabled, AutoGameRefocus, + AllowFloatPanel, + FloatPanelKeyBinding, None } } diff --git a/DomainModel/Profile/UserProfile.cs b/DomainModel/Profile/UserProfile.cs index 7657661..8ae1c27 100644 --- a/DomainModel/Profile/UserProfile.cs +++ b/DomainModel/Profile/UserProfile.cs @@ -34,6 +34,20 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile if (arg is PropertyChangedExtendedEventArgs { DisableSave: false }) OnProfileChanged?.Invoke(this, EventArgs.Empty); + if (arg is PropertyChangedExtendedEventArgs changedArg) + { + if (changedArg.ObjectName == QualifyFullName.Of(nameof(MSFSPopoutPanelManager.DomainModel.Profile.FloatingPanel)) && + changedArg.PropertyName == nameof(FloatingPanel.IsEnabled)) + { + if(PanelConfigs.Any(x => x.FloatingPanel.IsEnabled)) + OnUseFloatingPanelChanged?.Invoke(this, true); + else + OnUseFloatingPanelChanged?.Invoke(this, false); + } + } + + + OnPanelConfigChanged(); }; OnProfileChanged?.Invoke(this, EventArgs.Empty); @@ -51,6 +65,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile InitializeChildPropertyChangeBinding(); } + public event EventHandler OnUseFloatingPanelChanged; public event EventHandler OnProfileChanged; public Guid Id { get; set; } = Guid.NewGuid(); diff --git a/MainApp/App.xaml.cs b/MainApp/App.xaml.cs index 33832cc..1c8c945 100644 --- a/MainApp/App.xaml.cs +++ b/MainApp/App.xaml.cs @@ -57,7 +57,7 @@ namespace MSFSPopoutPanelManager.MainApp services.AddSingleton(s => new PanelPopOutOrchestrator(SharedStorage, s.GetRequiredService(), s.GetRequiredService(), s.GetRequiredService())); services.AddSingleton(s => new PanelConfigurationOrchestrator(SharedStorage, s.GetRequiredService())); services.AddSingleton(s => new FlightSimOrchestrator(SharedStorage)); - services.AddSingleton(s => new KeyboardOrchestrator(SharedStorage, s.GetRequiredService())); + services.AddSingleton(s => new KeyboardOrchestrator(SharedStorage, s.GetRequiredService(), s.GetRequiredService())); services.AddSingleton(s => new HelpOrchestrator()); services.AddSingleton(s => new OrchestratorUiHelper(SharedStorage, s.GetRequiredService(), s.GetRequiredService())); diff --git a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml index 2249aab..46720a3 100644 --- a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml +++ b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml @@ -52,9 +52,9 @@ x:Key="TextBlockLabel" BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="TextBlock"> - + - +