forked from teamnwah/openmw-tes3coop
Revert "remove commandline switch for new game"
This reverts commit 86671096ec
.
This commit is contained in:
parent
7b2c3e6cd3
commit
1c73a3f2fb
9 changed files with 28 additions and 19 deletions
|
@ -125,6 +125,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
|||
, mFpsLevel(0)
|
||||
, mDebug (false)
|
||||
, mVerboseScripts (false)
|
||||
, mNewGame (false)
|
||||
, mUseSound (true)
|
||||
, mCompileAll (false)
|
||||
, mScriptContext (0)
|
||||
|
@ -236,6 +237,11 @@ void OMW::Engine::setScriptsVerbosity(bool scriptsVerbosity)
|
|||
mVerboseScripts = scriptsVerbosity;
|
||||
}
|
||||
|
||||
void OMW::Engine::setNewGame(bool newGame)
|
||||
{
|
||||
mNewGame = newGame;
|
||||
}
|
||||
|
||||
// Initialise and enter main loop.
|
||||
|
||||
void OMW::Engine::go()
|
||||
|
@ -326,13 +332,13 @@ void OMW::Engine::go()
|
|||
|
||||
// Create the world
|
||||
mEnvironment.setWorld (new MWWorld::World (*mOgre, mFileCollections, mMaster,
|
||||
mResDir, mCfgMgr.getCachePath(), mEncoding, mFallbackMap));
|
||||
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoding, mFallbackMap));
|
||||
|
||||
// Create window manager - this manages all the MW-specific GUI windows
|
||||
MWScript::registerExtensions (mExtensions);
|
||||
|
||||
mEnvironment.setWindowManager (new MWGui::WindowManager(
|
||||
mExtensions, mFpsLevel, mOgre, mCfgMgr.getLogPath().string() + std::string("/"),
|
||||
mExtensions, mFpsLevel, mNewGame, mOgre, mCfgMgr.getLogPath().string() + std::string("/"),
|
||||
mCfgMgr.getCachePath ().string(), mScriptConsoleMode));
|
||||
|
||||
// Create sound system
|
||||
|
|
|
@ -68,6 +68,7 @@ namespace OMW
|
|||
int mFpsLevel;
|
||||
bool mDebug;
|
||||
bool mVerboseScripts;
|
||||
bool mNewGame;
|
||||
bool mUseSound;
|
||||
bool mCompileAll;
|
||||
std::string mFocusName;
|
||||
|
@ -137,6 +138,9 @@ namespace OMW
|
|||
/// Disable or enable all sounds
|
||||
void setSoundUsage(bool soundUsage);
|
||||
|
||||
/// Start as a new game.
|
||||
void setNewGame(bool newGame);
|
||||
|
||||
/// Initialise and enter main loop.
|
||||
void go();
|
||||
|
||||
|
|
|
@ -133,6 +133,9 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
|
|||
("script-run", bpo::value<std::string>()->default_value(""),
|
||||
"select a file containing a list of console commands that is executed on startup")
|
||||
|
||||
("new-game", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "activate char gen/new game mechanics")
|
||||
|
||||
("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)")
|
||||
|
||||
|
@ -235,6 +238,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
|
|||
|
||||
// startup-settings
|
||||
engine.setCell(variables["start"].as<std::string>());
|
||||
engine.setNewGame(variables["new-game"].as<bool>());
|
||||
|
||||
// other settings
|
||||
engine.setDebugMode(variables["debug"].as<bool>());
|
||||
|
|
|
@ -79,8 +79,6 @@ namespace MWBase
|
|||
*/
|
||||
virtual void update() = 0;
|
||||
|
||||
virtual void newGame() = 0;
|
||||
|
||||
virtual void pushGuiMode (MWGui::GuiMode mode) = 0;
|
||||
virtual void popGuiMode() = 0;
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ namespace MWGui
|
|||
void MainMenu::newGameConfirmed()
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager ()->removeGuiMode (GM_MainMenu);
|
||||
MWBase::Environment::get().getWindowManager ()->newGame ();
|
||||
MWBase::Environment::get().getWorld ()->newGame();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
using namespace MWGui;
|
||||
|
||||
WindowManager::WindowManager(
|
||||
const Compiler::Extensions& extensions, int fpsLevel, OEngine::Render::OgreRenderer *mOgre,
|
||||
const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre,
|
||||
const std::string& logpath, const std::string& cacheDir, bool consoleOnlyScripts)
|
||||
: mGuiManager(NULL)
|
||||
, mHud(NULL)
|
||||
|
@ -95,8 +95,8 @@ WindowManager::WindowManager(
|
|||
, mGui(NULL)
|
||||
, mGarbageDialogs()
|
||||
, mShown(GW_ALL)
|
||||
, mAllowed(GW_ALL)
|
||||
, mRestAllowed(true)
|
||||
, mAllowed(newGame ? GW_None : GW_ALL)
|
||||
, mRestAllowed(newGame ? false : true)
|
||||
, mShowFPSLevel(fpsLevel)
|
||||
, mFPS(0.0f)
|
||||
, mTriangleCount(0)
|
||||
|
@ -1041,9 +1041,3 @@ void WindowManager::startTraining(MWWorld::Ptr actor)
|
|||
{
|
||||
mTrainingWindow->startTraining(actor);
|
||||
}
|
||||
|
||||
void WindowManager::newGame ()
|
||||
{
|
||||
mAllowed = GW_None;
|
||||
mRestAllowed = false;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace MWGui
|
|||
typedef std::pair<std::string, int> Faction;
|
||||
typedef std::vector<Faction> FactionList;
|
||||
|
||||
WindowManager(const Compiler::Extensions& extensions, int fpsLevel,
|
||||
WindowManager(const Compiler::Extensions& extensions, int fpsLevel, bool newGame,
|
||||
OEngine::Render::OgreRenderer *mOgre, const std::string& logpath,
|
||||
const std::string& cacheDir, bool consoleOnlyScripts);
|
||||
virtual ~WindowManager();
|
||||
|
@ -86,8 +86,6 @@ namespace MWGui
|
|||
*/
|
||||
virtual void update();
|
||||
|
||||
virtual void newGame();
|
||||
|
||||
virtual void pushGuiMode(GuiMode mode);
|
||||
virtual void popGuiMode();
|
||||
virtual void removeGuiMode(GuiMode mode); ///< can be anywhere in the stack
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace MWWorld
|
|||
|
||||
World::World (OEngine::Render::OgreRenderer& renderer,
|
||||
const Files::Collections& fileCollections,
|
||||
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir,
|
||||
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, bool newGame,
|
||||
const std::string& encoding, std::map<std::string,std::string> fallbackMap)
|
||||
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
||||
mSky (true), mCells (mStore, mEsm), mNewGameStarted(false),
|
||||
|
@ -197,6 +197,12 @@ namespace MWWorld
|
|||
// global variables
|
||||
mGlobalVariables = new Globals (mStore);
|
||||
|
||||
if (newGame)
|
||||
{
|
||||
// set new game mark
|
||||
mGlobalVariables->setInt ("chargenstate", 1);
|
||||
}
|
||||
|
||||
mGlobalVariables->setInt ("pcrace", 3);
|
||||
|
||||
mWorldScene = new Scene(*mRendering, mPhysics);
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace MWWorld
|
|||
|
||||
World (OEngine::Render::OgreRenderer& renderer,
|
||||
const Files::Collections& fileCollections,
|
||||
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir,
|
||||
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, bool newGame,
|
||||
const std::string& encoding, std::map<std::string,std::string> fallbackMap);
|
||||
|
||||
virtual ~World();
|
||||
|
|
Loading…
Reference in a new issue