Author: alink
Date: Tue Jul  8 23:43:53 2008
New Revision: 27857

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27857&view=rev
Log:
Also team-color leader and gender combo-box in the "Choose faction" dialog
when joining a MP game

Modified:
    trunk/src/multiplayer_wait.cpp
    trunk/src/multiplayer_wait.hpp

Modified: trunk/src/multiplayer_wait.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_wait.cpp?rev=27857&r1=27856&r2=27857&view=diff
==============================================================================
--- trunk/src/multiplayer_wait.cpp (original)
+++ trunk/src/multiplayer_wait.cpp Tue Jul  8 23:43:53 2008
@@ -46,7 +46,7 @@
 namespace mp {
 
 wait::leader_preview_pane::leader_preview_pane(game_display& disp,
-               const config::child_list& side_list, const std::string& color) :
+               const config::child_list& side_list, int color) :
        gui::preview_pane(disp.video()),
        side_list_(side_list),
        color_(color),
@@ -55,6 +55,7 @@
        leaders_(side_list, &leader_combo_, &gender_combo_),
        selection_(0)
 {
+       leaders_.set_colour(color_);
        set_location(leader_pane_position);
 }
 
@@ -114,11 +115,7 @@
                                utg = ut;
 
                        leader_name = utg->type_name();
-#ifdef LOW_MEM
-                       image = utg->image();
-#else
-                       image = utg->image() + std::string("~RC(") + 
std::string(utg->flag_rgb() + ">" + color_ + ")");
-#endif
+                       image = utg->image() + 
leaders_.get_RC_suffix(utg->flag_rgb());
                }
 
                for(std::vector<std::string>::const_iterator itor = 
recruit_list.begin();
@@ -284,9 +281,10 @@
                                choices.push_back((**side)["name"]);
                        }
 
-                       std::string color = 
(*sides_list[side_choice])["colour"];
-                       if (color.empty())
-                               color = 
lexical_cast<std::string>(side_choice+1);
+                       int color = side_choice;
+                       const std::string color_str = 
(*sides_list[side_choice])["colour"];
+                       if (!color_str.empty())
+                               color = 
game_config::color_info(color_str).index() - 1;
 
                        std::vector<gui::preview_pane* > preview_panes;
                        leader_preview_pane leader_selector(disp(),

Modified: trunk/src/multiplayer_wait.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_wait.hpp?rev=27857&r1=27856&r2=27857&view=diff
==============================================================================
--- trunk/src/multiplayer_wait.hpp (original)
+++ trunk/src/multiplayer_wait.hpp Tue Jul  8 23:43:53 2008
@@ -49,7 +49,7 @@
        {
        public:
                leader_preview_pane(game_display& disp,
-                               const config::child_list& side_list, const 
std::string& color);
+                               const config::child_list& side_list, int color);
 
                bool show_above() const;
                bool left_side() const;
@@ -63,7 +63,7 @@
                virtual void process_event();
 
                const config::child_list side_list_;
-               const std::string color_;
+               const int color_;
                gui::combo leader_combo_; // Must appear before the 
leader_list_manager
                gui::combo gender_combo_; // Must appear before the 
leader_list_manager
                leader_list_manager leaders_;


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

Reply via email to