changeset 523:9868bc79a6ff

Move polys.
author Simon Cross <hodgestar@gmail.com>
date Sat, 07 Sep 2013 20:26:18 +0200
parents 846aacf92d59
children 011a087c4370
files tools/area_editor.py
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tools/area_editor.py	Sat Sep 07 19:51:07 2013 +0200
+++ b/tools/area_editor.py	Sat Sep 07 20:26:18 2013 +0200
@@ -871,8 +871,18 @@
     def _update_pos(self, obj, new_pos):
         data = self.level.lookup[obj]
         new_coords = self.level.point_to_pymunk(new_pos)
-        data['args'][0][0] = new_coords[0]
-        data['args'][0][1] = new_coords[1]
+        args = data['args']
+        old_coords = list(args[0])
+        args[0][0] = new_coords[0]
+        args[0][1] = new_coords[1]
+        param_defs = obj.requires()[1:]  # chop off name
+        for i, (_key, key_type) in enumerate(param_defs):
+            if i > len(args):
+                break
+            if key_type == "polygon (convex)":
+                args[i] = self.level.translate_poly(
+                    args[i], old_coords, new_coords)
+                print args[i]
         self.level.reset_objs()
         self.invalidate()