mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
feat: Add MSFS support
Co-Authored-By: Roland Rossgotterer <roland.rossgotterer@gmail.com> Co-Authored-By: tzobler <tzobler@t-online.de>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
using namespace swift::misc;
|
||||
using namespace swift::misc::aviation;
|
||||
using namespace swift::misc::simulation;
|
||||
using namespace swift::simplugin::fscommon;
|
||||
|
||||
namespace swift::simplugin::fsxcommon
|
||||
@@ -69,7 +70,7 @@ namespace swift::simplugin::fsxcommon
|
||||
|
||||
CSimConnectDefinitions::CSimConnectDefinitions() {}
|
||||
|
||||
HRESULT CSimConnectDefinitions::initDataDefinitionsWhenConnected(const HANDLE hSimConnect)
|
||||
HRESULT CSimConnectDefinitions::initDataDefinitionsWhenConnected(const HANDLE hSimConnect, const CSimulatorInfo &simInfo)
|
||||
{
|
||||
HRESULT hr = s_ok();
|
||||
hr += initOwnAircraft(hSimConnect);
|
||||
@@ -78,6 +79,10 @@ namespace swift::simplugin::fsxcommon
|
||||
hr += initRemoteAircraftSimDataSet(hSimConnect);
|
||||
hr += initSimulatorEnvironment(hSimConnect);
|
||||
hr += initSbDataArea(hSimConnect);
|
||||
if (simInfo.isMSFS())
|
||||
{
|
||||
hr += initMSFSTransponder(hSimConnect);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -289,6 +294,18 @@ namespace swift::simplugin::fsxcommon
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT CSimConnectDefinitions::initMSFSTransponder(const HANDLE hSimConnect)
|
||||
{
|
||||
HRESULT hr = s_ok();
|
||||
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, "TRANSPONDER STATE:1", "Enum");
|
||||
hr += SimConnect_AddToDataDefinition(hSimConnect, CSimConnectDefinitions::DataTransponderModeMSFS, "TRANSPONDER IDENT:1", "Bool");
|
||||
if (isFailure(hr))
|
||||
{
|
||||
CLogMessage(static_cast<CSimConnectDefinitions *>(nullptr)).error(u"SimConnect error: MSFS transponder data definitions %1") << hr;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
DataDefinitionRemoteAircraftPartsWithoutLights::DataDefinitionRemoteAircraftPartsWithoutLights()
|
||||
{
|
||||
this->resetToInvalid();
|
||||
|
||||
Reference in New Issue
Block a user