mail[Wesnoth-commits] r13626 - in /trunk: ./ data/ src/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edb on September 22, 2006 - 12:02:
Author: edb
Date: Fri Sep 22 12:02:13 2006
New Revision: 13626

URL: http://svn.gna.org/viewcvs/wesnoth?rev=13626&view=rev
Log:
add an option to hide minimaps in the multiplayer lobby

Modified:
    trunk/changelog
    trunk/data/about.cfg
    trunk/src/multiplayer_lobby.cpp
    trunk/src/multiplayer_lobby.hpp
    trunk/src/preferences.cpp
    trunk/src/preferences.hpp
    trunk/src/preferences_display.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Sep 22 12:02:13 2006
@@ -16,6 +16,7 @@
    * unit Art
      * added a recruit animation to the skeleton
  * user interface
+   * add an option to hide minimaps in the multiplayer lobby
    * add save map items in menu to save in game map
    * add turbo speed setting and change ui according to
    * turn bell moved to sound tab in prefereces
@@ -70,7 +71,7 @@
    * removed manpages (outdated): Hungarian.
  * other:
    * --validcache runtime switch to force assumption that cache is valid
-       
+
 Version 1.1.7:
  * campaigns
    * Heir to the Throne

Modified: trunk/data/about.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/about.cfg?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/data/about.cfg (original)
+++ trunk/data/about.cfg Fri Sep 22 12:02:13 2006
@@ -544,7 +544,7 @@
 [about]
 title = _ "Valencian Translation"
 text = "
-Mario Rodríguez (Mavorte)
+Mario Rodr�uez (Mavorte)
 "
 [/about]
 
@@ -562,7 +562,7 @@
 Joshua Hudson
 Paul Smedley (Creeping)
 Andrea Palmatè (afxgroup)
-EdB
+Serge Martin (EdB)
 Jim Carroll (Jimm)
 Petr Sobotka (Pietro)
 Stéphane Gimenez (gim)

Modified: trunk/src/multiplayer_lobby.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_lobby.cpp?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/src/multiplayer_lobby.cpp (original)
+++ trunk/src/multiplayer_lobby.cpp Fri Sep 22 12:02:13 2006
@@ -114,10 +114,11 @@
        //bg_restore(item_rect);
        //draw_solid_tinted_rectangle(item_rect.x, item_rect.y, item_rect.w, 
item_rect.h, 0, 0, 0, 0.2, video().getSurface());
 
-       // draw mini map
-       video().blit_surface(xpos, ypos, game.mini_map);
-
-       xpos += item_height_ + margin_;
+       //draw minimaps
+       if (minimaps_) {
+               video().blit_surface(xpos, ypos, game.mini_map);
+               xpos += item_height_ + margin_;
+       }
 
        // draw game name
        const surface 
