Permit to force hiding GUI windows

actorid
Emanuel Guevel 12 years ago
parent df9d681a63
commit d054366460

@ -105,6 +105,9 @@ namespace MWBase
virtual void toggleVisible (MWGui::GuiWindow wnd) = 0;
virtual void forceHide(MWGui::GuiWindow wnd) = 0;
virtual void unsetForceHide(MWGui::GuiWindow wnd) = 0;
/// Disallow all inventory mode windows
virtual void disallowAll() = 0;

@ -105,6 +105,7 @@ namespace MWGui
, mGui(NULL)
, mGarbageDialogs()
, mShown(GW_ALL)
, mForceHidden(GW_None)
, mAllowed(GW_ALL)
, mRestAllowed(true)
, mShowFPSLevel(fpsLevel)
@ -435,7 +436,7 @@ namespace MWGui
// This is controlled both by what windows the
// user has opened/closed (the 'shown' variable) and by what
// windows we are allowed to show (the 'allowed' var.)
int eff = mShown & mAllowed;
int eff = mShown & mAllowed & ~mForceHidden;
// Show the windows we want
mMap ->setVisible(eff & GW_Map);
@ -1117,7 +1118,19 @@ namespace MWGui
void WindowManager::toggleVisible (GuiWindow wnd)
{
mShown = (mShown & wnd) ? (GuiWindow) (mShown & ~wnd) : (GuiWindow) (mShown | wnd);
mShown = (GuiWindow)(mShown ^ wnd);
updateVisible();
}
void WindowManager::forceHide(GuiWindow wnd)
{
mForceHidden = (GuiWindow)(mForceHidden | wnd);
updateVisible();
}
void WindowManager::unsetForceHide(GuiWindow wnd)
{
mForceHidden = (GuiWindow)(mForceHidden & ~wnd);
updateVisible();
}

@ -115,6 +115,9 @@ namespace MWGui
virtual void toggleVisible(GuiWindow wnd);
virtual void forceHide(MWGui::GuiWindow wnd);
virtual void unsetForceHide(MWGui::GuiWindow wnd);
// Disallow all inventory mode windows
virtual void disallowAll();
@ -334,6 +337,7 @@ namespace MWGui
void cleanupGarbage();
GuiWindow mShown; // Currently shown windows in inventory mode
GuiWindow mForceHidden; // Hidden windows (overrides mShown)
/* Currently ALLOWED windows in inventory mode. This is used at
the start of the game, when windows are enabled one by one

Loading…
Cancel
Save