Author: shadowmaster
Date: Wed Mar 21 20:34:24 2012
New Revision: 53603
URL: http://svn.gna.org/viewcvs/wesnoth?rev=53603&view=rev
Log:
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.
Modified:
trunk/changelog
trunk/players_changelog
trunk/src/multiplayer.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=53603&r1=53602&r2=53603&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Wed Mar 21 20:34:24 2012
@@ -70,6 +70,9 @@
* 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:
Modified: trunk/players_changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=53603&r1=53602&r2=53603&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Wed Mar 21 20:34:24 2012
@@ -49,6 +49,9 @@
* 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.
Modified: trunk/src/multiplayer.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer.cpp?rev=53603&r1=53602&r2=53603&view=diff
==============================================================================
--- trunk/src/multiplayer.cpp (original)
+++ trunk/src/multiplayer.cpp Wed Mar 21 20:34:24 2012
@@ -463,7 +463,7 @@
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 @@
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);
-
- dlg.show(disp.video());
-
- network::send_data(config("refresh_lobby"), 0);
- } 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:
- 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
+
+ bool connect_canceled;
+
+ do {
+ connect_canceled = false;
+
+ if (gui2::new_widgets) {
+
+ gui2::tmp_create_game dlg(game_config);
+
+ dlg.show(disp.video());
+
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)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits