Add an autohide property for the 2D panel.
Author:Csaba Halasz
This commit is contained in:
parent
7f546e94d3
commit
474df2414e
3 changed files with 10 additions and 4 deletions
src/Cockpit
|
@ -98,18 +98,18 @@ get_aspect_adjust (int xsize, int ysize)
|
||||||
bool
|
bool
|
||||||
fgPanelVisible ()
|
fgPanelVisible ()
|
||||||
{
|
{
|
||||||
if (globals->get_current_panel() == 0)
|
const FGPanel* current = globals->get_current_panel();
|
||||||
|
if (current == 0)
|
||||||
return false;
|
return false;
|
||||||
if (globals->get_current_panel()->getVisibility() == 0)
|
if (current->getVisibility() == 0)
|
||||||
return false;
|
return false;
|
||||||
if (globals->get_viewmgr()->get_current() != 0)
|
if (globals->get_viewmgr()->get_current() != 0)
|
||||||
return false;
|
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 false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Implementation of FGTextureManager.
|
// Implementation of FGTextureManager.
|
||||||
|
|
|
@ -191,6 +191,9 @@ public:
|
||||||
|
|
||||||
virtual void setDepthTest (bool enable);
|
virtual void setDepthTest (bool enable);
|
||||||
|
|
||||||
|
bool getAutohide(void) const { return _autohide; };
|
||||||
|
void setAutohide(bool enable) { _autohide = enable; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupVirtualCockpit();
|
void setupVirtualCockpit();
|
||||||
void cleanupVirtualCockpit();
|
void cleanupVirtualCockpit();
|
||||||
|
@ -218,6 +221,7 @@ private:
|
||||||
// List of instruments in panel.
|
// List of instruments in panel.
|
||||||
instrument_list_type _instruments;
|
instrument_list_type _instruments;
|
||||||
bool _enable_depth_test;
|
bool _enable_depth_test;
|
||||||
|
bool _autohide;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -680,6 +680,8 @@ readPanel (const SGPropertyNode * root)
|
||||||
if (!fgHasNode("/sim/panel/y-offset"))
|
if (!fgHasNode("/sim/panel/y-offset"))
|
||||||
fgSetInt("/sim/panel/y-offset", root->getIntValue("y-offset", 0));
|
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.
|
// Assign the background texture, if any, or a bogus chequerboard.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue