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

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

[Wesnoth-cvs-commits] wesnoth/src reports.cpp unit_types.cpp unit_typ...


From: Isaac Clerencia
Subject: [Wesnoth-cvs-commits] wesnoth/src reports.cpp unit_types.cpp unit_typ...
Date: Sat, 28 Aug 2004 10:38:50 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Isaac Clerencia <address@hidden>        04/08/28 14:34:00

Modified files:
        src            : reports.cpp unit_types.cpp unit_types.hpp 

Log message:
        Fix alignment and abilities not being shown in panel

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/reports.cpp.diff?tr1=1.43&tr2=1.44&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.cpp.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.hpp.diff?tr1=1.48&tr2=1.49&r1=text&r2=text

Patches:
Index: wesnoth/src/reports.cpp
diff -u wesnoth/src/reports.cpp:1.43 wesnoth/src/reports.cpp:1.44
--- wesnoth/src/reports.cpp:1.43        Tue Aug 24 19:49:35 2004
+++ wesnoth/src/reports.cpp     Sat Aug 28 14:34:00 2004
@@ -127,18 +127,19 @@
        }
        case UNIT_ALIGNMENT: {
                const std::string& align = 
unit_type::alignment_description(u->second.type().alignment());
-               return report(string_table[align],"",string_table[align + 
"_description"]);
+               const std::string& align_id = 
unit_type::alignment_id(u->second.type().alignment());
+               return report(align,"",sgettext(string_table[align_id + 
"_description"].c_str()));
        }
        case UNIT_ABILITIES: {
                report res;
                std::stringstream tooltip;
                const std::vector<std::string>& abilities = 
u->second.type().abilities();
                for(std::vector<std::string>::const_iterator i = 
abilities.begin(); i != abilities.end(); ++i) {
-                       str << string_table[*i];
+                       str << sgettext(i->c_str());
                        if(i+1 != abilities.end())
                                str << ",";
 
-                       tooltip << string_table[*i + "_description"];
+                       tooltip << sgettext(string_table[*i + 
"_description"].c_str());
                        res.add_text(str,tooltip);
                }
 
Index: wesnoth/src/unit_types.cpp
diff -u wesnoth/src/unit_types.cpp:1.61 wesnoth/src/unit_types.cpp:1.62
--- wesnoth/src/unit_types.cpp:1.61     Wed Aug 25 02:59:51 2004
+++ wesnoth/src/unit_types.cpp  Sat Aug 28 14:34:00 2004
@@ -1,4 +1,4 @@
-/* $Id: unit_types.cpp,v 1.61 2004/08/25 02:59:51 Sirp Exp $ */
+/* $Id: unit_types.cpp,v 1.62 2004/08/28 14:34:00 isaaccp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -859,10 +859,16 @@
 
 const char* unit_type::alignment_description(unit_type::ALIGNMENT align)
 {
-       static const char* aligns[] = { N_("Lawful"), N_("Neutral"), 
N_("Chaotic") };
+       static const char* aligns[] = { N_("lawful"), N_("neutral"), 
N_("chaotic") };
        return (gettext(aligns[align]));
 }
 
+const char* unit_type::alignment_id(unit_type::ALIGNMENT align)
+{
+       static const char* aligns[] = { "lawful", "neutral", "chaotic" };
+       return (aligns[align]);
+}
+
 double unit_type::alpha() const
 {
        return alpha_;
Index: wesnoth/src/unit_types.hpp
diff -u wesnoth/src/unit_types.hpp:1.48 wesnoth/src/unit_types.hpp:1.49
--- wesnoth/src/unit_types.hpp:1.48     Sat Aug 28 04:51:51 2004
+++ wesnoth/src/unit_types.hpp  Sat Aug 28 14:34:00 2004
@@ -1,4 +1,4 @@
-/* $Id: unit_types.hpp,v 1.48 2004/08/28 04:51:51 Sirp Exp $ */
+/* $Id: unit_types.hpp,v 1.49 2004/08/28 14:34:00 isaaccp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -209,6 +209,7 @@
 
        ALIGNMENT alignment() const;
        static const char* alignment_description(ALIGNMENT align);
+       static const char* alignment_id(ALIGNMENT align);
 
        double alpha() const;
 




reply via email to

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