From 1d6b6d97537605202632379a9317c6b97c8944da Mon Sep 17 00:00:00 2001 From: Stuart Buchanan <stuart_d_buchanan@yahoo.co.uk> Date: Sat, 18 Apr 2020 18:07:25 +0100 Subject: [PATCH] Add carrier parking positions to property tree This adds the names of the available parking positions/catapults to the property tree, so we can build a suitable in-sim list of parking positions for users to select from. --- src/AIModel/AICarrier.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AIModel/AICarrier.cxx b/src/AIModel/AICarrier.cxx index e50065adb..e6f6dea52 100644 --- a/src/AIModel/AICarrier.cxx +++ b/src/AIModel/AICarrier.cxx @@ -323,6 +323,12 @@ void FGAICarrier::bind() { props->setStringValue("sign", sign.c_str()); props->setBoolValue("controls/lighting/deck-lights", false); props->setDoubleValue("controls/lighting/flood-lights-red-norm", 0); + + // Write out a list of the parking positions - useful for the UI to select + // from + for (const auto& ppos : ppositions) { + if (ppos.name != "") props->addChild("parking-pos")->setStringValue("name", ppos.name); + } } bool FGAICarrier::getParkPosition(const string& id, SGGeod& geodPos,