Fixes for HUD, model-manager listeners.
Make the HUD listener recursive (its tree is quite shallow) and manually watch the children of /models/model[n] nodes when they are added.
This commit is contained in:
parent
b0fcd78e9f
commit
831053bd04
2 changed files with 6 additions and 0 deletions
|
@ -82,6 +82,7 @@ HUD::Input::Input(const SGPropertyNode *n, float factor, float offset,
|
|||
}
|
||||
|
||||
HUD::HUD() :
|
||||
SGPropertyChangeListener(true /* recursive */),
|
||||
_currentPath(fgGetNode("/sim/hud/current-path", true)),
|
||||
_currentColor(fgGetNode("/sim/hud/current-color", true)),
|
||||
_visibility(fgGetNode("/sim/hud/visibility[1]", true)),
|
||||
|
|
|
@ -267,6 +267,11 @@ FGModelMgr::Instance::~Instance ()
|
|||
void
|
||||
FGModelMgr::Listener::childAdded(SGPropertyNode * parent, SGPropertyNode * child)
|
||||
{
|
||||
if (!strcmp(parent->getName(), "models") && !strcmp(child->getName(), "model")) {
|
||||
child->addChangeListener(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(parent->getName(), "model") || strcmp(child->getName(), "load"))
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue