From 7a4b6043763598b8dc25d7b3e33555f792c6dc9e Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 16 Nov 2013 11:33:20 +0100 Subject: [PATCH] added --skip-menu switch --- apps/openmw/engine.cpp | 10 ++++++++++ apps/openmw/engine.hpp | 3 +++ apps/openmw/main.cpp | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index d11e72f75..47cd01a80 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -139,6 +139,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager) , mFpsLevel(0) , mVerboseScripts (false) , mNewGame (false) + , mSkipMenu (false) , mUseSound (true) , mCompileAll (false) , mScriptContext (0) @@ -282,6 +283,11 @@ void OMW::Engine::setNewGame(bool newGame) mNewGame = newGame; } +void OMW::Engine::setSkipMenu (bool skipMenu) +{ + mSkipMenu = skipMenu; +} + std::string OMW::Engine::loadSettings (Settings::Manager & settings) { // Create the settings manager and load default settings file @@ -486,6 +492,10 @@ void OMW::Engine::go() if (!mStartupScript.empty()) MWBase::Environment::get().getWindowManager()->executeInConsole (mStartupScript); + // start in main menu + if (!mSkipMenu) + MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); + // Start the main rendering loop while (!mEnvironment.get().getStateManager()->hasQuitRequest()) Ogre::Root::getSingleton().renderOneFrame(); diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp index 553d29068..72d2041b8 100644 --- a/apps/openmw/engine.hpp +++ b/apps/openmw/engine.hpp @@ -72,6 +72,7 @@ namespace OMW int mFpsLevel; bool mVerboseScripts; bool mNewGame; + bool mSkipMenu; bool mUseSound; bool mCompileAll; std::string mFocusName; @@ -152,6 +153,8 @@ namespace OMW /// Start as a new game. void setNewGame(bool newGame); + void setSkipMenu (bool skipMenu); + /// Initialise and enter main loop. void go(); diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 33f740b31..8c6bdf8a6 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -134,6 +134,9 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat ("new-game", bpo::value()->implicit_value(true) ->default_value(false), "activate char gen/new game mechanics") + ("skip-menu", bpo::value()->implicit_value(true) + ->default_value(false), "skip main menu on game startup") + ("fs-strict", bpo::value()->implicit_value(true) ->default_value(false), "strict file system handling (no case folding)") @@ -223,6 +226,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat // startup-settings engine.setCell(variables["start"].as()); engine.setNewGame(variables["new-game"].as()); + engine.setSkipMenu (variables["skip-menu"].as()); // other settings engine.setSoundUsage(!variables["nosound"].as());