mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-12-28 07:11:59 +00:00
Version v3.4.2 Release
This commit is contained in:
parent
d570536c14
commit
ee3ca07d6a
9 changed files with 41 additions and 31 deletions
|
@ -22,7 +22,7 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
|
||||
public bool IsSimulatorStarted { get; set; }
|
||||
|
||||
public bool IsEnteredFlight { get; set; }
|
||||
public bool IsInCockpit { get; set; }
|
||||
|
||||
public new void OnPropertyChanged(string propertyName, object oldValue, object newValue)
|
||||
{
|
||||
|
@ -43,7 +43,6 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
CurrentMsfsAircraft = null;
|
||||
CurrentMsfsLiveryTitle = null;
|
||||
ElectricalMasterBatteryStatus = false;
|
||||
IsEnteredFlight = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,8 +64,9 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
ProfileData.AutoSwitchProfile();
|
||||
}
|
||||
};
|
||||
_simConnectProvider.OnFlightStarted += (sender, e) => OnFlightStarted?.Invoke(this, null);
|
||||
_simConnectProvider.OnFlightStarted += HandleOnFlightStarted;
|
||||
_simConnectProvider.OnFlightStopped += HandleOnFlightStopped;
|
||||
_simConnectProvider.OnIsInCockpitChanged += (sender, e) => FlightSimData.IsInCockpit = e;
|
||||
_simConnectProvider.Start();
|
||||
}
|
||||
|
||||
|
@ -110,22 +111,16 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
_simConnectProvider.TurnOffAvionics(ProfileData.ActiveProfile.PowerOnRequiredForColdStart);
|
||||
}
|
||||
|
||||
public void AutoPanelPopOutActivation(bool activate)
|
||||
private void HandleOnFlightStarted(object sender, EventArgs e)
|
||||
{
|
||||
if (activate)
|
||||
_simConnectProvider.OnFlightStarted += HandleOnFlightStartedForAutoPopOut;
|
||||
else
|
||||
_simConnectProvider.OnFlightStarted -= HandleOnFlightStartedForAutoPopOut;
|
||||
}
|
||||
OnFlightStarted?.Invoke(this, null);
|
||||
|
||||
private void HandleOnFlightStartedForAutoPopOut(object sender, EventArgs e)
|
||||
{
|
||||
OnFlightStartedForAutoPopOut?.Invoke(this, null);
|
||||
if (AppSettingData.AppSetting.AutoPopOutPanels)
|
||||
OnFlightStartedForAutoPopOut?.Invoke(this, null);
|
||||
}
|
||||
|
||||
private void HandleOnFlightStopped(object sender, EventArgs e)
|
||||
{
|
||||
FlightSimData.IsEnteredFlight = false;
|
||||
OnFlightStopped?.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
FlightSimData.CurrentMsfsLiveryTitleChanged += (sernder, e) => { ProfileData.MigrateLiveryToAircraftBinding(); ProfileData.AutoSwitchProfile(); };
|
||||
|
||||
AppSettingData = new AppSettingData();
|
||||
AppSettingData.AutoPopOutPanelsChanged += (sender, e) => FlightSim.AutoPanelPopOutActivation(e);
|
||||
AppSettingData.TouchPanelIntegrationChanged += async (sender, e) =>
|
||||
{
|
||||
await TouchPanel.TouchPanelIntegrationUpdated(e);
|
||||
|
@ -99,7 +98,6 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
CheckForAutoUpdate();
|
||||
|
||||
ProfileData.UpdateActiveProfile(AppSettingData.AppSetting.LastUsedProfileId); // Load last used profile
|
||||
FlightSim.AutoPanelPopOutActivation(AppSettingData.AppSetting.AutoPopOutPanels); // Activate auto pop out panel if defined in preferences
|
||||
FlightSim.StartSimConnectServer(); // Start the SimConnect server
|
||||
|
||||
// Enable/Disable touch panel feature (Personal use only feature)
|
||||
|
|
|
@ -57,8 +57,6 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
|
||||
ProfileData.AutoSwitchProfile();
|
||||
|
||||
FlightSimData.IsEnteredFlight = true;
|
||||
|
||||
// find the profile with the matching binding aircraft
|
||||
var profile = ProfileData.Profiles.FirstOrDefault(p => p.BindingAircrafts.Any(p => p == FlightSimData.CurrentMsfsAircraft));
|
||||
|
||||
|
|
|
@ -175,13 +175,25 @@ namespace MSFSPopoutPanelManager.Orchestration
|
|||
// Started in v3.4.2
|
||||
public void MigrateLiveryToAircraftBinding(string liveryName, string aircraftName)
|
||||
{
|
||||
bool hasChanges = false;
|
||||
if (Profiles != null && !string.IsNullOrEmpty(liveryName) && !string.IsNullOrEmpty(aircraftName))
|
||||
{
|
||||
var matchedProfile = Profiles.FirstOrDefault(p => p.BindingAircraftLiveries.Any(t => t == liveryName));
|
||||
|
||||
if (matchedProfile != null && !matchedProfile.BindingAircrafts.Any(a => a == aircraftName))
|
||||
{
|
||||
matchedProfile.BindingAircrafts.Add(aircraftName);
|
||||
hasChanges = true;
|
||||
}
|
||||
|
||||
if (matchedProfile != null)
|
||||
{
|
||||
matchedProfile.BindingAircraftLiveries.Remove(liveryName);
|
||||
hasChanges = true;
|
||||
}
|
||||
|
||||
if (hasChanges)
|
||||
{
|
||||
WriteProfiles();
|
||||
RefreshProfile();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
|
|||
|
||||
public event EventHandler OnConnected;
|
||||
public event EventHandler OnDisconnected;
|
||||
public event EventHandler<bool> OnIsInCockpitChanged;
|
||||
public event EventHandler OnFlightStarted;
|
||||
public event EventHandler OnFlightStopped;
|
||||
public event EventHandler<List<SimConnectDataDefinition>> OnSimConnectDataRefreshed;
|
||||
|
@ -227,7 +228,6 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
|
|||
DetectFlightStartedOrStopped();
|
||||
}
|
||||
|
||||
private const int CAMERA_STATE_INIT = 0;
|
||||
private const int CAMERA_STATE_COCKPIT = 2;
|
||||
private const int CAMERA_STATE_LOAD_SCREEN = 11;
|
||||
private const int CAMERA_STATE_HOME_SCREEN = 15;
|
||||
|
@ -241,9 +241,11 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
|
|||
if (_currentCameraState == cameraState)
|
||||
return;
|
||||
|
||||
if (cameraState == CAMERA_STATE_COCKPIT)
|
||||
OnIsInCockpitChanged?.Invoke(this, true);
|
||||
|
||||
switch (_currentCameraState)
|
||||
{
|
||||
case CAMERA_STATE_INIT:
|
||||
case CAMERA_STATE_HOME_SCREEN:
|
||||
case CAMERA_STATE_LOAD_SCREEN:
|
||||
if (cameraState == CAMERA_STATE_COCKPIT)
|
||||
|
@ -254,16 +256,17 @@ namespace MSFSPopoutPanelManager.SimConnectAgent
|
|||
|
||||
break;
|
||||
case CAMERA_STATE_COCKPIT:
|
||||
if ((cameraState == CAMERA_STATE_LOAD_SCREEN || cameraState == CAMERA_STATE_HOME_SCREEN))
|
||||
if (cameraState == CAMERA_STATE_LOAD_SCREEN || cameraState == CAMERA_STATE_HOME_SCREEN)
|
||||
{
|
||||
_currentCameraState = cameraState;
|
||||
OnFlightStopped?.Invoke(this, null);
|
||||
OnIsInCockpitChanged?.Invoke(this, false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (cameraState == CAMERA_STATE_INIT || cameraState == CAMERA_STATE_COCKPIT || cameraState == CAMERA_STATE_HOME_SCREEN || cameraState == CAMERA_STATE_LOAD_SCREEN)
|
||||
if (cameraState == CAMERA_STATE_COCKPIT || cameraState == CAMERA_STATE_HOME_SCREEN || cameraState == CAMERA_STATE_LOAD_SCREEN)
|
||||
_currentCameraState = cameraState;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
|
||||
* Added work around for SU10 Beta issue when after panel separations, panels' size become so big and they block most of the game window for lower resolution screen and prevented Pop Out Panel Manager from popping out the next panel.
|
||||
|
||||
* Made improvement to how panels are separated when using multiple monitors.
|
||||
* Made improvements to how panels are separated during pop out process.
|
||||
|
||||
* Fixed an issue when adjusting position and size of a pop out, it may not work correctly on some PC configuration.
|
||||
|
||||
Known issue:
|
||||
|
||||
|
|
|
@ -45,33 +45,33 @@ namespace MSFSPopoutPanelManager.WpfApp.ViewModel
|
|||
.ObservesProperty(() => ProfileData.ActiveProfile)
|
||||
.ObservesProperty(() => FlightSimData.IsSimulatorStarted);
|
||||
|
||||
StartPanelSelectionCommand = new DelegateCommand(OnStartPanelSelection, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile != null && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight)
|
||||
StartPanelSelectionCommand = new DelegateCommand(OnStartPanelSelection, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile != null && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
|
||||
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile)
|
||||
.ObservesProperty(() => FlightSimData.IsSimulatorStarted)
|
||||
.ObservesProperty(() => FlightSimData.IsEnteredFlight);
|
||||
.ObservesProperty(() => FlightSimData.IsInCockpit);
|
||||
|
||||
StartPopOutCommand = new DelegateCommand(OnStartPopOut, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && (ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 || ProfileData.ActiveProfile.TouchPanelBindings.Count > 0) && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight)
|
||||
StartPopOutCommand = new DelegateCommand(OnStartPopOut, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && (ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 || ProfileData.ActiveProfile.TouchPanelBindings.Count > 0) && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
|
||||
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile.TouchPanelBindings.Count)
|
||||
.ObservesProperty(() => FlightSimData.IsSimulatorStarted)
|
||||
.ObservesProperty(() => FlightSimData.IsEnteredFlight);
|
||||
.ObservesProperty(() => FlightSimData.IsInCockpit);
|
||||
|
||||
SaveAutoPanningCameraCommand = new DelegateCommand(OnSaveAutoPanningCamera, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight)
|
||||
SaveAutoPanningCameraCommand = new DelegateCommand(OnSaveAutoPanningCamera, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
|
||||
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
|
||||
.ObservesProperty(() => FlightSimData.IsSimulatorStarted)
|
||||
.ObservesProperty(() => FlightSimData.IsEnteredFlight);
|
||||
.ObservesProperty(() => FlightSimData.IsInCockpit);
|
||||
|
||||
EditPanelSourceCommand = new DelegateCommand(EditPanelSource, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsEnteredFlight)
|
||||
EditPanelSourceCommand = new DelegateCommand(EditPanelSource, () => FlightSimData.HasCurrentMsfsAircraft && ProfileData.HasActiveProfile && ProfileData.ActiveProfile.PanelSourceCoordinates.Count > 0 && FlightSimData.IsSimulatorStarted && FlightSimData.IsInCockpit)
|
||||
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile)
|
||||
.ObservesProperty(() => ProfileData.ActiveProfile.PanelSourceCoordinates.Count)
|
||||
.ObservesProperty(() => FlightSimData.IsSimulatorStarted)
|
||||
.ObservesProperty(() => FlightSimData.IsEnteredFlight);
|
||||
.ObservesProperty(() => FlightSimData.IsInCockpit);
|
||||
|
||||
OpenTouchPanelBindingCommand = new DelegateCommand(OnOpenTouchPanelBinding, () => FlightSimData.HasCurrentMsfsAircraft && FlightSimData.IsSimulatorStarted && ProfileData.HasActiveProfile && AppSettingData.AppSetting.TouchPanelSettings.EnableTouchPanelIntegration)
|
||||
.ObservesProperty(() => FlightSimData.HasCurrentMsfsAircraft)
|
||||
|
|
|
@ -26,7 +26,10 @@ how to use these new keyboard shortcuts.
|
|||
so big and they block most of the game window for lower resolution screen and prevented Pop
|
||||
Out Panel Manager from popping out the next panel.
|
||||
|
||||
* Made improvement to how panels are separated when using multiple monitors.
|
||||
* Made improvements to how panels are separated during pop out process.
|
||||
|
||||
* Fixed an issue when adjusting position and size of a pop out, it may not work correctly
|
||||
on some PC configuration.
|
||||
|
||||
Known issue:
|
||||
|
||||
|
|
Loading…
Reference in a new issue