restored --new-game switch

deque
Marc Zinnschlag 10 years ago
parent 96cd46568b
commit a9df3b53fd

@ -182,6 +182,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
, mGrab(true) , mGrab(true)
, mScriptBlacklistUse (true) , mScriptBlacklistUse (true)
, mExportFonts(false) , mExportFonts(false)
, mNewGame (false)
{ {
std::srand ( std::time(NULL) ); std::srand ( std::time(NULL) );
MWClass::registerClasses(); MWClass::registerClasses();
@ -264,9 +265,10 @@ void OMW::Engine::setScriptsVerbosity(bool scriptsVerbosity)
mVerboseScripts = scriptsVerbosity; mVerboseScripts = scriptsVerbosity;
} }
void OMW::Engine::setSkipMenu (bool skipMenu) void OMW::Engine::setSkipMenu (bool skipMenu, bool newGame)
{ {
mSkipMenu = skipMenu; mSkipMenu = skipMenu;
mNewGame = newGame;
} }
std::string OMW::Engine::loadSettings (Settings::Manager & settings) std::string OMW::Engine::loadSettings (Settings::Manager & settings)
@ -472,7 +474,7 @@ void OMW::Engine::go()
} }
else else
{ {
MWBase::Environment::get().getStateManager()->newGame (true); MWBase::Environment::get().getStateManager()->newGame (!mNewGame);
} }
// Start the main rendering loop // Start the main rendering loop

@ -93,6 +93,7 @@ namespace OMW
Translation::Storage mTranslationDataStorage; Translation::Storage mTranslationDataStorage;
std::vector<std::string> mScriptBlacklist; std::vector<std::string> mScriptBlacklist;
bool mScriptBlacklistUse; bool mScriptBlacklistUse;
bool mNewGame;
// not implemented // not implemented
Engine (const Engine&); Engine (const Engine&);
@ -153,7 +154,11 @@ namespace OMW
/// Disable or enable all sounds /// Disable or enable all sounds
void setSoundUsage(bool soundUsage); 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; } void setGrabMouse(bool grab) { mGrab = grab; }

@ -153,6 +153,9 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
("skip-menu", bpo::value<bool>()->implicit_value(true) ("skip-menu", bpo::value<bool>()->implicit_value(true)
->default_value(false), "skip main menu on game startup") ->default_value(false), "skip main menu on game startup")
("new-game", bpo::value<bool>()->implicit_value(true)
->default_value(false), "run new game sequence (ignored if skip-menu=0)")
("fs-strict", bpo::value<bool>()->implicit_value(true) ("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)") ->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 // startup-settings
engine.setCell(variables["start"].as<std::string>()); engine.setCell(variables["start"].as<std::string>());
engine.setSkipMenu (variables["skip-menu"].as<bool>()); engine.setSkipMenu (variables["skip-menu"].as<bool>(), variables["new-game"].as<bool>());
if (!variables["skip-menu"].as<bool>() && variables["new-game"].as<bool>())
std::cerr << "new-game used without skip-menu -> ignoring it" << std::endl;
// scripts // scripts
engine.setCompileAll(variables["script-all"].as<bool>()); engine.setCompileAll(variables["script-all"].as<bool>());

@ -73,6 +73,8 @@ Allowed options:
correctly compiled anyway correctly compiled anyway
2 - treat warnings as errors 2 - treat warnings as errors
--skip-menu [=arg(=1)] (=0) skip main menu on game startup --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 --fs-strict [=arg(=1)] (=0) strict file system handling (no case
folding) folding)
--encoding arg (=win1252) Character encoding used in OpenMW game --encoding arg (=win1252) Character encoding used in OpenMW game

Loading…
Cancel
Save