Author: ilor
Date: Fri Apr 23 15:57:31 2010
New Revision: 42226

URL: http://svn.gna.org/viewcvs/wesnoth?rev=42226&view=rev
Log:
add a preference for the new lobby (default to off), and a checkbox for setting 
it in the preferences dialog

Modified:
    branches/1.8/changelog
    branches/1.8/players_changelog
    branches/1.8/src/game_preferences.cpp
    branches/1.8/src/game_preferences.hpp
    branches/1.8/src/game_preferences_display.cpp
    branches/1.8/src/multiplayer.cpp

Modified: branches/1.8/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/changelog?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/changelog (original)
+++ branches/1.8/changelog Fri Apr 23 15:57:31 2010
@@ -14,6 +14,8 @@
    * Fixed bug #15716: Lobby crash when refreshing with filtered out games
    * Fixed bug #15768: Avoid parts of the previous game show in the lobby
    * Re-added the old MP lobby
+   * Add a preference for switching between the old an new lobby, in the
+     preferences dialog in the "Multiplayer" tab. Defaults to the old lobby.
  * Miscellaneous and bug fixes:
    * better fix for bug 14765 now that string freeze is off
    * Fixed the ping timeout not waiting for the default ping interval when

Modified: branches/1.8/players_changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/players_changelog?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/players_changelog (original)
+++ branches/1.8/players_changelog Fri Apr 23 15:57:31 2010
@@ -21,6 +21,8 @@
 
  * User interface:
    * Re-added the old MP lobby
+   * Add a preference for switching between the old an new lobby, in the
+     preferences dialog in the "Multiplayer" tab. Defaults to the old lobby.
 
 
 Version 1.8.0:

Modified: branches/1.8/src/game_preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/game_preferences.cpp?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/src/game_preferences.cpp (original)
+++ branches/1.8/src/game_preferences.cpp Fri Apr 23 15:57:31 2010
@@ -279,6 +279,20 @@
        }
 }
 
+bool new_lobby()
+{
+       std::cerr << get("new_lobby") << "\n";
+       return utils::string_bool(get("new_lobby"), false);
+}
+
+void set_new_lobby(bool value)
+{
+       std::cerr << get("new_lobby") << value;
+       preferences::set("new_lobby", (value ? "yes" : "no"));
+       std::cerr << get("new_lobby") << "\n";
+}
+
+
 const std::vector<game_config::server_info>& server_list()
 {
        static std::vector<game_config::server_info> pref_servers;

Modified: branches/1.8/src/game_preferences.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/game_preferences.hpp?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/src/game_preferences.hpp (original)
+++ branches/1.8/src/game_preferences.hpp Fri Apr 23 15:57:31 2010
@@ -44,6 +44,10 @@
        int lobby_joins();
        void _set_lobby_joins(int show);
        enum { SHOW_NONE, SHOW_FRIENDS, SHOW_ALL };
+
+       bool new_lobby();
+       void set_new_lobby(bool value);
+
 
        const std::set<std::string> & get_friends();
        const std::set<std::string> & get_ignores();

Modified: branches/1.8/src/game_preferences_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/game_preferences_display.cpp?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/src/game_preferences_display.cpp (original)
+++ branches/1.8/src/game_preferences_display.cpp Fri Apr 23 15:57:31 2010
@@ -104,6 +104,7 @@
                        show_lobby_joins_button1_,
                        show_lobby_joins_button2_,
                        show_lobby_joins_button3_,
+                       new_lobby_button_,
                        sort_list_by_group_button_, iconize_list_button_,
                        remember_pw_button_, mp_server_search_button_,
                        friends_list_button_, friends_back_button_,
@@ -165,6 +166,7 @@
          show_lobby_joins_button1_(disp.video(), _("Do Not Show Lobby Joins"), 
gui::button::TYPE_CHECK),
          show_lobby_joins_button2_(disp.video(), _("Show Lobby Joins Of 
Friends Only"), gui::button::TYPE_CHECK),
          show_lobby_joins_button3_(disp.video(), _("Show All Lobby Joins"), 
gui::button::TYPE_CHECK),
+         new_lobby_button_(disp.video(), _("Use new lobby interface"), 
gui::button::TYPE_CHECK),
          sort_list_by_group_button_(disp.video(), _("Sort Lobby List"), 
gui::button::TYPE_CHECK),
          iconize_list_button_(disp.video(), _("Iconize Lobby List"), 
gui::button::TYPE_CHECK),
          remember_pw_button_(disp.video(), _("Save password to preferences 
(clear text)"), gui::button::TYPE_CHECK),
@@ -365,6 +367,9 @@
        show_lobby_joins_button3_.set_check(lj == SHOW_ALL);
        show_lobby_joins_button3_.set_help_string(_("Show messages about all 
players joining the multiplayer lobby"));
 
+       new_lobby_button_.set_check(new_lobby());
+       new_lobby_button_.set_help_string(_("Use new lobby interface"));
+
        mp_server_search_button_.set_help_string(_("Find and set path to MP 
server to host LAN games."));
        friends_list_button_.set_help_string(_("View and edit your friends and 
ignores list"));
        friends_back_button_.set_help_string(_("Back to the multiplayer 
options"));
@@ -434,6 +439,7 @@
        h.push_back(&show_lobby_joins_button1_);
        h.push_back(&show_lobby_joins_button2_);
        h.push_back(&show_lobby_joins_button3_);
+       h.push_back(&new_lobby_button_);
        h.push_back(&mp_server_search_button_);
        h.push_back(&friends_list_button_);
        h.push_back(&friends_back_button_);
@@ -625,6 +631,8 @@
        ypos += short_interline; show_lobby_joins_button2_.set_location(rect.x, 
ypos);
        ypos += short_interline; show_lobby_joins_button3_.set_location(rect.x, 
ypos);
 
+       ypos += item_interline; new_lobby_button_.set_location(rect.x, ypos);
+
        friends_list_button_.set_location(rect.x, bottom_row_y - 
friends_list_button_.height());
 
        mp_server_search_button_.set_location(rect.x + horizontal_padding + 
friends_list_button_.width(), bottom_row_y - mp_server_search_button_.height());
@@ -857,6 +865,8 @@
                        show_lobby_joins_button2_.set_check(false);
                        show_lobby_joins_button3_.set_check(true);
                }
+               if (new_lobby_button_.pressed())
+                       set_new_lobby(new_lobby_button_.checked());
                if (sort_list_by_group_button_.pressed())
                        set_sort_list(sort_list_by_group_button_.checked());
                if (iconize_list_button_.pressed())
@@ -1143,6 +1153,7 @@
        show_lobby_joins_button1_.hide(hide_multiplayer);
        show_lobby_joins_button2_.hide(hide_multiplayer);
        show_lobby_joins_button3_.hide(hide_multiplayer);
+       new_lobby_button_.hide(hide_multiplayer);
        friends_list_button_.hide(hide_multiplayer);
        mp_server_search_button_.hide(hide_multiplayer);
 

Modified: branches/1.8/src/multiplayer.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/multiplayer.cpp?rev=42226&r1=42225&r2=42226&view=diff
==============================================================================
--- branches/1.8/src/multiplayer.cpp (original)
+++ branches/1.8/src/multiplayer.cpp Fri Apr 23 15:57:31 2010
@@ -548,7 +548,7 @@
 
                SDL_FillRect(disp.video().getSurface(), NULL, colour);
 
-               if(gui2::new_widgets) {
+               if(preferences::new_lobby()) {
                        gui2::tlobby_main dlg(game_config, li, disp);
                        dlg.set_preferences_callback(
                                boost::bind(do_preferences_dialog,


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to