Goto mp::connect/wait only if "allow_new_game=yes".
The "--campaign-screens" command line option has been removed since it is no longer useful.
This commit is contained in:
parent
279065a036
commit
758fc8c5da
6 changed files with 12 additions and 15 deletions
|
@ -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<std::vector<std::string> >()->composing(), "selects a configuration file to load for this side. <arg> should have format side:value")
|
||||
("algorithm", po::value<std::vector<std::string> >()->composing(), "selects a non-standard algorithm to be used by the AI controller for this side. <arg> should have format side:value")
|
||||
("controller", po::value<std::vector<std::string> >()->composing(), "selects the controller for this side. <arg> should have format side:value")
|
||||
|
@ -311,8 +309,6 @@ commandline_options::commandline_options ( int argc, char** argv ) :
|
|||
max_fps = vm["max-fps"].as<int>();
|
||||
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"))
|
||||
|
|
|
@ -83,8 +83,6 @@ public:
|
|||
boost::optional<std::string> 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<std::vector<boost::tuple<unsigned int, std::string> > > multiplayer_ai_config;
|
||||
/// Non-empty if --algorithm was given on the command line. Vector of pairs (side number, value). Dependent on --multiplayer.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue