From a87175446c084e305af382290a7593aa9cee5c6c Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 21 Jul 2010 10:28:58 +0200 Subject: [PATCH] disable windows on startup when --new-game is used --- apps/openmw/engine.cpp | 2 +- apps/openmw/mwgui/window_manager.cpp | 4 ++-- apps/openmw/mwgui/window_manager.hpp | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 2a93561fe..51d1f79b2 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -209,7 +209,7 @@ void OMW::Engine::go() MWScript::registerExtensions (mExtensions); mEnvironment.mWindowManager = new MWGui::WindowManager(mGuiManager->getGui(), mEnvironment, - mExtensions); + mExtensions, mNewGame); mEnvironment.mSoundManager = new MWSound::SoundManager; diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index e83e09650..1cd70ec08 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -8,8 +8,8 @@ using namespace MWGui; WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, - const Compiler::Extensions& extensions) - : gui(_gui), mode(GM_Game), shown(GW_ALL), allowed(GW_ALL) + const Compiler::Extensions& extensions, bool newGame) + : gui(_gui), mode(GM_Game), shown(GW_ALL), allowed(newGame ? GW_None : GW_ALL) { // Get size info from the Gui object assert(gui); diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index 2246dbd9f..24021a6c6 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -102,11 +102,14 @@ namespace MWGui public: /// The constructor needs the main Gui object WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, - const Compiler::Extensions& extensions); + const Compiler::Extensions& extensions, bool newGame); virtual ~WindowManager(); void setMode(GuiMode newMode) { + if (newMode==GM_Inventory && allowed==GW_None) + return; + mode = newMode; updateVisible(); }