mail[Wesnoth-commits] r24721 - in /trunk: ./ data/themes/ src/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by benoit . timbert on March 16, 2008 - 19:46:
Author: noyga
Date: Sun Mar 16 19:45:59 2008
New Revision: 24721

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24721&view=rev
Log:
ThemeWML: [unit_description] -> [unit_name]
NOTE: the backward compatibility code is broken, i'll try to find after diner 
why

Modified:
    trunk/changelog
    trunk/data/themes/default.cfg
    trunk/data/themes/dfool.cfg
    trunk/data/themes/experimental.cfg
    trunk/src/generate_report.cpp
    trunk/src/reports.cpp
    trunk/src/reports.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar 16 19:45:59 2008
@@ -37,7 +37,10 @@
    * In SingleUnitWML and SideWML, the geneate_description= attribute is
      now generate_name=. generate_description= will still be accepted for 
      backwards compatibility. wmllint can safely do this up-conversion.
-    * it's now possible to specify with loop= how many times a sample
+   * In ThemeWML, the unit_description= attribute is now unit_name=.
+     unit_description= will still be accepted for backwards compatibility.
+     wmllint can safely do this up-conversion. 
+   * it's now possible to specify with loop= how many times a sample
      associated with a sound source should be played
    * new [switch] conditional command
    * new [unit_side] theme element : this is the side of the current unit 
(flag)

Modified: trunk/data/themes/default.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/default.cfg?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/data/themes/default.cfg (original)
+++ trunk/data/themes/default.cfg Sun Mar 16 19:45:59 2008
@@ -399,14 +399,14 @@
                 xanchor=right
                 yanchor=fixed
             [/unit_image]
-            [unit_description]
+            [unit_name]
                 id=unit-description
                 font_size={DEFAULT_FONT_NORMAL}
                 ref=middle-right-panel
                 rect="=+9,=+3,=-2,+18"
                 xanchor=right
                 yanchor=fixed
-            [/unit_description]
+            [/unit_name]
             [unit_type]
                 id=unit-type
                 font_size={DEFAULT_FONT_SMALL}

Modified: trunk/data/themes/dfool.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/dfool.cfg?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/data/themes/dfool.cfg (original)
+++ trunk/data/themes/dfool.cfg Sun Mar 16 19:45:59 2008
@@ -418,14 +418,14 @@
                 xanchor=right
                 yanchor=fixed
             [/unit_image]
-            [unit_description]
+            [unit_name]
                 id=unit-description
                 font_size=14
                 ref=middle-right-panel
                 rect="=+9,=+3,+72,+18"
                 xanchor=right
                 yanchor=fixed
-            [/unit_description]
+            [/unit_name]
             [unit_traits]
                 id=unit-traits
                 font_size=12

Modified: trunk/data/themes/experimental.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/experimental.cfg?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/data/themes/experimental.cfg (original)
+++ trunk/data/themes/experimental.cfg Sun Mar 16 19:45:59 2008
@@ -339,14 +339,14 @@
                 xanchor=right
                 yanchor=fixed
             [/unit_image]
-            [unit_description]
+            [unit_name]
                 id=unit-description
                 font_size={EXPERIMENTAL_FONT_NORMAL}
                 ref=middle-right-panel
                 rect="=+9,=+3,=-2,+18"
                 xanchor=right
                 yanchor=fixed
-            [/unit_description]
+            [/unit_name]
             [unit_type]
                 id=unit-type
                 font_size={EXPERIMENTAL_FONT_SMALL}

Modified: trunk/src/generate_report.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Sun Mar 16 19:45:59 2008
@@ -59,6 +59,11 @@
        std::stringstream str;
 
        switch(type) {
+       // this one is for backward compatibility (should be removed in 
v1.5.3)
+       case UNIT_NAME_OLD: {
+               std::cerr << "warning: ThemeWML [unit_description] tag will 
be removed in 1.5.3, run wmllint on WML defining ";
+               return report(u->second.name(),"",u->second.name());
+       }
        case UNIT_NAME:
                return report(u->second.name(),"",u->second.name());
        case UNIT_TYPE:

Modified: trunk/src/reports.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.cpp?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/src/reports.cpp (original)
+++ trunk/src/reports.cpp Sun Mar 16 19:45:59 2008
@@ -20,7 +20,9 @@
 #include <map>
 
 namespace {
-       const std::string report_names[] = { "unit_description", "unit_type",
+       // the first one is for backward compatibility (should be removed in 
v1.5.3)
+       const std::string report_names[] = { "unit_description", 
+               "unit_name", "unit_type",
                "unit_race", "unit_level", "unit_side", "unit_amla",
                "unit_traits", "unit_status", "unit_alignment", 
"unit_abilities",
                "unit_hp", "unit_xp", "unit_advancement_options", 
"unit_moves",

Modified: trunk/src/reports.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.hpp?rev=24721&r1=24720&r2=24721&view=diff
==============================================================================
--- trunk/src/reports.hpp (original)
+++ trunk/src/reports.hpp Sun Mar 16 19:45:59 2008
@@ -25,8 +25,9 @@
 //this module is responsible for outputting textual reports of
 //various game and unit statistics
 namespace reports {
-
-       enum TYPE { UNIT_NAME, UNIT_TYPE, UNIT_RACE, UNIT_LEVEL,
+       // the first one is for backward compatibility (should be removed in 
v1.5.3)    
+       enum TYPE { UNIT_NAME_OLD, 
+                   UNIT_NAME, UNIT_TYPE, UNIT_RACE, UNIT_LEVEL,
                    UNIT_SIDE, UNIT_AMLA, UNIT_TRAITS, UNIT_STATUS,
                    UNIT_ALIGNMENT, UNIT_ABILITIES, UNIT_HP, UNIT_XP,
                    UNIT_ADVANCEMENT_OPTIONS, UNIT_MOVES, UNIT_WEAPONS,




Related Messages


Powered by MHonArc, Updated Sun Mar 16 20:01:45 2008