bool
fgPanelVisible ()
{
- if (globals->get_current_panel() == 0)
+ const FGPanel* current = globals->get_current_panel();
+ if (current == 0)
return false;
- if (globals->get_current_panel()->getVisibility() == 0)
+ if (current->getVisibility() == 0)
return false;
if (globals->get_viewmgr()->get_current() != 0)
return false;
- if (globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0)
+ if (current->getAutohide() && globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0)
return false;
return true;
}
-
\f
////////////////////////////////////////////////////////////////////////
// Implementation of FGTextureManager.
virtual void setDepthTest (bool enable);
+ bool getAutohide(void) const { return _autohide; };
+ void setAutohide(bool enable) { _autohide = enable; };
+
private:
void setupVirtualCockpit();
void cleanupVirtualCockpit();
// List of instruments in panel.
instrument_list_type _instruments;
bool _enable_depth_test;
+ bool _autohide;
};
if (!fgHasNode("/sim/panel/y-offset"))
fgSetInt("/sim/panel/y-offset", root->getIntValue("y-offset", 0));
+ panel->setAutohide(root->getBoolValue("autohide", true));
+
//
// Assign the background texture, if any, or a bogus chequerboard.
//