Change the way pinnable window are made visible

This ensure pinned window are not displayed in main menu, dialogue and
container mode.
actorid
Emanuel Guevel 12 years ago
parent 0713afb97d
commit 43d6392921

@ -11,16 +11,6 @@ WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::Win
t->eventWindowButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onWindowButtonPressed);
}
void WindowPinnableBase::setVisible(bool b)
{
// Pinned windows can not be hidden
if (mPinned && !b)
return;
WindowBase::setVisible(b);
mVisible = b;
}
void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName)
{
if ("PinToggle" == eventName)

@ -11,7 +11,6 @@ namespace MWGui
{
public:
WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
void setVisible(bool b);
bool pinned() { return mPinned; }
private:

@ -310,9 +310,16 @@ void WindowManager::updateVisible()
setSpellVisibility((mAllowed & GW_Magic) && !mSpellWindow->pinned());
setHMSVisibility((mAllowed & GW_Stats) && !mStatsWindow->pinned());
// If in game mode, don't show anything.
// If in game mode, show only the pinned windows
if (gameMode)
{
mMap->setVisible(mMap->pinned());
mStatsWindow->setVisible(mStatsWindow->pinned());
mInventoryWindow->setVisible(mInventoryWindow->pinned());
mSpellWindow->setVisible(mSpellWindow->pinned());
return;
}
GuiMode mode = mGuiModes.back();
@ -327,6 +334,12 @@ void WindowManager::updateVisible()
mSettingsWindow->setVisible(true);
break;
case GM_Console:
// Show the pinned windows
mMap->setVisible(mMap->pinned());
mStatsWindow->setVisible(mStatsWindow->pinned());
mInventoryWindow->setVisible(mInventoryWindow->pinned());
mSpellWindow->setVisible(mSpellWindow->pinned());
mConsole->enable();
break;
case GM_Scroll:

Loading…
Cancel
Save