mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 02:15:32 +00:00
all program options (except help) can now be used from a cfg file
This commit is contained in:
parent
6dba09462a
commit
d481222d92
1 changed files with 20 additions and 12 deletions
|
@ -55,12 +55,20 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||||
->default_value (std::vector<std::string>(), "")
|
->default_value (std::vector<std::string>(), "")
|
||||||
->multitoken(),
|
->multitoken(),
|
||||||
"plugin file(s)")
|
"plugin file(s)")
|
||||||
( "fps", "show fps counter")
|
( "fps", boost::program_options::value<bool>()->
|
||||||
( "debug", "debug mode" )
|
implicit_value (true)->default_value (false), "show fps counter")
|
||||||
( "nosound", "disable all sound" )
|
( "debug", boost::program_options::value<bool>()->
|
||||||
( "script-verbose", "verbose script output" )
|
implicit_value (true)->default_value (false), "debug mode" )
|
||||||
( "new-game", "activate char gen/new game mechanics" )
|
( "nosound", boost::program_options::value<bool>()->
|
||||||
( "script-all", "compile all scripts (excluding dialogue scripts) at startup")
|
implicit_value (true)->default_value (false), "disable all sound" )
|
||||||
|
( "script-verbose", boost::program_options::value<bool>()->
|
||||||
|
implicit_value (true)->default_value (false), "verbose script output" )
|
||||||
|
( "new-game", boost::program_options::value<bool>()->
|
||||||
|
implicit_value (true)->default_value (false),
|
||||||
|
"activate char gen/new game mechanics" )
|
||||||
|
( "script-all", boost::program_options::value<bool>()->
|
||||||
|
implicit_value (true)->default_value (false),
|
||||||
|
"compile all scripts (excluding dialogue scripts) at startup")
|
||||||
;
|
;
|
||||||
|
|
||||||
bpo::variables_map variables;
|
bpo::variables_map variables;
|
||||||
|
@ -118,23 +126,23 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||||
// startup-settings
|
// startup-settings
|
||||||
engine.setCell (variables["start"].as<std::string>());
|
engine.setCell (variables["start"].as<std::string>());
|
||||||
|
|
||||||
if (variables.count ("new-game"))
|
if (variables["new-game"].as<bool>()==true)
|
||||||
engine.setNewGame();
|
engine.setNewGame();
|
||||||
|
|
||||||
// other settings
|
// other settings
|
||||||
if (variables.count ("fps"))
|
if (variables["fps"].as<bool>()==true)
|
||||||
engine.showFPS();
|
engine.showFPS();
|
||||||
|
|
||||||
if (variables.count ("debug"))
|
if (variables["debug"].as<bool>()==true)
|
||||||
engine.enableDebugMode();
|
engine.enableDebugMode();
|
||||||
|
|
||||||
if (variables.count ("no-sound"))
|
if (variables["nosound"].as<bool>()==true)
|
||||||
engine.disableSound();
|
engine.disableSound();
|
||||||
|
|
||||||
if (variables.count ("script-verbose"))
|
if (variables["script-verbose"].as<bool>()==true)
|
||||||
engine.enableVerboseScripts();
|
engine.enableVerboseScripts();
|
||||||
|
|
||||||
if (variables.count ("script-all"))
|
if (variables["script-all"].as<bool>()==true)
|
||||||
engine.setCompileAll (true);
|
engine.setCompileAll (true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue