From 59a7d50fb169f30bb8d6119c06069aab086ab107 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 1 Sep 2019 23:42:55 +0100 Subject: [PATCH] src/Main/fg_init.cxx: add support for auto-generated tooltips on animations. Results in tooltips for instrument needles, and control surfaces. Enabled with /sim/rendering/automatic-animation-tooltips/enabled. The max number of auto-created tooltips can be specified in /sim/rendering/automatic-animation-tooltips/max-count (too many can cause problems, e.g. on 777 i had to set max to 45). src/Model/acmodel.cxx:fgLoad3DModelPanel(): pass new property values to simgear::SGModelLib::loadModel(), so we can have auto-created tooltips for animations in the user's aircraft. [This all requires matching changes to simgear.] --- src/Model/acmodel.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Model/acmodel.cxx b/src/Model/acmodel.cxx index cba7d0ffe..462251899 100644 --- a/src/Model/acmodel.cxx +++ b/src/Model/acmodel.cxx @@ -32,12 +32,18 @@ static osg::Node * fgLoad3DModelPanel(const SGPath &path, SGPropertyNode *prop_root) { bool loadPanels = true; - osg::Node* node = simgear::SGModelLib::loadModel(path.utf8Str(), prop_root, NULL, loadPanels); + bool autoTooltipsMaster = fgGetBool("/sim/rendering/automatic-animation-tooltips/enabled"); + int autoTooltipsMasterMax = fgGetInt("/sim/rendering/automatic-animation-tooltips/max-count"); + SG_LOG(SG_INPUT, SG_DEBUG, "" + << " autoTooltipsMaster=" << autoTooltipsMaster + << " autoTooltipsMasterMax=" << autoTooltipsMasterMax + ); + osg::Node* node = simgear::SGModelLib::loadModel(path.utf8Str(), prop_root, NULL, loadPanels, autoTooltipsMaster, autoTooltipsMasterMax); if (node) node->setNodeMask(~SG_NODEMASK_TERRAIN_BIT); return node; } - + //////////////////////////////////////////////////////////////////////// // Implementation of FGAircraftModel ////////////////////////////////////////////////////////////////////////