# HG changeset patch # User Simon Cross # Date 1378578378 -7200 # Node ID 9868bc79a6ff4305997b23737f065664485208e7 # Parent 846aacf92d59a06014403700b242e15ed4c1e596 Move polys. diff -r 846aacf92d59 -r 9868bc79a6ff tools/area_editor.py --- 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()