wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src multiplayer_client.cpp multiplayer_...


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src multiplayer_client.cpp multiplayer_...
Date: Wed, 19 Jan 2005 15:47:16 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/01/19 20:47:15

Modified files:
        src            : multiplayer_client.cpp multiplayer_client.hpp 

Log message:
        Fix leader preview pane not being updated on combo change.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.cpp.diff?tr1=1.83&tr2=1.84&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_client.hpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: wesnoth/src/multiplayer_client.cpp
diff -u wesnoth/src/multiplayer_client.cpp:1.83 
wesnoth/src/multiplayer_client.cpp:1.84
--- wesnoth/src/multiplayer_client.cpp:1.83     Tue Jan 18 12:25:21 2005
+++ wesnoth/src/multiplayer_client.cpp  Wed Jan 19 20:47:14 2005
@@ -77,7 +77,7 @@
                        const std::string& team_leader)
                : status(START_GAME), got_side(false), team(team_num),
                  name(team_name), leader(team_leader), disp_(disp),
-                 game_config_(game_config), sides_(cfg), units_data_(data),
+                 sides_(cfg), units_data_(data), game_config_(game_config),
                  cancel_button_(NULL), menu_(NULL)
        {
                SDL_Rect empty_rect = {0,0,0,0};
@@ -684,8 +684,10 @@
        int leader_index = 0;
        for(std::vector<std::string>::const_iterator itor = leaders_.begin();
                        itor != leaders_.end(); ++itor) {
-               if (leader == *itor) 
+               if (leader == *itor) {
                        combo_->set_selected(leader_index);
+                       return;
+               }
                ++leader_index;
        }
 }
@@ -718,7 +720,7 @@
        set_location(leader_pane_position);
 }
 
-void leader_preview_pane::process()
+void leader_preview_pane::process_event()
 {
        if (leader_combo_.changed()) {
                set_dirty();
@@ -731,8 +733,9 @@
 
        surface const screen = disp().video().getSurface();
 
-       const SDL_Rect area = { location().x+leader_pane_border, 
location().y+leader_pane_border,
-                               location().w-leader_pane_border*2, 
location().h-leader_pane_border*2 };
+       SDL_Rect const &loc = location();
+       const SDL_Rect area = { loc.x + leader_pane_border, loc.y + 
leader_pane_border,
+                               loc.w - leader_pane_border * 2, loc.h - 
leader_pane_border * 2 };
        SDL_Rect clip_area = area;
        const clip_rect_setter clipper(screen,clip_area);
 
Index: wesnoth/src/multiplayer_client.hpp
diff -u wesnoth/src/multiplayer_client.hpp:1.7 
wesnoth/src/multiplayer_client.hpp:1.8
--- wesnoth/src/multiplayer_client.hpp:1.7      Sat Nov  6 13:13:15 2004
+++ wesnoth/src/multiplayer_client.hpp  Wed Jan 19 20:47:14 2005
@@ -47,8 +47,8 @@
        std::string get_selected_leader();
 
 private:
-       void draw_contents();
-       void process();
+       virtual void draw_contents();
+       virtual void process_event();
 
        const config::child_list side_list_;
        gui::combo leader_combo_; // Must appear before the leader_list_manager




reply via email to

[Prev in Thread] Current Thread [Next in Thread]