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

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

[Wesnoth-cvs-commits] wesnoth/src leader_list.cpp leader_list.hpp mul...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src leader_list.cpp leader_list.hpp mul...
Date: Sat, 26 Feb 2005 16:18:15 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/02/26 21:18:15

Modified files:
        src            : leader_list.cpp leader_list.hpp 
                         multiplayer_wait.cpp 
        src/widgets    : scrollarea.cpp scrollbar.cpp scrollbar.hpp 

Log message:
        * Made the MP "wait" screen display the image for the random leader for 
sides
        where the leader is set to random.
        
        * Fixed a bug where the textbox did not have scrollboxes anyway (cvs 
internal)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/leader_list.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/leader_list.hpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_wait.cpp.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/scrollarea.cpp.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/scrollbar.cpp.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/scrollbar.hpp.diff?tr1=1.15&tr2=1.16&r1=text&r2=text

Patches:
Index: wesnoth/src/leader_list.cpp
diff -u wesnoth/src/leader_list.cpp:1.3 wesnoth/src/leader_list.cpp:1.4
--- wesnoth/src/leader_list.cpp:1.3     Fri Feb 25 01:07:19 2005
+++ wesnoth/src/leader_list.cpp Sat Feb 26 21:18:14 2005
@@ -1,4 +1,4 @@
-/* $Id: leader_list.cpp,v 1.3 2005/02/25 01:07:19 ydirson Exp $ */
+/* $Id: leader_list.cpp,v 1.4 2005/02/26 21:18:14 gruikya Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -16,6 +16,8 @@
 #include "serialization/string_utils.hpp"
 #include "widgets/menu.hpp"
 
+const std::string 
leader_list_manager::random_enemy_picture("random-enemy.png");
+
 leader_list_manager::leader_list_manager(const config::child_list& side_list,
                const game_data* data, gui::combo* combo) :
        side_list_(side_list), data_(data), combo_(combo)
@@ -90,7 +92,7 @@
 
        leaders_.push_back("random");
        // FIXME: Maybe this should not code into the code.
-       leader_strings.push_back(IMAGE_PREFIX + std::string("random-enemy.png") 
+
+       leader_strings.push_back(IMAGE_PREFIX + random_enemy_picture +
                                 COLUMN_SEPARATOR + _("Random"));
 
        if(combo_ != NULL) {
Index: wesnoth/src/leader_list.hpp
diff -u wesnoth/src/leader_list.hpp:1.1 wesnoth/src/leader_list.hpp:1.2
--- wesnoth/src/leader_list.hpp:1.1     Sun Feb 20 22:30:27 2005
+++ wesnoth/src/leader_list.hpp Sat Feb 26 21:18:14 2005
@@ -1,4 +1,4 @@
-/* $Id: leader_list.hpp,v 1.1 2005/02/20 22:30:27 gruikya Exp $ */
+/* $Id: leader_list.hpp,v 1.2 2005/02/26 21:18:14 gruikya Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -22,6 +22,8 @@
 class leader_list_manager
 {
 public:
+       static const std::string random_enemy_picture;
+
        leader_list_manager(const config::child_list& side_list, const 
game_data* data,
                        gui::combo* combo = NULL);
 
Index: wesnoth/src/multiplayer_wait.cpp
diff -u wesnoth/src/multiplayer_wait.cpp:1.4 
wesnoth/src/multiplayer_wait.cpp:1.5
--- wesnoth/src/multiplayer_wait.cpp:1.4        Fri Feb 25 01:07:19 2005
+++ wesnoth/src/multiplayer_wait.cpp    Sat Feb 26 21:18:14 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_wait.cpp,v 1.4 2005/02/25 01:07:19 ydirson Exp $ */
+/* $Id: multiplayer_wait.cpp,v 1.5 2005/02/26 21:18:14 gruikya Exp $ */
 /*
    Copyright (C) 
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -374,6 +374,8 @@
                if (utypes.find(leader_type) != utypes.end()) {
                        leader_name = 
utypes.find(leader_type)->second.language_name();
                        leader_image = utypes.find(leader_type)->second.image();
+               } else {
+                       leader_image = 
leader_list_manager::random_enemy_picture;
                }
                if (!leader_image.empty()) {
                        // Dumps the "image" part of the faction name, if any,
Index: wesnoth/src/widgets/scrollarea.cpp
diff -u wesnoth/src/widgets/scrollarea.cpp:1.9 
wesnoth/src/widgets/scrollarea.cpp:1.10
--- wesnoth/src/widgets/scrollarea.cpp:1.9      Sat Feb 26 18:10:01 2005
+++ wesnoth/src/widgets/scrollarea.cpp  Sat Feb 26 21:18:15 2005
@@ -1,4 +1,4 @@
-/* $Id: scrollarea.cpp,v 1.9 2005/02/26 18:10:01 gruikya Exp $*/
+/* $Id: scrollarea.cpp,v 1.10 2005/02/26 21:18:15 gruikya Exp $*/
 /*
    Copyright (C) 2004 by Guillaume Melquiond <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -31,7 +31,7 @@
 
 bool scrollarea::has_scrollbar() const
 {
-       return scrollbar_.grip_height_ < scrollbar_.full_height_ && 
scrollbar_.has_valid_size();
+       return scrollbar_.grip_height_ < scrollbar_.full_height_ && 
scrollbar_.is_valid_height(location().h);
 }
 
 void scrollarea::update_location(SDL_Rect const &rect)
Index: wesnoth/src/widgets/scrollbar.cpp
diff -u wesnoth/src/widgets/scrollbar.cpp:1.27 
wesnoth/src/widgets/scrollbar.cpp:1.28
--- wesnoth/src/widgets/scrollbar.cpp:1.27      Sat Feb 26 18:10:02 2005
+++ wesnoth/src/widgets/scrollbar.cpp   Sat Feb 26 21:18:15 2005
@@ -1,4 +1,4 @@
-/* $Id: scrollbar.cpp,v 1.27 2005/02/26 18:10:02 gruikya Exp $*/
+/* $Id: scrollbar.cpp,v 1.28 2005/02/26 21:18:15 gruikya Exp $*/
 /*
    Copyright (C) 2003 by David White <address@hidden>
                  2004 by Guillaume Melquiond <address@hidden>
@@ -138,11 +138,11 @@
        scroll_rate_ = r;
 }
 
-bool scrollbar::has_valid_size() const
+bool scrollbar::is_valid_height(int height) const
 {
        int uh = uparrow_.height();
        int dh = downarrow_.height();
-       if(uh + dh >= location().h) {
+       if(uh + dh >= height) {
                return false;
        } else {
                return true;
Index: wesnoth/src/widgets/scrollbar.hpp
diff -u wesnoth/src/widgets/scrollbar.hpp:1.15 
wesnoth/src/widgets/scrollbar.hpp:1.16
--- wesnoth/src/widgets/scrollbar.hpp:1.15      Sat Feb 26 18:10:02 2005
+++ wesnoth/src/widgets/scrollbar.hpp   Sat Feb 26 21:18:15 2005
@@ -1,4 +1,4 @@
-/* $Id: scrollbar.hpp,v 1.15 2005/02/26 18:10:02 gruikya Exp $ */
+/* $Id: scrollbar.hpp,v 1.16 2005/02/26 21:18:15 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
                  2004 by Guillaume Melquiond <address@hidden>
@@ -61,7 +61,7 @@
        void set_scroll_rate(unsigned r);
 
        /// Return true if the scrollbar has a valid size.
-       bool has_valid_size() const;
+       bool is_valid_height(int height) const;
 
 protected:
        virtual void update_location(SDL_Rect const &rect);




reply via email to

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