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:
parent
9304bcc9af
commit
0a6fe33bc3
1 changed files with 21 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue