New --nomusic command line option...

...to disable music for the current session (without altering the
preferences)
This commit is contained in:
Benoît Timbert 2008-09-06 14:37:30 +00:00
parent 4ad705896d
commit 9039f8771e
4 changed files with 15 additions and 0 deletions

View file

@ -70,6 +70,7 @@ Version 1.5.3+svn:
* Added some more compiler workarounds for MSVC9.
* Removed the --small-gui build option, starting Wesnoth with the
--smallgui parameter achieves the same
* new --nomusic commandline option to disable music for the session
Version 1.5.3:
* Campaigns

View file

@ -128,6 +128,9 @@ disables caching of game data.
.B --nosound
runs the game without sounds and music.
.TP
.B --nomusic
runs the game without only music.
.TP
.B --path
prints the name of the game data directory and exits.
.TP

View file

@ -2,6 +2,10 @@ This is meant to be a concise list of player-visible changes (very minor
changes may be omitted). For a complete list of changes, see the main
changelog: http://svn.gna.org/viewcvs/*checkout*/wesnoth/trunk/changelog
Version 1.5.3+svn:
* Miscellaneous and bug fixes
* new --nomusic commandline option to disable music for the session
Version 1.5.3:
* Editor2
* Rotate clipboard 60 degrees clockwise or counter-clockwise, ctrl+r

View file

@ -249,6 +249,7 @@ game_controller::game_controller(int argc, char** argv) :
#endif
,cache_(game_config::config_cache::instance())
{
bool no_music = false;
bool no_sound = false;
for(arg_ = 1; arg_ != argc_; ++arg_) {
const std::string val(argv_[arg_]);
@ -350,6 +351,8 @@ game_controller::game_controller(int argc, char** argv) :
} else if (val.substr(0, 6) == "--log-") {
} else if(val == "--nosound") {
no_sound = true;
} else if(val == "--nomusic") {
no_music = true;
} else if(val == "--new-widgets") {
// This is a hidden option to enable the new widget toolkit.
gui2::new_widgets = true;
@ -391,6 +394,9 @@ game_controller::game_controller(int argc, char** argv) :
preferences::set_turn_bell(false);
preferences::set_UI_sound(false);
}
else if (no_music) { // else disable the music in nomusic mode
preferences::set_music(false);
}
}
game_display& game_controller::disp()
@ -1689,6 +1695,7 @@ static int process_command_args(int argc, char** argv) {
<< " --nocache disables caching of game data.\n"
<< " --validcache assume that cache is valid (dangerous)\n"
<< " --nosound runs the game without sounds and music.\n"
<< " --nomusic runs the game without only music.\n"
<< " --max-fps the maximum fps the game tries to run at the value\n"
<< " should be between the 1 and 1000, the default is 50.\n"
<< " --config-path prints the path to the game config directory and exits.\n"