1
0
Fork 0

Add support for compatible-fg-version in -set.xml

This is to evaluate if this is a good idea, not sure if we actually
want to commit to this approach yet.
This commit is contained in:
James Turner 2020-04-10 10:40:24 +01:00
parent 9304bcc9af
commit 0a6fe33bc3

View file

@ -389,7 +389,27 @@ private:
} else {
SG_LOG(SG_AIRCRAFT, SG_DEV_ALERT, "Aircraft does not specify a minimum FG version: please add one at /sim/minimum-fg-version");
}
auto compatNodes = globals->get_props()->getNode("/sim")->getChildren("compatible-fg-version");
if (!compatNodes.empty()) {
bool showCompatWarning = true;
// if we have at least one compatibility node, then it needs to match
for (const auto& cn : compatNodes) {
const auto v = cn->getStringValue();
if (simgear::strutils::compareVersionToWildcard(FLIGHTGEAR_VERSION, v)) {
showCompatWarning = false;
break;
}
}
if (showCompatWarning) {
flightgear::modalMessageBox("Aircraft not compatible with this version",
"The selected aircraft has not been checked for compatability with this version of FlightGear (" FLIGHTGEAR_VERSION "). "
"Some aircraft features might not work, or might be displayed incorrectly.");
}
}
return true;
}