mail[Wesnoth-commits] r33594 - /trunk/data/tools/wmlunits


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

Header


Content

Posted by soliton . de on March 13, 2009 - 11:14:
Author: soliton
Date: Fri Mar 13 11:14:10 2009
New Revision: 33594

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33594&view=rev
Log:
parse addons first so mainline units overwrite user made units with the same 
ID and not the other way around

Modified:
    trunk/data/tools/wmlunits

Modified: trunk/data/tools/wmlunits
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlunits?rev=33594&r1=33593&r2=33594&view=diff
==============================================================================
--- trunk/data/tools/wmlunits (original)
+++ trunk/data/tools/wmlunits Fri Mar 13 11:14:10 2009
@@ -872,6 +872,28 @@
     for c in stuff.campaign_lookup.keys():
         stuff.is_mainline_campaign[c] = True
 
+    print "Parsing addons ...",
+    sys.stdout.flush()
+    n = stuff.add_addons(image_collector)
+    print "%d units found." % n
+
+    # Now we read each addon campaign in turn to get its units.
+    cnames = stuff.campaign_lookup.keys()
+    for cname in cnames:
+        if cname in stuff.is_mainline_campaign: continue
+        campaign = stuff.campaign_lookup[cname]
+        print "Parsing %s units ..." % cname,
+        sys.stdout.flush()
+
+        define = campaign.get_text_val("define")
+        WML = stuff.parser.parse("""
+            #define %s\n#enddef
+            {~campaigns}""" % define,
+            ignore_macros = lambda x: x.find("/scenarios") == -1)
+        n = stuff.add_units(WML, cname)
+        image_collector.add_binary_pathes_from_WML(cname, WML)
+        print n, "units found."
+
     # Parse all unit data
     # This reads in units.cfg, giving us all the mainline units.
     print "Parsing mainline units ...",
@@ -894,29 +916,7 @@
         n = stuff.add_units(WML, cname)
         image_collector.add_binary_pathes_from_WML(cname, WML)
         print n, "units found."
-
     sys.stderr.flush()
-    print "Parsing addons ...",
-    sys.stdout.flush()
-    n = stuff.add_addons(image_collector)
-    print "%d units found." % n
-    
-    # Now we read each addon campaign in turn to get its units.
-    cnames = stuff.campaign_lookup.keys()
-    for cname in cnames:
-        if cname in stuff.is_mainline_campaign: continue
-        campaign = stuff.campaign_lookup[cname]
-        print "Parsing %s units ..." % cname,
-        sys.stdout.flush()
-
-        define = campaign.get_text_val("define")
-        WML = stuff.parser.parse("""
-            #define %s\n#enddef
-            {~campaigns}""" % define,
-            ignore_macros = lambda x: x.find("/scenarios") == -1)
-        n = stuff.add_units(WML, cname)
-        image_collector.add_binary_pathes_from_WML(cname, WML)
-        print n, "units found."
 
     stuff.find_unit_factions()
 




Related Messages


Powered by MHonArc, Updated Fri Mar 13 12:40:19 2009