diff --git a/src/commandline_options.cpp b/src/commandline_options.cpp index 513b766dc12..e15ccad8dd9 100644 --- a/src/commandline_options.cpp +++ b/src/commandline_options.cpp @@ -68,7 +68,6 @@ commandline_options::commandline_options ( int argc, char** argv ) : load(), logdomains(), multiplayer(false), - campaign_screens(false), multiplayer_ai_config(), multiplayer_algorithm(), multiplayer_controller(), @@ -189,7 +188,6 @@ commandline_options::commandline_options ( int argc, char** argv ) : po::options_description multiplayer_opts("Multiplayer options"); multiplayer_opts.add_options() ("multiplayer,m", "Starts a multiplayer game. There are additional options that can be used as explained below:") - ("campaign-screens", "Shows multiplayer screens in between campaign's scenarios for additional game configuration. Experimental function.") ("ai-config", po::value >()->composing(), "selects a configuration file to load for this side. should have format side:value") ("algorithm", po::value >()->composing(), "selects a non-standard algorithm to be used by the AI controller for this side. should have format side:value") ("controller", po::value >()->composing(), "selects the controller for this side. should have format side:value") @@ -311,8 +309,6 @@ commandline_options::commandline_options ( int argc, char** argv ) : max_fps = vm["max-fps"].as(); if (vm.count("multiplayer")) multiplayer = true; - if (vm.count("campaign-screens")) - campaign_screens = true; if (vm.count("new-storyscreens")) new_storyscreens = true; if (vm.count("new-widgets")) diff --git a/src/commandline_options.hpp b/src/commandline_options.hpp index eb7a7fe37e6..87cb22a1a99 100644 --- a/src/commandline_options.hpp +++ b/src/commandline_options.hpp @@ -83,8 +83,6 @@ public: boost::optional logdomains; /// True if --multiplayer was given on the command line. Goes directly into multiplayer mode. bool multiplayer; - /// True if --campaign-screens was given on the command line. Additional game options in between campaign's scenarios. - bool campaign_screens; /// Non-empty if --ai-config was given on the command line. Vector of pairs (side number, value). Dependent on --multiplayer. boost::optional > > multiplayer_ai_config; /// Non-empty if --algorithm was given on the command line. Vector of pairs (side number, value). Dependent on --multiplayer. diff --git a/src/game_config.cpp b/src/game_config.cpp index bf61b5b1b8b..6fd1edb4c62 100644 --- a/src/game_config.cpp +++ b/src/game_config.cpp @@ -60,7 +60,7 @@ namespace game_config std::string wesnoth_program_dir; bool debug = false, debug_lua = false, editor = false, ignore_replay_errors = false, mp_debug = false, exit_at_end = false, - no_delay = false, disable_autosave = false, campaign_screens = false; + no_delay = false, disable_autosave = false; int cache_compression_level = 6; diff --git a/src/game_config.hpp b/src/game_config.hpp index d6ce7e9c1e7..5716d1243be 100644 --- a/src/game_config.hpp +++ b/src/game_config.hpp @@ -53,7 +53,7 @@ namespace game_config extern const int gold_carryover_percentage; extern bool debug, debug_lua, editor, ignore_replay_errors, mp_debug, - exit_at_end, no_delay, disable_autosave, campaign_screens; + exit_at_end, no_delay, disable_autosave; extern int cache_compression_level; diff --git a/src/game_controller.cpp b/src/game_controller.cpp index 8604b16a543..a51275376cd 100644 --- a/src/game_controller.cpp +++ b/src/game_controller.cpp @@ -129,9 +129,6 @@ game_controller::game_controller(const commandline_options& cmdline_opts, const std::cerr << "selected scenario id: [" << jump_to_campaign_.scenario_id_ << "]\n"; } } - if (cmdline_opts_.campaign_screens) { - game_config::campaign_screens = true; - } if (cmdline_opts_.clock) gui2::show_debug_clock_button = true; if (cmdline_opts_.debug) { diff --git a/src/playcampaign.cpp b/src/playcampaign.cpp index be841c8f8a8..b823ca93a65 100644 --- a/src/playcampaign.cpp +++ b/src/playcampaign.cpp @@ -280,8 +280,9 @@ static LEVEL_RESULT playmp_scenario(const config& game_config, int num_turns = (*level)["turns"].to_int(-1); config init_level = *level; - if (!game_config::campaign_screens || first_scenario || + if (!init_level["allow_new_game"].to_bool(true) || first_scenario || io_type == IO_CLIENT) { + team_init(init_level, state_of_game); } @@ -547,7 +548,11 @@ LEVEL_RESULT play_game(game_display& disp, game_state& gamestate, return res; } - if (game_config::campaign_screens) { + config const* next_scenario = &game_config.find_child(type, "id", + gamestate.carryover_sides_start["next_scenario"]); + if (next_scenario != NULL && + (*next_scenario)["allow_new_game"].to_bool(true)) { + // Opens mp::connect dialog to get a new gamestate. mp::ui::result wait_res = mp::goto_mp_wait(gamestate, disp, game_config); @@ -609,8 +614,9 @@ LEVEL_RESULT play_game(game_display& disp, game_state& gamestate, connect_engine(new mp::connect_engine(disp, gamestate, params, !network_game, false)); - if (game_config::campaign_screens) { - // Opens mp::connect dialog to get a new gamestate. + if ((*scenario)["allow_new_game"].to_bool(true)) { + // Opens mp::connect dialog to allow users to + // make an adjustments for scenario. mp::ui::result connect_res = mp::goto_mp_connect(disp, *connect_engine, game_config, params.name); if (connect_res == mp::ui::QUIT) {