1
0
Fork 0

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.]
This commit is contained in:
Julian Smith 2019-09-01 23:42:55 +01:00
parent 5af966cfcc
commit 59a7d50fb1

View file

@ -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
////////////////////////////////////////////////////////////////////////