mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
[FG] Do not send modelstring or a shorter livery string for FG
* FG does not support modelstrings for "flyable" planes * remove unused setSimInfo functions, consolidated, cleanup * simulator dependent "getSwiftLiveryString" * encapsulated in getConfiguredLiveryString, getConfiguredModelString * see https://discordapp.com/channels/539048679160676382/567091362030419981/698124094482415616
This commit is contained in:
committed by
Mat Sutcliffe
parent
90e77ac9f1
commit
92d53a4077
@@ -586,16 +586,24 @@ namespace BlackMisc
|
||||
return (liveryString.length() > liveryStringPrefix().length() && liveryString.startsWith(liveryStringPrefix(), Qt::CaseInsensitive));
|
||||
}
|
||||
|
||||
QString CAircraftModel::getSwiftLiveryString() const
|
||||
QString CAircraftModel::getSwiftLiveryString(bool aircraftIcao, bool livery, bool model) const
|
||||
{
|
||||
if (!aircraftIcao && !livery && !model) { return QString(); }
|
||||
const QString l =
|
||||
(this->getLivery().hasValidDbKey() ? u'l' % this->getLivery().getDbKeyAsString() : QString()) %
|
||||
(this->getAircraftIcaoCode().hasValidDbKey() ? QStringLiteral("a") % this->getAircraftIcaoCode().getDbKeyAsString() : QString()) %
|
||||
(this->hasValidDbKey() ? u'm' % this->getDbKeyAsString() : QString());
|
||||
(livery && this->getLivery().hasValidDbKey() ? u'l' % this->getLivery().getDbKeyAsString() : QString()) %
|
||||
(aircraftIcao && this->getAircraftIcaoCode().hasValidDbKey() ? QStringLiteral("a") % this->getAircraftIcaoCode().getDbKeyAsString() : QString()) %
|
||||
(model && this->hasValidDbKey() ? u'm' % this->getDbKeyAsString() : QString());
|
||||
|
||||
return l.isEmpty() ? QString() : liveryStringPrefix() % l;
|
||||
}
|
||||
|
||||
QString CAircraftModel::getSwiftLiveryString(const CSimulatorInfo &sim) const
|
||||
{
|
||||
return (sim.isFG()) ?
|
||||
this->getSwiftLiveryString(true, false, false) :
|
||||
this->getSwiftLiveryString();
|
||||
}
|
||||
|
||||
DBTripleIds CAircraftModel::parseNetworkLiveryString(const QString &liveryString)
|
||||
{
|
||||
// "swift_m22l33a11"
|
||||
|
||||
@@ -367,7 +367,10 @@ namespace BlackMisc
|
||||
|
||||
//! swift livery string (to be sent via network)
|
||||
//! \sa parseNetworkLiveryString
|
||||
QString getSwiftLiveryString() const;
|
||||
QString getSwiftLiveryString(bool aircraftIcao = true, bool livery = true, bool model = true) const;
|
||||
|
||||
//! swift livery string (to be sent via network) for simulator
|
||||
QString getSwiftLiveryString(const CSimulatorInfo &sim) const;
|
||||
|
||||
//! Update missing parts from another model
|
||||
void updateMissingParts(const CAircraftModel &otherModel, bool dbModelPriority = true);
|
||||
|
||||
@@ -43,7 +43,10 @@ namespace BlackMisc
|
||||
// set info if it wasn't set already
|
||||
if (m_info.isNoSimulator() && !m_simulator.isEmpty())
|
||||
{
|
||||
m_info = CSimulatorInfo(m_simulator);
|
||||
if (!this->isEmulatedPlugin())
|
||||
{
|
||||
m_info = CSimulatorInfo(m_simulator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user