diff --git a/changelog b/changelog index 1a152107a98..d4d987cdd3f 100644 --- a/changelog +++ b/changelog @@ -61,6 +61,7 @@ SVN trunk (1.1.2+svn): * misc * fix alt key under MacosX * help contents available from title screen + * preferences available from multiplayer lobby Version 1.1.2: * campaigns diff --git a/src/multiplayer.cpp b/src/multiplayer.cpp index c3922fbdba9..8a142a15acf 100644 --- a/src/multiplayer.cpp +++ b/src/multiplayer.cpp @@ -25,6 +25,7 @@ #include "network.hpp" #include "playcampaign.hpp" #include "preferences.hpp" +#include "preferences_display.hpp" #include "random.hpp" #include "replay.hpp" #include "video.hpp" @@ -386,6 +387,14 @@ void enter_lobby_mode(display& disp, const config& game_config, game_data& data, } break; case mp::ui::QUIT: + return; + case mp::ui::PREFERENCES: + { + const preferences::display_manager disp_manager(&disp); + preferences::show_preferences_dialog(disp,game_config); + disp.redraw_everything(); + } + break; default: return; } diff --git a/src/multiplayer_lobby.cpp b/src/multiplayer_lobby.cpp index a573c393589..2d03538aa72 100644 --- a/src/multiplayer_lobby.cpp +++ b/src/multiplayer_lobby.cpp @@ -448,6 +448,7 @@ lobby::lobby(display& disp, const config& cfg, chat& c, config& gamelist) : observe_game_(disp.video(), _("Observe Game")), join_game_(disp.video(), _("Join Game")), create_game_(disp.video(), _("Create Game")), + game_preferences_(disp.video(), _("Preferences")), quit_game_(disp.video(), _("Quit")), sorter_(gamelist), games_menu_(disp.video()), @@ -466,6 +467,7 @@ void lobby::hide_children(bool hide) observe_game_.hide(hide); join_game_.hide(hide); create_game_.hide(hide); + game_preferences_.hide(hide); quit_game_.hide(hide); } @@ -476,7 +478,8 @@ void lobby::layout_children(const SDL_Rect& rect) join_game_.set_location(xscale(12),yscale(7)); observe_game_.set_location(join_game_.location().x + join_game_.location().w + 5,yscale(7)); create_game_.set_location(observe_game_.location().x + observe_game_.location().w + 5,yscale(7)); - quit_game_.set_location(create_game_.location().x + create_game_.location().w + 5,yscale(7)); + game_preferences_.set_location(create_game_.location().x + create_game_.location().w + 5,yscale(7)); + quit_game_.set_location(game_preferences_.location().x + game_preferences_.location().w + 5,yscale(7)); games_menu_.set_location(client_area().x, client_area().y + title().height()); games_menu_.set_measurements(client_area().w, client_area().h @@ -536,6 +539,11 @@ void lobby::process_event() return; } + if(game_preferences_.pressed()) { + set_result(PREFERENCES); + return; + } + if(quit_game_.pressed()) { recorder.set_skip(false); set_result(QUIT); diff --git a/src/multiplayer_lobby.hpp b/src/multiplayer_lobby.hpp index 73bc36d79f9..2e0521ecf2d 100644 --- a/src/multiplayer_lobby.hpp +++ b/src/multiplayer_lobby.hpp @@ -113,6 +113,7 @@ private: gui::button observe_game_; gui::button join_game_; gui::button create_game_; + gui::button game_preferences_; gui::button quit_game_; lobby_sorter sorter_; diff --git a/src/multiplayer_ui.hpp b/src/multiplayer_ui.hpp index 869a5a73f24..dbfc1bb922a 100644 --- a/src/multiplayer_ui.hpp +++ b/src/multiplayer_ui.hpp @@ -70,7 +70,7 @@ private: class ui : public gui::widget { public: - enum result { CONTINUE, JOIN, OBSERVE, CREATE, PLAY, QUIT }; + enum result { CONTINUE, JOIN, OBSERVE, CREATE, PREFERENCES, PLAY, QUIT }; ui(display& d, const std::string& title, const config& cfg, chat& c, config& gamelist);