Author: esr
Date: Tue Oct 14 15:51:55 2008
New Revision: 30161
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30161&view=rev
Log:
trackplacer: fix and document smart insertion.
Modified:
trunk/data/tools/trackplacer
Modified: trunk/data/tools/trackplacer
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30161&r1=30160&r2=30161&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Tue Oct 14 15:51:55 2008
@@ -42,6 +42,8 @@
The Animate button clears the icons off the map and places them with a delay
after each placement, so you can see what order they are drawn in.
The Save button pops up a file selector asking you to supply a filename to
which the track should be saved in .cfg format, as a series of macros suitable
for inclusion in WML. Any other extension than .cfg on the filename will raise
an error.
+
+The rule for adding markers to the track is as follows: if the two markers
closest to the mouse pointer are adjacent on the track, insert the new marker
between them in the track order. Otherwise, append it to the end of the track.
The Help button displays this message.
@@ -197,8 +199,9 @@
closest = neighbors[0]
next_closest = neighbors[1]
# If the neighbors are adjacent, insert between them
- if abs(closest[0] - next_closest[0]) == 1:
- self.track.insert(closest[0], (action, x, y))
+ if abs(closest[0] - next_closest[0]) == 1:
+ self.track.insert(max(closest[0], next_closest[0]), (action,
x, y))
+ return
# Otherwise, append
self.track.append((action, x, y))
def remove(self, x, y):
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits