Author: esr
Date: Mon Oct 13 16:22:06 2008
New Revision: 30116

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30116&view=rev
Log:
trackplacer: can now read track files.

Modified:
    trunk/data/tools/trackplacer

Modified: trunk/data/tools/trackplacer
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30116&r1=30115&r2=30116&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Mon Oct 13 16:22:06 2008
@@ -117,8 +117,8 @@
         if header[0] != 'MAP':
             raise IOException("Missing MAP element.", fp.name, 1)
         else:
-            self.path = header[1]
-        while (i, line) in enumerate(fp):
+            self.mapfile = header[1]
+        for (i, line) in enumerate(fp):
             fields = line.split()
             if len(fields) != 3:
                 raise IOException("Ill-formed track file line.", fp.name, i+1)
@@ -225,7 +225,7 @@
             self.map_width = self.map.get_width()
             self.map_height = self.map.get_height()
             self.map = self.map.render_pixmap_and_mask()[0]
-        except gtk.gobject.Gerror:
+        except:
             self.fatal_error("Error while reading background map %s" % 
self.journey.mapfile)
         # Now get the icons we'll need for scribbling on the map with.
         self.action_dictionary = {}
@@ -380,6 +380,8 @@
         self.pixmap = gtk.gdk.Pixmap(widget.window, width, height)
         self.default_gc = self.drawing_area.get_style().fg_gc[gtk.STATE_NORMAL]
         self.refresh_map()
+        for (action, x, y) in self.journey.track:
+            self.draw_feature(widget, x, y, action)
         return True
 
     def expose_event(self, widget, event):


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to