Skip to content
Browse files

Skip mp::configure when loading a multiplayer game.

  • Loading branch information...
1 parent 9f5ac2c commit e07c69d5e53e47b2a4a7df13ba3a0e89c4d86585 @thunderstruck thunderstruck committed Jun 25, 2013
Showing with 11 additions and 7 deletions.
  1. +8 −1 src/multiplayer.cpp
  2. +1 −5 src/multiplayer_create.cpp
  3. +2 −1 src/multiplayer_ui.hpp
View
9 src/multiplayer.cpp
@@ -527,9 +527,11 @@ static void enter_create_mode(game_display& disp, const config& game_config, mp:
DBG_MP << "entering create mode" << std::endl;
bool configure_canceled;
+ bool connect_canceled;
do {
configure_canceled = false;
+ connect_canceled = false;
if (gui2::new_widgets) {
@@ -554,14 +556,19 @@ static void enter_create_mode(game_display& disp, const config& game_config, mp:
case mp::ui::CREATE:
configure_canceled = !enter_configure_mode(disp, game_config, chat, gamelist, params, default_controller, local_players_only);
break;
+ case mp::ui::LOAD_GAME:
+ connect_canceled = !enter_connect_mode(disp, game_config, chat,
+ gamelist, params, 0, default_controller,
+ local_players_only);
+ break;
case mp::ui::QUIT:
default:
//update lobby content
network::send_data(config("refresh_lobby"), 0);
break;
}
}
- } while(configure_canceled);
+ } while(configure_canceled || connect_canceled);
}
static bool enter_configure_mode(game_display& disp, const config& game_config,
View
6 src/multiplayer_create.cpp
@@ -292,12 +292,8 @@ void create::process_event()
if (load_game_.pressed()) {
set_level_data(SAVED_GAME, 0);
+ set_result(LOAD_GAME);
- if (image_restorer_ != NULL) {
- image_restorer_->restore();
- }
-
- set_result(CREATE);
return;
}
View
3 src/multiplayer_ui.hpp
@@ -75,7 +75,8 @@ class chat
class ui : public gui::widget, private events::chat_handler, private font::floating_label_context
{
public:
- enum result { CONTINUE, JOIN, OBSERVE, CREATE, PREFERENCES, PLAY, QUIT };
+ enum result { CONTINUE, JOIN, OBSERVE, CREATE, LOAD_GAME, PREFERENCES,
+ PLAY, QUIT };
ui(game_display& d, const std::string& title,
const config& cfg, chat& c, config& gamelist);

0 comments on commit e07c69d

Please sign in to comment.
Something went wrong with that request. Please try again.