Launcher: Fix helipad selection
This commit is contained in:
parent
f3a1c10b24
commit
4395f96b13
4 changed files with 22 additions and 9 deletions
|
@ -411,7 +411,9 @@ void LauncherController::updateSelectedAircraft()
|
|||
m_selectedAircraftInfo->setUri(m_selectedAircraft);
|
||||
QModelIndex index = m_aircraftModel->indexOfAircraftURI(m_selectedAircraft);
|
||||
if (index.isValid()) {
|
||||
m_aircraftType = Airplane;
|
||||
// we have to default to unknown here, until we have an explicit
|
||||
// way to determine if it's a regular aircraft or not
|
||||
m_aircraftType = Unknown;
|
||||
if (index.data(AircraftIsHelicopterRole).toBool()) {
|
||||
m_aircraftType = Helicopter;
|
||||
} else if (index.data(AircraftIsSeaplaneRole).toBool()) {
|
||||
|
|
|
@ -158,7 +158,8 @@ public:
|
|||
|
||||
enum AircraftType
|
||||
{
|
||||
Airplane = 0,
|
||||
Unknown = 0,
|
||||
Airplane,
|
||||
Seaplane,
|
||||
Helicopter,
|
||||
Airship
|
||||
|
|
|
@ -115,14 +115,23 @@ public:
|
|||
addType(FGPositioned::NDB);
|
||||
}
|
||||
|
||||
if (aircraft == LauncherController::Helicopter) {
|
||||
addType(FGPositioned::HELIPAD);
|
||||
}
|
||||
|
||||
if (aircraft == LauncherController::Seaplane) {
|
||||
addType(FGPositioned::SEAPORT);
|
||||
} else {
|
||||
addType(FGPositioned::AIRPORT);
|
||||
|
||||
switch (aircraft) {
|
||||
case LauncherController::Airplane:
|
||||
break;
|
||||
|
||||
case LauncherController::Helicopter:
|
||||
addType(FGPositioned::HELIPORT);
|
||||
break;
|
||||
|
||||
case LauncherController::Seaplane:
|
||||
addType(FGPositioned::SEAPORT);
|
||||
break;
|
||||
|
||||
default:
|
||||
addType(FGPositioned::HELIPORT);
|
||||
addType(FGPositioned::SEAPORT);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
|
||||
enum AircraftType
|
||||
{
|
||||
Unknown = LauncherController::Unknown,
|
||||
Airplane = LauncherController::Airplane,
|
||||
Seaplane = LauncherController::Seaplane,
|
||||
Helicopter = LauncherController::Helicopter,
|
||||
|
@ -62,7 +63,7 @@ public:
|
|||
|
||||
Q_ENUMS(AircraftType)
|
||||
|
||||
Q_INVOKABLE void setSearch(QString t, AircraftType aircraft);
|
||||
Q_INVOKABLE void setSearch(QString t, AircraftType aircraft = Unknown);
|
||||
|
||||
Q_INVOKABLE void clear();
|
||||
|
||||
|
|
Loading…
Reference in a new issue