mp: Canceling the sides setup screen when hosting a game...

...should bring the host back to the game configuration screen first
(bug #7130)

This applies both for networked and hotseat games. Previously canceling
this screen returned to the lobby and titlescreen, respectively. It
seems to make more sense to return to the game configuration screen
instead.
This commit is contained in:
Ignacio R. Morelle 2012-03-21 19:34:24 +00:00
parent 20722754d1
commit 9bf19bf964
3 changed files with 41 additions and 26 deletions

View file

@ -70,6 +70,9 @@ Version 1.11.0-svn:
* Fix an accidental terrain type change in Isar's Cross
* Fix attacker side being human in 6p_Team_Survival (bug #19400)
* Ignore Pango markup in map descriptions (bug #19210)
* Canceling the sides setup screen when hosting a MP game now brings the
host back to the game configuration screen first instead of returning
immediately to the lobby or (for hotseat) titlescreen (bug #7130)
* Music and sound effects:
* Replaced some of the wolf hit sounds with lower-pitched ones
* Terrain:

View file

@ -49,6 +49,9 @@ Version 1.11.0-svn:
* Multiplayer:
* Fix an accidental terrain type change in Isar's Cross.
* Fix attacker side being human in 6p_Team_Survival.
* Canceling the sides setup screen when hosting a MP game now brings the
host back to the game configuration screen first instead of returning
immediately to the lobby or (for hotseat) titlescreen (bug #7130).
* Terrain:
* New tropical frost images.

View file

@ -463,7 +463,7 @@ static void enter_wait_mode(game_display& disp, const config& game_config, mp::c
static void enter_create_mode(game_display& disp, const config& game_config, mp::chat& chat, config& gamelist, mp::controller default_controller, bool local_players_only = false);
static void enter_connect_mode(game_display& disp, const config& game_config,
static bool enter_connect_mode(game_display& disp, const config& game_config,
mp::chat& chat, config& gamelist, const mp_game_settings& params,
const int num_turns, mp::controller default_controller, bool local_players_only = false)
{
@ -503,45 +503,54 @@ static void enter_connect_mode(game_display& disp, const config& game_config,
case mp::ui::QUIT:
default:
network::send_data(config("refresh_lobby"), 0);
break;
return false;
}
return true;
}
static void enter_create_mode(game_display& disp, const config& game_config, mp::chat& chat, config& gamelist, mp::controller default_controller, bool local_players_only)
{
DBG_MP << "entering create mode" << std::endl;
if (gui2::new_widgets) {
gui2::tmp_create_game dlg(game_config);
bool connect_canceled;
dlg.show(disp.video());
do {
connect_canceled = false;
network::send_data(config("refresh_lobby"), 0);
} else {
if (gui2::new_widgets) {
mp::ui::result res;
mp_game_settings params;
int num_turns;
gui2::tmp_create_game dlg(game_config);
{
mp::create ui(disp, game_config, chat, gamelist);
run_lobby_loop(disp, ui);
res = ui.get_result();
params = ui.get_parameters();
num_turns = ui.num_turns();
}
dlg.show(disp.video());
switch (res) {
case mp::ui::CREATE:
enter_connect_mode(disp, game_config, chat, gamelist, params, num_turns, default_controller, local_players_only);
break;
case mp::ui::QUIT:
default:
//update lobby content
network::send_data(config("refresh_lobby"), 0);
break;
} else {
mp::ui::result res;
mp_game_settings params;
int num_turns;
{
mp::create ui(disp, game_config, chat, gamelist);
run_lobby_loop(disp, ui);
res = ui.get_result();
params = ui.get_parameters();
num_turns = ui.num_turns();
}
switch (res) {
case mp::ui::CREATE:
connect_canceled = !enter_connect_mode(disp, game_config, chat, gamelist, params, num_turns, default_controller, local_players_only);
break;
case mp::ui::QUIT:
default:
//update lobby content
network::send_data(config("refresh_lobby"), 0);
break;
}
}
}
} while(connect_canceled);
}
static void do_preferences_dialog(game_display& disp, const config& game_config)