diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 2e5689fa8..147057cf1 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -182,6 +182,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager) , mGrab(true) , mScriptBlacklistUse (true) , mExportFonts(false) + , mNewGame (false) { std::srand ( std::time(NULL) ); MWClass::registerClasses(); @@ -264,9 +265,10 @@ void OMW::Engine::setScriptsVerbosity(bool scriptsVerbosity) mVerboseScripts = scriptsVerbosity; } -void OMW::Engine::setSkipMenu (bool skipMenu) +void OMW::Engine::setSkipMenu (bool skipMenu, bool newGame) { mSkipMenu = skipMenu; + mNewGame = newGame; } std::string OMW::Engine::loadSettings (Settings::Manager & settings) @@ -472,7 +474,7 @@ void OMW::Engine::go() } else { - MWBase::Environment::get().getStateManager()->newGame (true); + MWBase::Environment::get().getStateManager()->newGame (!mNewGame); } // Start the main rendering loop diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp index 10c1f6ff2..0f5b66f2f 100644 --- a/apps/openmw/engine.hpp +++ b/apps/openmw/engine.hpp @@ -93,6 +93,7 @@ namespace OMW Translation::Storage mTranslationDataStorage; std::vector mScriptBlacklist; bool mScriptBlacklistUse; + bool mNewGame; // not implemented Engine (const Engine&); @@ -153,7 +154,11 @@ namespace OMW /// Disable or enable all sounds void setSoundUsage(bool soundUsage); - void setSkipMenu (bool skipMenu); + /// Skip main menu and go directly into the game + /// + /// \param newGame Start a new game instead off dumping the player into the game + /// (ignored if !skipMenu). + void setSkipMenu (bool skipMenu, bool newGame); void setGrabMouse(bool grab) { mGrab = grab; } diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 57b3e045e..f81df31ff 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -153,6 +153,9 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat ("skip-menu", bpo::value()->implicit_value(true) ->default_value(false), "skip main menu on game startup") + ("new-game", bpo::value()->implicit_value(true) + ->default_value(false), "run new game sequence (ignored if skip-menu=0)") + ("fs-strict", bpo::value()->implicit_value(true) ->default_value(false), "strict file system handling (no case folding)") @@ -256,7 +259,9 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat // startup-settings engine.setCell(variables["start"].as()); - engine.setSkipMenu (variables["skip-menu"].as()); + engine.setSkipMenu (variables["skip-menu"].as(), variables["new-game"].as()); + if (!variables["skip-menu"].as() && variables["new-game"].as()) + std::cerr << "new-game used without skip-menu -> ignoring it" << std::endl; // scripts engine.setCompileAll(variables["script-all"].as()); diff --git a/readme.txt b/readme.txt index a02cc4ebc..79ffa7a8f 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,8 @@ Allowed options: correctly compiled anyway 2 - treat warnings as errors --skip-menu [=arg(=1)] (=0) skip main menu on game startup + --new-game [=arg(=1)] (=0) run new game sequence (ignored if + skip-menu=0) --fs-strict [=arg(=1)] (=0) strict file system handling (no case folding) --encoding arg (=win1252) Character encoding used in OpenMW game