|
|
|
@ -445,7 +445,6 @@ namespace MWGui
|
|
|
|
|
mConsole = new Console(w,h, mConsoleOnlyScripts);
|
|
|
|
|
mWindows.push_back(mConsole);
|
|
|
|
|
trackWindow(mConsole, "console");
|
|
|
|
|
mGuiModeStates[GM_Console] = GuiModeState(mConsole);
|
|
|
|
|
|
|
|
|
|
bool questList = mResourceSystem->getVFS()->exists("textures/tx_menubook_options_over.dds");
|
|
|
|
|
JournalWindow* journal = JournalWindow::create(JournalViewModel::create (), questList, mEncoding);
|
|
|
|
@ -711,10 +710,10 @@ namespace MWGui
|
|
|
|
|
// If in game mode (or interactive messagebox), show the pinned windows
|
|
|
|
|
if (mGuiModes.empty())
|
|
|
|
|
{
|
|
|
|
|
mMap->setVisible(mMap->pinned() && !(mForceHidden & GW_Map) && (mAllowed & GW_Map));
|
|
|
|
|
mStatsWindow->setVisible(mStatsWindow->pinned() && !(mForceHidden & GW_Stats) && (mAllowed & GW_Stats));
|
|
|
|
|
mInventoryWindow->setVisible(mInventoryWindow->pinned() && !(mForceHidden & GW_Inventory) && (mAllowed & GW_Inventory));
|
|
|
|
|
mSpellWindow->setVisible(mSpellWindow->pinned() && !(mForceHidden & GW_Magic) && (mAllowed & GW_Magic));
|
|
|
|
|
mMap->setVisible(mMap->pinned() && !isConsoleMode() && !(mForceHidden & GW_Map) && (mAllowed & GW_Map));
|
|
|
|
|
mStatsWindow->setVisible(mStatsWindow->pinned() && !isConsoleMode() && !(mForceHidden & GW_Stats) && (mAllowed & GW_Stats));
|
|
|
|
|
mInventoryWindow->setVisible(mInventoryWindow->pinned() && !isConsoleMode() && !(mForceHidden & GW_Inventory) && (mAllowed & GW_Inventory));
|
|
|
|
|
mSpellWindow->setVisible(mSpellWindow->pinned() && !isConsoleMode() && !(mForceHidden & GW_Magic) && (mAllowed & GW_Magic));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (getMode() != GM_Inventory)
|
|
|
|
@ -1320,6 +1319,10 @@ namespace MWGui
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateVisible();
|
|
|
|
|
|
|
|
|
|
// To make sure that console window get focus again
|
|
|
|
|
if (mConsole && mConsole->isVisible())
|
|
|
|
|
mConsole->onOpen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::removeGuiMode(GuiMode mode, bool noSound)
|
|
|
|
@ -1529,14 +1532,15 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
bool WindowManager::isGuiMode() const
|
|
|
|
|
{
|
|
|
|
|
return !mGuiModes.empty() || (mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox());
|
|
|
|
|
return
|
|
|
|
|
!mGuiModes.empty() ||
|
|
|
|
|
isConsoleMode() ||
|
|
|
|
|
(mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool WindowManager::isConsoleMode() const
|
|
|
|
|
{
|
|
|
|
|
if (!mGuiModes.empty() && mGuiModes.back()==GM_Console)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
return mConsole && mConsole->isVisible();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MWGui::GuiMode WindowManager::getMode() const
|
|
|
|
@ -1836,6 +1840,7 @@ namespace MWGui
|
|
|
|
|
bool WindowManager::isSavingAllowed() const
|
|
|
|
|
{
|
|
|
|
|
return !MyGUI::InputManager::getInstance().isModalAny()
|
|
|
|
|
&& !isConsoleMode()
|
|
|
|
|
// TODO: remove this, once we have properly serialized the state of open windows
|
|
|
|
|
&& (!isGuiMode() || (mGuiModes.size() == 1 && (getMode() == GM_MainMenu || getMode() == GM_Rest)));
|
|
|
|
|
}
|
|
|
|
@ -2083,6 +2088,21 @@ namespace MWGui
|
|
|
|
|
SDL_free(text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::toggleConsole()
|
|
|
|
|
{
|
|
|
|
|
bool visible = mConsole->isVisible();
|
|
|
|
|
|
|
|
|
|
if (!visible && !mGuiModes.empty())
|
|
|
|
|
mKeyboardNavigation->saveFocus(mGuiModes.back());
|
|
|
|
|
|
|
|
|
|
mConsole->setVisible(!visible);
|
|
|
|
|
|
|
|
|
|
if (visible && !mGuiModes.empty())
|
|
|
|
|
mKeyboardNavigation->restoreFocus(mGuiModes.back());
|
|
|
|
|
|
|
|
|
|
updateVisible();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WindowManager::toggleDebugWindow()
|
|
|
|
|
{
|
|
|
|
|
mDebugWindow->setVisible(!mDebugWindow->isVisible());
|
|
|
|
|