mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #393, allow to highlight a certain aircraft by blinking
* signatures in contexts * some specialized functions in aircraft list * context menus in aircraft view * default "blinking" implementation in driver common base class
This commit is contained in:
@@ -85,7 +85,7 @@ namespace BlackSimPlugin
|
||||
CAircraftSituation situation = this->m_interpolator->getInterpolatedSituation(m_callsign, -1, status);
|
||||
|
||||
// Test only for successful interpolation. FS9 requires constant positions
|
||||
if (!status.interpolationSucceeded) return;
|
||||
if (!status.interpolationSucceeded) { return; }
|
||||
|
||||
sendMultiplayerPosition(situation);
|
||||
sendMultiplayerParamaters();
|
||||
|
||||
@@ -134,11 +134,20 @@ namespace BlackSimPlugin
|
||||
auto fs9Client = m_hashFs9Clients.value(callsign);
|
||||
fs9Client->quit();
|
||||
m_hashFs9Clients.remove(callsign);
|
||||
remoteAircraft().applyIfCallsign(callsign, CPropertyIndexVariantMap(CSimulatedAircraft::IndexRendered, CVariant::fromValue(false)));
|
||||
remoteAircraft().setRendered(callsign, false);
|
||||
CLogMessage(this).info("FS9: Removed aircraft %1") << callsign.toQString();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSimulatorFs9::removeAllRemoteAircraft()
|
||||
{
|
||||
QList<CCallsign> callsigns(this->m_hashFs9Clients.keys());
|
||||
for (const CCallsign &cs : callsigns)
|
||||
{
|
||||
removeRemoteAircraft(cs);
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft, const QString &originator)
|
||||
{
|
||||
if (originator == this->simulatorOriginator()) { return false; }
|
||||
@@ -204,8 +213,14 @@ namespace BlackSimPlugin
|
||||
this->displayStatusMessage(message.asStatusMessage(true, true));
|
||||
}
|
||||
|
||||
void CSimulatorFs9::timerEvent(QTimerEvent * /* event */)
|
||||
bool CSimulatorFs9::isRenderedAircraft(const CCallsign &callsign) const
|
||||
{
|
||||
return m_hashFs9Clients.contains(callsign);
|
||||
}
|
||||
|
||||
void CSimulatorFs9::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
ps_dispatch();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ namespace BlackSimPlugin
|
||||
public:
|
||||
//! \copydoc BlackCore::ISimulatorFactory::create(ownAircraftProvider, remoteAircraftProvider, parent)
|
||||
virtual BlackCore::ISimulator *create(
|
||||
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
QObject *parent) override;
|
||||
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
QObject *parent) override;
|
||||
|
||||
//! Simulator info
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override;
|
||||
@@ -91,6 +91,9 @@ namespace BlackSimPlugin
|
||||
//! \copydoc ISimulator::removeRemoteAircraft()
|
||||
virtual bool removeRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::removeAllRemoteAircraft
|
||||
virtual void removeAllRemoteAircraft() override;
|
||||
|
||||
//! \copydoc ISimulator::updateOwnSimulatorCockpit()
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Aviation::CAircraft &ownAircraft, const QString &originator) override;
|
||||
|
||||
@@ -100,6 +103,9 @@ namespace BlackSimPlugin
|
||||
//! \copydoc ISimulator::displayTextMessage()
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
|
||||
//! \copydoc ISimulator::isRenderedAircraft
|
||||
virtual bool isRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
|
||||
protected:
|
||||
//! Timer event
|
||||
virtual void timerEvent(QTimerEvent *event);
|
||||
@@ -124,12 +130,10 @@ namespace BlackSimPlugin
|
||||
|
||||
// DirectPlay object handling
|
||||
QPointer<CFs9Host> m_fs9Host;
|
||||
bool m_isHosting = false; //!< Is sim connected
|
||||
bool m_isHosting = false; //!< Is sim connected?
|
||||
bool m_startedLobbyConnection = false;
|
||||
QHash<BlackMisc::Aviation::CCallsign, QPointer<CFs9Client>> m_hashFs9Clients;
|
||||
CLobbyClient *m_lobbyClient;
|
||||
|
||||
BlackCore::IInterpolator *m_interpolator = nullptr; //!< interpolator instance
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user