diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index 0fb178f..7703d85 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.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 win-x64 Embedded Debug;Release;Local diff --git a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml index 66c7a3f..6e176c2 100644 --- a/MainApp/AppUserControl/PopOutPanelConfigCard.xaml +++ b/MainApp/AppUserControl/PopOutPanelConfigCard.xaml @@ -216,7 +216,10 @@ - + MSFSPopoutPanelManager.MainApp logo.ico x64 - 4.1.0.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 embedded en diff --git a/Orchestration/BaseOrchestrator.cs b/Orchestration/BaseOrchestrator.cs index b9156c3..db43ccc 100644 --- a/Orchestration/BaseOrchestrator.cs +++ b/Orchestration/BaseOrchestrator.cs @@ -1,4 +1,5 @@ using MSFSPopoutPanelManager.Shared; +using MSFSPopoutPanelManager.WindowsAgent; namespace MSFSPopoutPanelManager.Orchestration { @@ -16,5 +17,16 @@ namespace MSFSPopoutPanelManager.Orchestration protected AppSettingData AppSettingData => _sharedStorage.AppSettingData; protected FlightSimData FlightSimData => _sharedStorage.FlightSimData; + + protected void CloseAllPopOuts() + { + foreach (var panelConfig in ProfileData.ActiveProfile.PanelConfigs) + { + if (panelConfig.FloatingPanel.IsEnabled && !panelConfig.IsFloating) + panelConfig.IsFloating = true; + } + + WindowActionManager.CloseAllPopOuts(); + } } } diff --git a/Orchestration/DynamicLodManager.cs b/Orchestration/DynamicLodManager.cs index c10bd45..e08dda7 100644 --- a/Orchestration/DynamicLodManager.cs +++ b/Orchestration/DynamicLodManager.cs @@ -40,7 +40,7 @@ namespace MSFSPopoutPanelManager.Orchestration public static void Attach(FlightSimData flightSimData, AppSettingData appSettingData) { - if (appSettingData == null || !appSettingData.ApplicationSetting.DynamicLodSetting.IsEnabled || _isActive) + if (appSettingData == null || _isActive) return; _flightSimData = flightSimData; @@ -76,7 +76,7 @@ namespace MSFSPopoutPanelManager.Orchestration if (_appSettingData == null) return; - if (_appSettingData.ApplicationSetting.DynamicLodSetting.IsEnabled && _appSettingData.ApplicationSetting.DynamicLodSetting.ResetEnabled) + if (_appSettingData.ApplicationSetting.DynamicLodSetting.ResetEnabled) { WriteTlod(_appSettingData.ApplicationSetting.DynamicLodSetting.ResetTlod); WriteOlod(_appSettingData.ApplicationSetting.DynamicLodSetting.ResetOlod); diff --git a/Orchestration/FlightSimOrchestrator.cs b/Orchestration/FlightSimOrchestrator.cs index e636cbe..5923020 100644 --- a/Orchestration/FlightSimOrchestrator.cs +++ b/Orchestration/FlightSimOrchestrator.cs @@ -40,7 +40,9 @@ namespace MSFSPopoutPanelManager.Orchestration WindowProcessManager.GetSimulatorProcess(); // refresh simulator process DetectMsfsExit(); - DynamicLodManager.Attach(FlightSimData, AppSettingData); // Attach in memory override for Dynamic LOD + // Attach in memory override for Dynamic LOD + if (AppSettingData != null && AppSettingData.ApplicationSetting.DynamicLodSetting.IsEnabled) + DynamicLodManager.Attach(FlightSimData, AppSettingData); }; _simConnectProvider.OnDisconnected += (_, _) => @@ -390,7 +392,9 @@ namespace MSFSPopoutPanelManager.Orchestration FlightSimData.IsFlightStarted = true; - DynamicLodManager.Attach(FlightSimData, AppSettingData); // Attach in memory override for Dynamic LOD + // Attach in memory override for Dynamic LOD + if (AppSettingData != null && AppSettingData.ApplicationSetting.DynamicLodSetting.IsEnabled) + DynamicLodManager.Attach(FlightSimData, AppSettingData); } private void HandleOnFlightStopped(object sender, EventArgs e) @@ -398,14 +402,16 @@ namespace MSFSPopoutPanelManager.Orchestration ProfileData.ResetActiveProfile(); OnFlightStopped?.Invoke(this, EventArgs.Empty); - - WindowActionManager.CloseAllPopOuts(); + CloseAllPopOuts(); + FlightSimData.HudBarData?.Clear(); FlightSimData.IsFlightStarted = false; - DynamicLodManager.Detach(); // Detach in memory override for Dynamic LOD + // Detach in memory override for Dynamic LOD + if (AppSettingData != null && AppSettingData.ApplicationSetting.DynamicLodSetting.IsEnabled) + DynamicLodManager.Detach(); } private void DetectMsfsExit() diff --git a/Orchestration/KeyboardOrchestrator.cs b/Orchestration/KeyboardOrchestrator.cs index e208b38..5994f67 100644 --- a/Orchestration/KeyboardOrchestrator.cs +++ b/Orchestration/KeyboardOrchestrator.cs @@ -139,7 +139,6 @@ namespace MSFSPopoutPanelManager.Orchestration PreferenceConfigurationDetection, StartPopOutKeyboardShortcut, FloatingPanelDetection, - FloatingPanel, - + FloatingPanel } } diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 9be1104..ef54440 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 4.1.0.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 win-x64 Embedded Debug;Release;Local diff --git a/Orchestration/PanelConfigurationOrchestrator.cs b/Orchestration/PanelConfigurationOrchestrator.cs index 5752913..86c0073 100644 --- a/Orchestration/PanelConfigurationOrchestrator.cs +++ b/Orchestration/PanelConfigurationOrchestrator.cs @@ -32,7 +32,7 @@ namespace MSFSPopoutPanelManager.Orchestration _keyboardOrchestrator.OnKeystrokeDetected += (_, e) => { - if (ActiveProfile == null) + if (ProfileData == null || ActiveProfile == null) return; var panel = ActiveProfile.PanelConfigs.FirstOrDefault(p => p.Id == e.PanelId); diff --git a/Orchestration/PanelPopOutOrchestrator.cs b/Orchestration/PanelPopOutOrchestrator.cs index dfc5b90..2dfc340 100644 --- a/Orchestration/PanelPopOutOrchestrator.cs +++ b/Orchestration/PanelPopOutOrchestrator.cs @@ -95,8 +95,7 @@ namespace MSFSPopoutPanelManager.Orchestration public void ClosePopOut() { - // Close all existing custom pop out panels - WindowActionManager.CloseAllPopOuts(); + CloseAllPopOuts(); if (ActiveProfile != null) ActiveProfile.IsPoppedOut = false; @@ -144,7 +143,7 @@ namespace MSFSPopoutPanelManager.Orchestration ProfileData.ResetActiveProfile(); // Close all existing custom pop out panels - WindowActionManager.CloseAllPopOuts(); + CloseAllPopOuts(); // Close all panel source overlays _panelSourceOrchestrator.CloseAllPanelSource(); @@ -262,14 +261,8 @@ namespace MSFSPopoutPanelManager.Orchestration panelConfig.IsSelectedPanelSource = true; - //if(!AppSetting.GeneralSetting.TurboMode) - // _panelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig); - if(panelConfig.PanelSource.X != null && panelConfig.PanelSource.Y != null) InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode); - - //if(!AppSetting.GeneralSetting.TurboMode) - // _panelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig); ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++); diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 9ca880d..b8f063f 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Shared x64 - 4.1.0.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 win-x64 Embedded Debug;Release;Local diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index 1ec3e75..77cc1be 100644 --- a/SimconnectAgent/SimconnectAgent.csproj +++ b/SimconnectAgent/SimconnectAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.SimConnectAgent x64 - 4.1.0.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 win-x64 Embedded Debug;Release;Local diff --git a/WindowsAgent/InputEmulationManager.cs b/WindowsAgent/InputEmulationManager.cs index e71d14b..f7610c7 100644 --- a/WindowsAgent/InputEmulationManager.cs +++ b/WindowsAgent/InputEmulationManager.cs @@ -55,7 +55,7 @@ namespace MSFSPopoutPanelManager.WindowsAgent MoveAppWindowFromLeftClickPoint(x, y); - LeftClick(x + 30, y); // Left click outside the circle area to focus game window + LeftClick(x, y); // Left click outside the circle area to focus game window // Force cursor reset and focus PInvoke.SetCursorPos(x, y); diff --git a/WindowsAgent/WindowEventManager.cs b/WindowsAgent/WindowEventManager.cs index c1f60bc..2156aa8 100644 --- a/WindowsAgent/WindowEventManager.cs +++ b/WindowsAgent/WindowEventManager.cs @@ -189,7 +189,7 @@ namespace MSFSPopoutPanelManager.WindowsAgent return; } - if (panelConfig.FloatingPanel.IsEnabled && panelConfig.IsFloating) // do not update coordinate if floating panel + if (panelConfig.FloatingPanel.IsEnabled && !panelConfig.IsFloating) // do not update coordinate if floating panel return; panelConfig.Left = rect.Left; diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 7d9da87..a7c06e0 100644 --- a/WindowsAgent/WindowsAgent.csproj +++ b/WindowsAgent/WindowsAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WindowsAgent x64 - 4.1.0.3 - 4.1.0.3 - 4.1.0.3 + 4.1.0.4 + 4.1.0.4 + 4.1.0.4 win-x64 Embedded Debug;Release;Local