From 03da2a1eeeb3cfe6feb57c07ee71050a9d40702b Mon Sep 17 00:00:00 2001 From: Stanley Date: Wed, 6 Jul 2022 14:09:10 -0400 Subject: [PATCH] Version 3.3.5 Release --- FsConnector/FsConnector.csproj | 6 +- Model/AppSetting.cs | 8 +- Model/Model.csproj | 6 +- Model/UserProfile.cs | 8 +- Provider/InputEmulationManager.cs | 71 +++++++++------- Provider/InputHookManager.cs | 9 +-- Provider/PanelPopoutManager.cs | 36 ++++----- Provider/PanelSelectionManager.cs | 63 +-------------- Provider/Provider.csproj | 2 +- Provider/SimConnectManager.cs | 2 + README.md | 31 +++++-- Shared/Shared.csproj | 4 +- VERSION.md | 15 +++- WpfApp/ApplicationWindow.xaml | 3 +- WpfApp/PanelCoorOverlay.xaml.cs | 27 ++++++- WpfApp/PreferencesDialog.xaml | 6 +- WpfApp/UserControlPanelSelection.xaml | 18 +++-- WpfApp/UserControlPanelSelection.xaml.cs | 8 ++ WpfApp/ViewModel/ApplicationViewModel.cs | 11 +-- WpfApp/ViewModel/DataStore.cs | 4 - WpfApp/ViewModel/PanelSelectionViewModel.cs | 89 +++++++++++++-------- WpfApp/WpfApp.csproj | 4 +- latestreleasenotes.txt | 35 ++++---- 23 files changed, 245 insertions(+), 221 deletions(-) diff --git a/FsConnector/FsConnector.csproj b/FsConnector/FsConnector.csproj index 9e27f17..85c33e9 100644 --- a/FsConnector/FsConnector.csproj +++ b/FsConnector/FsConnector.csproj @@ -5,15 +5,15 @@ FsConnector MSFS 2020 Popout Panel Manager FsConnector MSFS 2020 Popout Panel Manager FsConnector - 3.3.4.0 + 3.3.5.0 Stanley Kwok Stanley Kwok Stanley Kwok 2021 https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.FsConnector x64 - 3.3.4.0 - 3.3.4.0 + 3.3.5.0 + 3.3.5.0 diff --git a/Model/AppSetting.cs b/Model/AppSetting.cs index 48140f2..85e7e9d 100644 --- a/Model/AppSetting.cs +++ b/Model/AppSetting.cs @@ -27,7 +27,7 @@ namespace MSFSPopoutPanelManager.Model StartMinimized = false; IncludeBuiltInPanel = false; AutoDisableTrackIR = true; - AutoPopOutPanels = false; + AutoPopOutPanels = true; AutoPopOutPanelsWaitDelay = new AutoPopOutPanelsWaitDelay(); } @@ -150,9 +150,9 @@ namespace MSFSPopoutPanelManager.Model public AutoPopOutPanelsWaitDelay() { - ReadyToFlyButton = 6; - InitialCockpitView = 2; - InstrumentationPowerOn = 2; + ReadyToFlyButton = 4; + InitialCockpitView = 1; + InstrumentationPowerOn = 1; } public int ReadyToFlyButton { get; set; } diff --git a/Model/Model.csproj b/Model/Model.csproj index 711c012..76bb7b8 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -5,15 +5,15 @@ MSFSPopoutPanelManager.Model Model MSFS 2020 Popout Panel Manager Model - 3.3.4.0 + 3.3.5.0 Stanley Kwok Stanley Kwok Stanley Kwok 2021 MSFS 2020 Popout Panel Manager Model https://github.com/hawkeye-stan/msfs-popout-panel-manager x64 - 3.3.4.0 - 3.3.4.0 + 3.3.5.0 + 3.3.5.0 diff --git a/Model/UserProfile.cs b/Model/UserProfile.cs index d26d930..a16d473 100644 --- a/Model/UserProfile.cs +++ b/Model/UserProfile.cs @@ -24,7 +24,7 @@ namespace MSFSPopoutPanelManager.Model public bool IsLocked { get; set; } - public ObservableCollection PanelSourceCoordinates; + public ObservableCollection PanelSourceCoordinates { get; set; } public ObservableCollection PanelConfigs { get; set; } @@ -46,6 +46,12 @@ namespace MSFSPopoutPanelManager.Model get { return BindingAircraftLiveries.Count > 0; } } + [JsonIgnore] + public bool HasPanelSourceCoordinates + { + get { return PanelSourceCoordinates.Count > 0; } + } + #region Legacy Properties // Support pre-Version 3.3 tag for one time conversion diff --git a/Provider/InputEmulationManager.cs b/Provider/InputEmulationManager.cs index c1fb4d9..da0acb7 100644 --- a/Provider/InputEmulationManager.cs +++ b/Provider/InputEmulationManager.cs @@ -1,6 +1,8 @@ using System; +using System.Diagnostics; using System.Drawing; using System.Threading; +using System.Threading.Tasks; namespace MSFSPopoutPanelManager.Provider { @@ -37,6 +39,7 @@ namespace MSFSPopoutPanelManager.Provider public static void PopOutPanel(int x, int y) { + //LeftClickSimulatorUpperLeftCorner(); LeftClick(x, y); Thread.Sleep(300); @@ -93,30 +96,39 @@ namespace MSFSPopoutPanelManager.Provider PInvoke.keybd_event(Convert.ToByte(VK_LCONTROL), 0, KEYEVENTF_KEYUP, 0); } - public static void LoadCustomView(IntPtr hwnd, string keybinding) + public static void LoadCustomView(string keybinding) { - uint customViewKey = (uint)(Convert.ToInt32(keybinding) + KEY_0); + var simualatorProcess = DiagnosticManager.GetSimulatorProcess(); + if (simualatorProcess != null) + { + // First center view to make sure recalling custom camera works on the first press + InputEmulationManager.CenterView(simualatorProcess.Handle); - PInvoke.SetForegroundWindow(hwnd); - Thread.Sleep(500); + uint customViewKey = (uint)(Convert.ToInt32(keybinding) + KEY_0); - PInvoke.SetFocus(hwnd); - Thread.Sleep(300); + PInvoke.SetForegroundWindow(simualatorProcess.Handle); + Thread.Sleep(300); - // First center view using Ctrl-Space - PInvoke.keybd_event(Convert.ToByte(VK_LCONTROL), 0, KEYEVENTF_KEYDOWN, 0); - PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYDOWN, 0); - Thread.Sleep(200); - PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYUP, 0); - PInvoke.keybd_event(Convert.ToByte(VK_LCONTROL), 0, KEYEVENTF_KEYUP, 0); - Thread.Sleep(200); + PInvoke.SetFocus(simualatorProcess.Handle); + Thread.Sleep(300); - // Then load view using Alt-0 - PInvoke.keybd_event(Convert.ToByte(VK_LMENU), 0, KEYEVENTF_KEYDOWN, 0); - PInvoke.keybd_event(Convert.ToByte(customViewKey), 0, KEYEVENTF_KEYDOWN, 0); - Thread.Sleep(200); - PInvoke.keybd_event(Convert.ToByte(customViewKey), 0, KEYEVENTF_KEYUP, 0); - PInvoke.keybd_event(Convert.ToByte(VK_LMENU), 0, KEYEVENTF_KEYUP, 0); + // First center view using Ctrl-Space + PInvoke.keybd_event(Convert.ToByte(VK_LCONTROL), 0, KEYEVENTF_KEYDOWN, 0); + PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYDOWN, 0); + Thread.Sleep(200); + PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYUP, 0); + PInvoke.keybd_event(Convert.ToByte(VK_LCONTROL), 0, KEYEVENTF_KEYUP, 0); + Thread.Sleep(200); + + // Then load view using Alt-0 + PInvoke.keybd_event(Convert.ToByte(VK_LMENU), 0, KEYEVENTF_KEYDOWN, 0); + PInvoke.keybd_event(Convert.ToByte(customViewKey), 0, KEYEVENTF_KEYDOWN, 0); + Thread.Sleep(200); + PInvoke.keybd_event(Convert.ToByte(customViewKey), 0, KEYEVENTF_KEYUP, 0); + PInvoke.keybd_event(Convert.ToByte(VK_LMENU), 0, KEYEVENTF_KEYUP, 0); + + Thread.Sleep(500); + } } public static void ToggleFullScreenPanel(IntPtr hwnd) @@ -150,23 +162,26 @@ namespace MSFSPopoutPanelManager.Provider Rectangle clientRectangle; PInvoke.GetClientRect(hwnd, out clientRectangle); - // The "Ready to Fly" button is at about 94.7% width, 91.3% height at the lower right corner of game window + // The "Ready to Fly" button is at about 94.7% width, 84% to 96.25% height (91.3% default) with interface scaling of 70 at the lower right corner of game window // Try to click the area a few times to hit that button for both full screen and windows mode - // set focus to game app var x = Convert.ToInt32(rectangle.X + (clientRectangle.Width) * 0.947); - var y = Convert.ToInt32(rectangle.Y + (clientRectangle.Height) * 0.9); + var y = Convert.ToInt32(rectangle.Y + (clientRectangle.Height) * 0.84); LeftClick(x, y); - Thread.Sleep(250); LeftClick(x, y); - Thread.Sleep(250); - for (var top = y; top < y + 100; top = top + 20) + for (var top = y; top < y + (clientRectangle.Height) * 0.125; top = top + 10) { - LeftClick(x, Convert.ToInt32(top)); - Thread.Sleep(100); - LeftClick(x, Convert.ToInt32(top)); + Debug.WriteLine($"Trying to click at x: {x} y: {Convert.ToInt32(top)}"); + PInvoke.SetCursorPos(x, Convert.ToInt32(top)); Thread.Sleep(100); + PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, Convert.ToInt32(top), 0, 0); + Thread.Sleep(200); + PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, Convert.ToInt32(top), 0, 0); + Thread.Sleep(200); + PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, Convert.ToInt32(top), 0, 0); + Thread.Sleep(200); + PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, Convert.ToInt32(top), 0, 0); } } } diff --git a/Provider/InputHookManager.cs b/Provider/InputHookManager.cs index 26f06ea..814fcd2 100644 --- a/Provider/InputHookManager.cs +++ b/Provider/InputHookManager.cs @@ -1,6 +1,5 @@ using Gma.System.MouseKeyHook; using System; -using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; @@ -19,19 +18,12 @@ namespace MSFSPopoutPanelManager.Provider public static event EventHandler OnPanelSelectionCompleted; public static event EventHandler OnPanelSelectionAdded; public static event EventHandler OnPanelSelectionRemoved; - public static event EventHandler OnStartPopout; public static void StartHook() { if (_mouseHook == null) { _mouseHook = Hook.GlobalEvents(); - - _mouseHook.OnCombination(new Dictionary - { - {Combination.FromString("Control+Alt+P"), () => { if(SubscribeToStartPopOutEvent) OnStartPopout?.Invoke(null, null); }} - }); - _mouseHook.MouseDownExt += HandleMouseHookMouseDownExt; } } @@ -42,6 +34,7 @@ namespace MSFSPopoutPanelManager.Provider { _mouseHook.MouseDownExt -= HandleMouseHookMouseDownExt; _mouseHook.Dispose(); + _mouseHook = null; } } diff --git a/Provider/PanelPopoutManager.cs b/Provider/PanelPopoutManager.cs index 4c20f8c..328a2cb 100644 --- a/Provider/PanelPopoutManager.cs +++ b/Provider/PanelPopoutManager.cs @@ -45,19 +45,8 @@ namespace MSFSPopoutPanelManager.Provider OnPopOutStarted?.Invoke(this, null); - // If enable, load the current viewport into custom view by Ctrl-Alt-0 if (AppSetting.UseAutoPanning) - { - var simualatorProcess = DiagnosticManager.GetSimulatorProcess(); - if (simualatorProcess != null) - { - // First center view to make sure recalling custom camera works on the first press - InputEmulationManager.CenterView(simualatorProcess.Handle); - - InputEmulationManager.LoadCustomView(simualatorProcess.Handle, AppSetting.AutoPanningKeyBinding); - Thread.Sleep(500); - } - } + InputEmulationManager.LoadCustomView(AppSetting.AutoPanningKeyBinding); Task> popoutPanelTask = Task>.Factory.StartNew(() => { @@ -238,15 +227,7 @@ namespace MSFSPopoutPanelManager.Provider Thread.Sleep(500); } - // Apply full screen (cannot combine with always on top or hide title bar) - if (panel.FullScreen) - { - WindowManager.MoveWindow(panel.PanelHandle, panel.Left, panel.Top); - Thread.Sleep(1000); - InputEmulationManager.ToggleFullScreenPanel(panel.PanelHandle); - Thread.Sleep(1000); - } - else + if (!panel.FullScreen) { // Apply locations PInvoke.ShowWindow(panel.PanelHandle, PInvokeConstant.SW_RESTORE); @@ -279,6 +260,19 @@ namespace MSFSPopoutPanelManager.Provider PInvoke.ShowWindow(panel.PanelHandle, PInvokeConstant.SW_RESTORE); } }); + + // Apply full screen (cannot combine with always on top or hide title bar) + // Cannot run in parallel process + UserProfile.PanelConfigs.ToList().ForEach(panel => + { + if (panel.FullScreen && (!panel.AlwaysOnTop && !panel.HideTitlebar)) + { + WindowManager.MoveWindow(panel.PanelHandle, panel.Left, panel.Top); + Thread.Sleep(500); + InputEmulationManager.ToggleFullScreenPanel(panel.PanelHandle); + Thread.Sleep(250); + } + }); } private int GetPopoutPanelCountByType(PanelType panelType) diff --git a/Provider/PanelSelectionManager.cs b/Provider/PanelSelectionManager.cs index de5f11d..46964e4 100644 --- a/Provider/PanelSelectionManager.cs +++ b/Provider/PanelSelectionManager.cs @@ -2,8 +2,6 @@ using MSFSPopoutPanelManager.Shared; using System; using System.Collections.Generic; -using System.Drawing; -using System.Linq; namespace MSFSPopoutPanelManager.Provider { @@ -12,10 +10,6 @@ namespace MSFSPopoutPanelManager.Provider private UserProfileManager _userProfileManager; private int _panelIndex; private List _panelCoordinates; - private IntPtr _winEventHook; - private static PInvoke.WinEventProc _winEvent; // keep this as static to prevent garbage collect or the app will crash - private Rectangle _lastWindowRectangle; - private bool _isEditingPanelCoordinates; public event EventHandler OnPanelSelectionCompleted; public event EventHandler> OnPanelLocationAdded; @@ -39,8 +33,9 @@ namespace MSFSPopoutPanelManager.Provider { _panelIndex = 1; _panelCoordinates = new List(); - ShowPanelLocationOverlay(_panelCoordinates, true); + //ShowPanelLocationOverlay(_panelCoordinates, true); InputHookManager.SubscribeToPanelSelectionEvent = true; + InputHookManager.StartHook(); } public void ShowPanelLocationOverlay(List panelCoordinates, bool show) @@ -101,59 +96,5 @@ namespace MSFSPopoutPanelManager.Provider InputHookManager.SubscribeToPanelSelectionEvent = false; OnPanelSelectionCompleted?.Invoke(this, null); } - - public void StartEditPanelLocations() - { - _winEvent = new PInvoke.WinEventProc(PanelLocationEditEventCallback); - _winEventHook = PInvoke.SetWinEventHook(PInvokeConstant.EVENT_SYSTEM_MOVESIZEEND, PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE, DiagnosticManager.GetApplicationProcess().Handle, _winEvent, 0, 0, PInvokeConstant.WINEVENT_OUTOFCONTEXT); - _isEditingPanelCoordinates = true; - } - - public void EndEditPanelLocations() - { - PInvoke.UnhookWinEvent(_winEventHook); - _isEditingPanelCoordinates = false; - } - - private void PanelLocationEditEventCallback(IntPtr hWinEventHook, uint iEvent, IntPtr hWnd, int idObject, int idChild, int dwEventThread, int dwmsEventTime) - { - // check by priority to minimize escaping constraint - if (hWnd == IntPtr.Zero - || idObject != 0 - || hWinEventHook != _winEventHook - || !_isEditingPanelCoordinates - || !(iEvent == PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE || iEvent == PInvokeConstant.EVENT_SYSTEM_MOVESIZEEND) - || UserProfile.PanelSourceCoordinates == null || UserProfile.PanelSourceCoordinates.Count == 0) - { - return; - } - - var panelSourceCoordinate = UserProfile.PanelSourceCoordinates.FirstOrDefault(panel => panel.PanelHandle == hWnd); - - if (panelSourceCoordinate != null) - { - switch (iEvent) - { - case PInvokeConstant.EVENT_OBJECT_LOCATIONCHANGE: - Rectangle winRectangle; - PInvoke.GetWindowRect(panelSourceCoordinate.PanelHandle, out winRectangle); - - if (_lastWindowRectangle == winRectangle) // ignore duplicate callback messages - return; - - _lastWindowRectangle = winRectangle; - Rectangle clientRectangle; - PInvoke.GetClientRect(panelSourceCoordinate.PanelHandle, out clientRectangle); - - panelSourceCoordinate.X = winRectangle.Left; - panelSourceCoordinate.Y = winRectangle.Top; - - break; - case PInvokeConstant.EVENT_SYSTEM_MOVESIZEEND: - _userProfileManager.WriteUserProfiles(); - break; - } - } - } } } diff --git a/Provider/Provider.csproj b/Provider/Provider.csproj index f923cd7..64c532b 100644 --- a/Provider/Provider.csproj +++ b/Provider/Provider.csproj @@ -7,7 +7,7 @@ MSFSPopoutPanelManager.Provider MSFS 2020 Popout Panel Manager Provider MSFS 2020 Popout Panel Manager Provider - 3.3.4.0 + 3.3.5.0 Stanley Kwok Stanley Kwok 2021 https://github.com/hawkeye-stan/msfs-popout-panel-manager diff --git a/Provider/SimConnectManager.cs b/Provider/SimConnectManager.cs index ac742b5..6a73236 100644 --- a/Provider/SimConnectManager.cs +++ b/Provider/SimConnectManager.cs @@ -87,6 +87,7 @@ namespace MSFSPopoutPanelManager.Provider public void TurnOffTrackIR() { + Debug.Write("TrackIR OFF............" + Environment.NewLine); if (_simData != null && _simData.TrackIREnable) { SetTrackIREnable(false); @@ -96,6 +97,7 @@ namespace MSFSPopoutPanelManager.Provider public void TurnOnTrackIR() { + Debug.Write("TrackIR ON............" + Environment.NewLine); if (_isTrackIRManaged && _simData != null && !_simData.TrackIREnable) { SetTrackIREnable(true); diff --git a/README.md b/README.md index 360ebd3..63b7e1a 100644 --- a/README.md +++ b/README.md @@ -38,37 +38,52 @@ What if you can do the setup once by defining on screen where the pop out panels
-## How to Use +## How to Install -[Online video - How to use](https://vimeo.com/723158934) +1. After downloading the latest zip package from github repository or from Flightsim.to website, extract the zip package to a folder of your choice on your computer. You must have write access to this folder since your preference settings and profiles will be save in the folder **userdata** within the installation folder. Please do not install in **C:\Program Files** or **C:\Program Files (x86)** since most users do not have write access to these folders. - Start the application **MSFSPopoutPanelManager.exe** and it will automatically connect when MSFS/SimConnect starts. You maybe prompt to download .NET framework 5.0 x64. Please see the screenshot below to download and install x64 desktop version of the framework. +2. Start the application **MSFSPopoutPanelManager.exe** and it will automatically connect when MSFS/SimConnect starts. You maybe prompt to download .NET framework 5.0 x64 desktop runtime. Please see the screenshot below to download and install x64 desktop version of the framework.

