From f48e4887f609570c3ee2bd91218e450bff14f8b4 Mon Sep 17 00:00:00 2001 From: tzobler Date: Thu, 15 Jan 2026 21:04:58 +0100 Subject: [PATCH] fix: Model set becomes active after the first start --- src/core/aircraftmatcher.cpp | 5 ++++- src/core/context/contextsimulatorimpl.cpp | 2 +- .../msfs2024/simulatormsfs2024common.cpp | 15 ++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/core/aircraftmatcher.cpp b/src/core/aircraftmatcher.cpp index c9a28fc57..db83c505a 100644 --- a/src/core/aircraftmatcher.cpp +++ b/src/core/aircraftmatcher.cpp @@ -1657,7 +1657,10 @@ namespace swift::core if (modelsCleaned.isEmpty()) { // error to force popup - CLogMessage(this).error(u"No models for matching ('%1'), swift without a model set will not work!") + // TODO TZ extend commend + CLogMessage(this).error( + u"No models for matching ('%1'), swift without a model set will not work! Note: If you are using " + u"MSFS2024 and starting the GUI for the first time, it may take some time for the model set to load.") << simulator.toQString(); } else if (!duplicateModels.isEmpty()) diff --git a/src/core/context/contextsimulatorimpl.cpp b/src/core/context/contextsimulatorimpl.cpp index 4b5506656..d1b172208 100644 --- a/src/core/context/contextsimulatorimpl.cpp +++ b/src/core/context/contextsimulatorimpl.cpp @@ -241,7 +241,7 @@ namespace swift::core::context { Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator"); if (isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } - if (this->isSimulatorAvailable()) { return; } // if a plugin is loaded, do ignore this + if (this->isSimulatorAvailable() && !simulator.isMSFS2024()) return; // if a plugin is loaded, do ignore this m_modelSetSimulator.set(simulator); const CAircraftModelList models = this->getModelSet(); // cache synced m_aircraftMatcher.setModelSet(models, simulator, false); diff --git a/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp b/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp index e7de387ac..6e4a0db39 100644 --- a/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp +++ b/src/plugins/simulator/msfs2024/simulatormsfs2024common.cpp @@ -19,6 +19,7 @@ #include "config/buildconfig.h" #include "core/application.h" +#include "core/context/contextsimulator.h" #include "core/modelsetbuilder.h" #include "core/webdataservices.h" #include "core/webdataservicesms.h" @@ -47,6 +48,7 @@ #include "misc/worker.h" using namespace swift::config; +using namespace swift::core::context; using namespace swift::misc; using namespace swift::misc::aviation; using namespace swift::misc::physical_quantities; @@ -538,25 +540,16 @@ namespace swift::simplugin::msfs2024common currentSet = CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().getCachedModels(simulator); NewSet = builder.buildModelSet(simulator, newModelList, currentSet, options, distributorList); - - CAircraftMatcher matcher; - swift::misc::simulation::CAircraftMatcherSetup mSetup = matcher.getSetup(); - NewSet.setSimulatorInfo(simulator); - matcher.setModelSet(NewSet, m_simulatorInfo, true); - - const QDateTime latestDbModelsTs = - NewSet.isEmpty() ? sApp->getWebDataServices()->getCacheTimestamp(CEntityFlags::ModelEntity) : - NewSet.latestTimestamp(); - if (!latestDbModelsTs.isValid()) { return; } // for swiftgui it is enough to set the cache here if (gui_application) CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().setModelsForSimulator(NewSet, simulator); - CCentralMultiSimulatorModelCachesProvider::modelCachesInstance().setCachedModels(NewSet, simulator); + sGui->getIContextSimulator()->setModelSetLoaderSimulator(simulator); + const CStatusMessage m = CStatusMessage(this, CStatusMessage::SeverityInfo, u"Loading SimObjects and Liveries from the Simulator completed");