name_surf(font::get_rendered_text(font::make_text_ellipsis(game.name, 
font::SIZE_PLUS, (item_rect.x + item_rect.w) - xpos - margin_), 
font::SIZE_PLUS, game.vacant_slots > 0 ? font::GOOD_COLOUR : game.observers ? 
font::NORMAL_COLOUR : font::BAD_COLOUR));
@@ -287,6 +288,9 @@
 }
 void gamebrowser::set_game_items(const config& cfg, const config& 
game_config)
 {
+       //if you change lobby_minimaps setting, content will be update on 
lobby update
+       minimaps_ = preferences::show_lobby_minimaps();
+
        games_.clear();
        config::child_list games = cfg.get_children("game");
        config::child_iterator game;
@@ -307,7 +311,8 @@
                if(games_.back().map_data != "") {
                        try {
                                gamemap map(game_config, 
games_.back().map_data);
-                               games_.back().mini_map = 
image::getMinimap(item_height_ - margin_, item_height_ - 2 * margin_, map, 0);
+                               if (minimaps_)
+                                       games_.back().mini_map = 
image::getMinimap(item_height_ - margin_, item_height_ - 2 * margin_, map, 0);
                                games_.back().map_info += " - " + 
lexical_cast_default<std::string, int>(map.x(), "??") + std::string("x") + 
lexical_cast_default<std::string, int>(map.y(), "??");
                        } catch(gamemap::incorrect_format_exception &e) {
                                std::cerr << "illegal map: " << e.msg_ << 
"\n";

Modified: trunk/src/multiplayer_lobby.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_lobby.hpp?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/src/multiplayer_lobby.hpp (original)
+++ trunk/src/multiplayer_lobby.hpp Fri Sep 22 12:02:13 2006
@@ -82,6 +82,7 @@
        bool double_clicked_;
        bool ignore_next_doubleclick_;
        bool last_was_doubleclick_;
+       bool minimaps_;
 };
 
 class lobby : public ui

Modified: trunk/src/preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences.cpp?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/src/preferences.cpp (original)
+++ trunk/src/preferences.cpp Fri Sep 22 12:02:13 2006
@@ -47,6 +47,8 @@
 bool unit_genders = true;
 
 bool fps = false;
+
+bool lobby_minimaps = true;
 
 std::set<std::string> encountered_units_set;
 std::set<std::string> encountered_terrains_set;
@@ -174,6 +176,17 @@
 void save_turbo_speed(int speed)
 {
        prefs["turbo_speed"] = lexical_cast_default<std::string>(speed, "1");
+}
+
+bool show_lobby_minimaps()
+{
+       return lobby_minimaps;
+}
+
+void save_show_lobby_minimaps(bool show)
+{
+       prefs["lobby_minimaps"] = (show ? "yes" : "no");
+       lobby_minimaps = show;
 }
 
 const std::string& language()

Modified: trunk/src/preferences.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences.hpp?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/src/preferences.hpp (original)
+++ trunk/src/preferences.hpp Fri Sep 22 12:02:13 2006
@@ -58,6 +58,9 @@
 
        int turbo_speed();
        void save_turbo_speed(const int speed);
+
+       bool show_lobby_minimaps();
+       void save_show_lobby_minimaps(const bool show);
 
        const std::string& language();
        void set_language(const std::string& s);
@@ -214,7 +217,7 @@
 
        std::string client_type();
 
-        std::string clock_format();
+       std::string clock_format();
 
        void set_theme(const std::string& theme);
        const std::string& theme();

Modified: trunk/src/preferences_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences_display.cpp?rev=13626&r1=13625&r2=13626&view=diff
==============================================================================
--- trunk/src/preferences_display.cpp (original)
+++ trunk/src/preferences_display.cpp Fri Sep 22 12:02:13 2006
@@ -48,6 +48,7 @@
        set_fullscreen(fullscreen());
        set_gamma(gamma());
        set_colour_cursors(preferences::get("colour_cursors") == "yes");
+       save_show_lobby_minimaps(preferences::get("lobby_minimaps") == "yes");
 }
 
 display_manager::~display_manager()
@@ -204,8 +205,8 @@
        // change
        gui::slider music_slider_, sound_slider_, bell_slider_, 
scroll_slider_,
                                gamma_slider_, chat_lines_slider_, 
turbo_slider_;
-       gui::button fullscreen_button_, turbo_button_, show_ai_moves_button_,
-                   show_grid_button_, show_lobby_joins_button_, 
show_floating_labels_button_, turn_dialog_button_,
+       gui::button fullscreen_button_, turbo_button_, show_ai_moves_button_, 
show_grid_button_,
+                   lobby_minimaps_button_, show_lobby_joins_button_, 
show_floating_labels_button_, turn_dialog_button_,
                    turn_bell_button_, show_team_colours_button_, 
show_colour_cursors_button_,
                    show_haloing_button_, video_mode_button_, theme_button_, 
hotkeys_button_, gamma_button_,
                                flip_time_button_, advanced_button_, 
sound_button_, music_button_, chat_timestamp_button_;
@@ -232,6 +233,7 @@
          turbo_button_(disp.video(), _("Accelerated Speed"), 
gui::button::TYPE_CHECK),
          show_ai_moves_button_(disp.video(), _("Skip AI Moves"), 
gui::button::TYPE_CHECK),
          show_grid_button_(disp.video(), _("Show Grid"), 
gui::button::TYPE_CHECK),
+         lobby_minimaps_button_(disp.video(), _("Show Lobby Minimaps"), 
gui::button::TYPE_CHECK),
          show_lobby_joins_button_(disp.video(), _("Show Lobby Joins"), 
gui::button::TYPE_CHECK),
          show_floating_labels_button_(disp.video(), _("Show Floating 
Labels"), gui::button::TYPE_CHECK),
          turn_dialog_button_(disp.video(), _("Turn Dialog"), 
gui::button::TYPE_CHECK),
@@ -324,6 +326,9 @@
        show_grid_button_.set_check(grid());
        show_grid_button_.set_help_string(_("Overlay a grid onto the map"));
 
+       lobby_minimaps_button_.set_check(show_lobby_minimaps());
+       lobby_minimaps_button_.set_help_string(_("Show minimaps in the 
multiplayer lobby"));
+
        show_lobby_joins_button_.set_check(lobby_joins());
        show_lobby_joins_button_.set_help_string(_("Show messages about 
players joining the multiplayer lobby"));
 
@@ -370,6 +375,7 @@
        h.push_back(&turbo_button_);
        h.push_back(&show_ai_moves_button_);
        h.push_back(&show_grid_button_);
+       h.push_back(&lobby_minimaps_button_);
        h.push_back(&show_lobby_joins_button_);
        h.push_back(&show_floating_labels_button_);
        h.push_back(&turn_dialog_button_);
@@ -485,7 +491,8 @@
                                                                rect.w - 
slider_label_width_ - right_border, 0 };
        chat_lines_slider_.set_location(chat_lines_rect);
        ypos += item_interline; chat_timestamp_button_.set_location(rect.x, 
ypos);
-       ypos += item_interline; show_lobby_joins_button_.set_location(rect.x, 
ypos);
+       ypos += item_interline; lobby_minimaps_button_.set_location(rect.x, 
ypos);
+       ypos += item_interline; show_lobby_joins_button_.set_location(rect.x, 
ypos);
 
        //Advanced tab
        ypos = rect.y + top_border;
@@ -507,6 +514,8 @@
                set_show_ai_moves(!show_ai_moves_button_.checked());
        if (show_grid_button_.pressed())
                set_grid(show_grid_button_.checked());
+       if (lobby_minimaps_button_.pressed())
+               save_show_lobby_minimaps(lobby_minimaps_button_.checked());
        if (show_lobby_joins_button_.pressed())
                set_lobby_joins(show_lobby_joins_button_.checked());
        if (show_floating_labels_button_.pressed())
@@ -679,6 +688,7 @@
        chat_lines_label_.hide(hide_multiplayer);
        chat_lines_slider_.hide(hide_multiplayer);
        chat_timestamp_button_.hide(hide_multiplayer);
+       lobby_minimaps_button_.hide(hide_multiplayer);
        show_lobby_joins_button_.hide(hide_multiplayer);
 
        const bool hide_advanced = tab_ != ADVANCED_TAB;




Related Messages


Powered by MHonArc, Updated Sat Sep 23 12:01:29 2006