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

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

[Wesnoth-cvs-commits] wesnoth/src display.cpp unit.cpp


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src display.cpp unit.cpp
Date: Sat, 19 Mar 2005 17:18:19 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/03/19 22:18:19

Modified files:
        src            : display.cpp unit.cpp 

Log message:
        Fixed the traits being read from saves and network with their original
        internationalized name.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.304&tr2=1.305&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.128&tr2=1.129&r1=text&r2=text

Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.304 wesnoth/src/display.cpp:1.305
--- wesnoth/src/display.cpp:1.304       Sat Mar 19 19:48:01 2005
+++ wesnoth/src/display.cpp     Sat Mar 19 22:18:18 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.304 2005/03/19 19:48:01 silene Exp $ */
+/* $Id: display.cpp,v 1.305 2005/03/19 22:18:18 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1300,6 +1300,9 @@
        if (u.can_recruit()) {
                surface 
crown(image::get_image("misc/leader-crown.png",image::SCALED,image::NO_ADJUST_COLOUR));
                if(!crown.null()) {
+                       if(bar_alpha != ftofxp(1.0))
+                               crown = adjust_surface_alpha(crown, bar_alpha);
+
                        SDL_Rect r = {0, 0, crown->w, crown->h};
                        video().blit_surface(xpos,ypos,crown,&r);
                }
@@ -1838,8 +1841,9 @@
                bool upside_down, fixed_t alpha, Uint32 blendto, double 
blend_ratio, double submerged,
                surface ellipse_back, surface ellipse_front)
 {
-       //calculate the y position of the ellipse. It should be the same as the 
y position of the image, unless
-       //the image is partially submerged, in which case the ellipse should 
appear to float 'on top of' the water
+       //calculate the y position of the ellipse. It should be the same as the
+       //y position of the image, unless the image is partially submerged, in
+       //which case the ellipse should appear to float 'on top of' the water
        const int ellipse_ypos = y - (ellipse_back != NULL && submerged > 0.0 ? 
int(double(ellipse_back->h)*submerged) : 0)/2;
        if(ellipse_back != NULL) {
                draw_unit(x,ellipse_ypos,ellipse_back,false,blendto == 0 ? 
alpha : ftofxp(1.0),0,0.0);
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.128 wesnoth/src/unit.cpp:1.129
--- wesnoth/src/unit.cpp:1.128  Thu Mar 10 22:57:23 2005
+++ wesnoth/src/unit.cpp        Sat Mar 19 22:18:18 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.128 2005/03/10 22:57:23 ydirson Exp $ */
+/* $Id: unit.cpp,v 1.129 2005/03/19 22:18:18 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1176,7 +1176,7 @@
                        log_scope("add mod");
                        add_modification(ModificationTypes[i],**j,true);
 
-                       const std::string& name = (**j)["name"];
+                       const std::string& name = (**j)["id"];
                        if(name.empty() == false) {
                                descriptions.push_back(name);
                        }
@@ -1192,7 +1192,20 @@
                        traitsDescription_ += ", ";
                }
 
-               traitsDescription_ += gettext(j->c_str());
+               //traitsDescription_ += gettext(j->c_str());
+               std::vector<config*> possible_traits = type().possible_traits();
+               std::vector<config*>::const_iterator trait;
+
+               for(trait = possible_traits.begin(); trait != 
possible_traits.end(); ++trait) {
+                       if((**trait)["id"] == *j)
+                               break;
+               }
+
+               if(trait == possible_traits.end()) {
+                       traitsDescription_ += *j;
+               } else {
+                       traitsDescription_ += (**trait)["name"];
+               }
        }
 }
 




reply via email to

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