- 1. First start the game and start a flight. Then create a new profile (for example: Kodiak 100) by clicking the "plus" button in step 1 of the app. +## How to Update + +1. To update the application, you can download the latest zip package and directly extract the package into your Pop Out Manager installation folder and overwrite all files within. Your **userdata** folder will be safe. + +2. You can also use the built-in auto update feature and let the application handles the update. If the update is optional, you can skip the update if you so choose. When you start the application and if an update is available, a dialog will appear and it will show the latest version's release notes and an option to update the application. + +3. If you're not being prompt for update when a new update is available, please try the following fixes: + + - Restart you computer and most of the time this will do the trick. + - Clear your default web browser cache on your computer since auto update will try to download latest version of update configuration file from github repository and the file may have been cached on your machine. + +## How to Use + +[Online video - How to use](https://vimeo.com/723158934) + +1. First start the application and the game. Once you're in the main menu of the game, you can create a new profile by clicking the "plus" button in step 1 of the app.

- 2. For step 2, if you want to associate the profile to the current aircraft livery to use in [Auto Pop Out](#auto-pop-out-feature) feature or for automatic profile switching when selecting a different aircraft, click the "plus" button next to the aircraft livery name. The aircraft livery title will become green once the livery is bound to the profile. +2. For step 2, if you want to associate the profile to the current aircraft livery to use in [Auto Pop Out](#auto-pop-out-feature) feature or for automatic profile switching when selecting a different aircraft, click the "plus" button next to the aircraft livery name. The aircraft livery title will become green once the livery is bound to the profile. Your chosen livery may not be available to select in the application for your newly selected plane until a flight is started.

- 3. Now start a flight with your chosen aircraft. Once your flight is started, you're ready to select the panels you want to pop out. Please click "Start Panel Selection" to define where the pop out panels will be using **LEFT CLICK**. Use **CTRL-LEFT CLICK** when selection is completed. You can also move the number circles at this point to do final adjustment. +3. Now start a flight with your chosen aircraft. Once your flight is started, you're ready to select the panels you want to pop out. Please click "Start Panel Selection" to define where the pop out panels will be using **LEFT CLICK**. Use **CTRL-LEFT CLICK** when selection is completed. You can also move the number circles at this point to do final adjustment.

- 4. Next, click "Start Pop Out". At this point, please be patient. The application will start popping out and separating panels one by one and you will see a lot of movements on screen. If something goes wrong, just follow the instruction in the status message and try again. Once the process is done, you will see a list of panels line up in the upper left corner of the screen. All the panels are given a default name. You can name them anything you want as needed. +4. Next, click "Start Pop Out". At this point, please be patient. The application will start popping out and separating panels one by one and you will see a lot of movements on screen. If something goes wrong, just follow the instruction in the status message and try again. Once the process is done, you will see a list of panels line up in the upper left corner of the screen. All the panels are given a default name. You can name them anything you want as needed. - 5. You can now start panel configuration by dragging the pop out panels into their final position (to your main monitor or another monitor). You can also type value directly into the data grid to move and resize a panel. The +/- pixel buttons by the lower left corner of the grid allow you to change panel position at the chosen increment/decrement by selecting the data grid cell first (X-Pos, Y-Pos, Width, Height). You can also check "Always on Top", "Hide Title Bar", or "Full Screen Mode" if desire. If the panel is touch capable, you can check "Touch Enabled". Please see [Touch Enable Pop Out Feature](#touch-enable-pop-out-feature) regarding this experimental feature. Once all the panels are at their final position, just click "Lock Panel" to prevent further panel changes. +5. You can now start panel configuration by dragging the pop out panels into their final position (to your main monitor or another monitor). You can also type value directly into the data grid to move and resize a panel. The +/- pixel buttons by the lower left corner of the grid allow you to change panel position at the chosen increment/decrement by selecting the data grid cell first (X-Pos, Y-Pos, Width, Height). You can also check "Always on Top", "Hide Title Bar", or "Full Screen Mode" if desire. If the panel is touch capable, you can check "Touch Enabled". Please see [Touch Enable Pop Out Feature](#touch-enable-pop-out-feature) regarding this experimental feature. Once all the panels are at their final position, just click "Lock Panel" to prevent further panel changes.

diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index f0b74c6..5c4d8cf 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -9,10 +9,10 @@ Stanley Kwok Stanley Kwok 2021 https://github.com/hawkeye-stan/msfs-popout-panel-manager - 3.3.4.0 + 3.3.5.0 x64 true - 3.3.4.0 + 3.3.5.0 diff --git a/VERSION.md b/VERSION.md index fb6c1c6..8f28eff 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,16 +1,23 @@ # Version History


+## Version 3.3.5 +* Fixed an issue when using auto pop out panel in combination with power on during cold start for the following two G1000 planes (Cessna 172 and Cessna 208B Grand Caravan), instrumentations are not powering on to allow pop out to occur. +* Fixed an issue when panels are designated as full screen mode, they're not resizing to full screen after they're popped out. +* Fixed an issue when using auto pop out panel, "Ready to Fly" button may not get click when interface scale is set to higher than 70. Unfortunately, because of how MSFS coded this particular button, this fix may add few extra seconds to the duration of auto pop out process since the application needs to search for the button to click. To speed up the pop out process, you can try to set auto pop out panel wait delays to minimum of 1 second in preferences menu and increase one second at a time until pop out works flawlessly for your system. +* Updated verbiage for "Save Auto Panning Camera" button to "Override Auto Panning Camera". This is to clear the confusion when initially selecting panels for a profile, clicking this button seems to be required. "Override Auto Panning Camera" is only needed when your camera viewport has changed for an existing profile and you do not want to recreate a new profile to set new panel locations. +* Made improvement to the behavior of Track IR (enable/disable) when using the application. + ## Version 3.3.4 -* Fixed issue when using Auto Pop Out Panel feature in conjunction with Auto Disable Track IR setting. When performing cold start on G1000 / G1000 NXi equipped plane with Power on required checked, PFD and MFD fail to turn on or they will turn off by themselves. This resulted in pop out process to fail. -* Fixed issue when using Auto Pop Out Panel and the game is in Windows mode, Pop Out Manager fails to automatically click the "Ready to Fly" button. +* Fixed an issue when using Auto Pop Out Panel feature in conjunction with Auto Disable Track IR setting. When performing cold start on G1000 / G1000 NXi equipped plane with Power on required checked, PFD and MFD fail to turn on or they will turn off by themselves. This resulted in pop out process to fail. +* Fixed an issue when using Auto Pop Out Panel and the game is in Windows mode, Pop Out Manager fails to automatically click the "Ready to Fly" button. * Made improvements to the detection of flight start and flight end. This help to resolve an issue when exiting a flight, Pop Out Manager tries to pop out panels again. * Added touch enabled panel experimental feature. Please see github repo README.md on how to use this feature. This feature tries to workaround an outstanding issue regarding lack of support by MSFS with pop out that has touch component (GTN750, King Air 350, Built-in panels such as Check List, ATC, etc). * Updated documentations and how to videos. ## Version 3.3.3 -* Fixed issue when clicking on "Show/Edit Panel Location Overlay" or setting auto TrackIR disabling option will cause PFD/MFD panels to be turned off when performing auto pop out in cold start for G1000 equipped planes. -* Fixed issue where auto panning of cockpit view does not pan to previously saved camera view during pop out process. +* Fixed an issue when clicking on "Show/Edit Panel Location Overlay" or setting auto Track IR disabling option will cause PFD/MFD panels to be turned off when performing auto pop out in cold start for G1000 equipped planes. +* Fixed an issue where auto panning of cockpit view does not pan to previously saved camera view during pop out process. ## Version 3.3.2 * Hotfix: Fixed application crash when performing panel selections when MSFS is not running. diff --git a/WpfApp/ApplicationWindow.xaml b/WpfApp/ApplicationWindow.xaml index 835a6ca..7fef1d2 100644 --- a/WpfApp/ApplicationWindow.xaml +++ b/WpfApp/ApplicationWindow.xaml @@ -39,8 +39,7 @@ - - + diff --git a/WpfApp/PanelCoorOverlay.xaml.cs b/WpfApp/PanelCoorOverlay.xaml.cs index 04c10cb..1bfd3f1 100644 --- a/WpfApp/PanelCoorOverlay.xaml.cs +++ b/WpfApp/PanelCoorOverlay.xaml.cs @@ -1,19 +1,44 @@ -using System; +using MSFSPopoutPanelManager.Shared; +using System; using System.Windows; namespace MSFSPopoutPanelManager.WpfApp { public partial class PanelCoorOverlay : Window { + private const int TOP_ADJUSTMENT = 23; // half of window height + private const int LEFT_ADJUSTMENT = 27; // half of window width + public bool IsEditingPanelLocation { get; set; } public IntPtr WindowHandle { get; set; } + public event EventHandler> WindowLocationChanged; + public PanelCoorOverlay(int panelIndex) { InitializeComponent(); this.lblPanelIndex.Content = panelIndex; IsEditingPanelLocation = false; + + this.LocationChanged += PanelCoorOverlay_LocationChanged; + } + + public void MoveWindow(int x, int y) + { + this.Left = x - LEFT_ADJUSTMENT; + this.Top = y - TOP_ADJUSTMENT; + } + + private void PanelCoorOverlay_LocationChanged(object sender, EventArgs e) + { + if (this.Top is double.NaN || this.Left is double.NaN) + return; + + var top = Convert.ToInt32(this.Top); + var left = Convert.ToInt32(this.Left); + + WindowLocationChanged?.Invoke(this, new EventArgs(new System.Drawing.Point(left + LEFT_ADJUSTMENT, top + TOP_ADJUSTMENT))); } private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) diff --git a/WpfApp/PreferencesDialog.xaml b/WpfApp/PreferencesDialog.xaml index 581e28d..bfcdf3d 100644 --- a/WpfApp/PreferencesDialog.xaml +++ b/WpfApp/PreferencesDialog.xaml @@ -120,17 +120,17 @@ - Amount of time to wait for 'Ready to Fly' button to appear.(Default: 6 seconds) + Amount of time to wait for 'Ready to Fly' button to appear.(Default: 4 seconds) - Amount of time to wait for the cockpit to appear.(Default: 2 seconds) + Amount of time to wait for the cockpit to appear.(Default: 1 second) - Amount of time to wait for cold start instrumentation power on to complete.(Default: 2 seconds) + Amount of time to wait for cold start instrumentation power on to complete.(Default: 1 second) diff --git a/WpfApp/UserControlPanelSelection.xaml b/WpfApp/UserControlPanelSelection.xaml index 21af3b7..6ea71b7 100644 --- a/WpfApp/UserControlPanelSelection.xaml +++ b/WpfApp/UserControlPanelSelection.xaml @@ -25,6 +25,14 @@ +