1
0
Fork 0

Add an autohide property for the 2D panel.

Author:Csaba Halasz
This commit is contained in:
timoore 2007-09-09 23:21:20 +00:00
parent 7f546e94d3
commit 474df2414e
3 changed files with 10 additions and 4 deletions

View file

@ -98,18 +98,18 @@ get_aspect_adjust (int xsize, int ysize)
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;
}
////////////////////////////////////////////////////////////////////////
// Implementation of FGTextureManager.

View file

@ -191,6 +191,9 @@ public:
virtual void setDepthTest (bool enable);
bool getAutohide(void) const { return _autohide; };
void setAutohide(bool enable) { _autohide = enable; };
private:
void setupVirtualCockpit();
void cleanupVirtualCockpit();
@ -218,6 +221,7 @@ private:
// List of instruments in panel.
instrument_list_type _instruments;
bool _enable_depth_test;
bool _autohide;
};

View file

@ -680,6 +680,8 @@ readPanel (const SGPropertyNode * root)
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.
//