changeset 308:af0b233e246f

- added a workaround for the rotation issue of groundtiles in rio de hola maps
author chewie@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 11 Aug 2009 17:08:21 +0000
parents 22253b2c9b14
children f6b67f424ad2
files clients/editor/plugins/ObjectEdit.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/clients/editor/plugins/ObjectEdit.py	Tue Aug 11 15:32:54 2009 +0000
+++ b/clients/editor/plugins/ObjectEdit.py	Tue Aug 11 17:08:21 2009 +0000
@@ -312,8 +312,14 @@
 		})
 		
 		if not self._animation:
-			index = self._avail_rotations.index( self._fixed_rotation )
-			self._gui_rotation_dropdown._setSelected(index)
+			if self._fixed_rotation in self._avail_rotations:
+				index = self._avail_rotations.index( self._fixed_rotation )
+				self._gui_rotation_dropdown._setSelected(index)
+			else:
+				print "Internal FIFE rotation: ", self._instances[0].getRotation()
+				print "Fixed rotation (cam rot) ", self._fixed_rotation + int(abs(self._camera.getRotation()))
+				print "Collected rots from object ", self._avail_rotations
+				
 
 		self.container.adaptLayout()			
 		
@@ -561,7 +567,7 @@
 #		print "Camera rotation: ", self._camera.getRotation()
 #		print "Instance rotation: ", instance.getRotation()
 
-		self._fixed_rotation = int(instance.getRotation() + abs( self._camera.getTilt() ) )		
+#		self._fixed_rotation = int(instance.getRotation() + abs( self._camera.getRotation() ) )		
 		self._fixed_rotation = instance.getRotation()
 #		self._fixed_rotation = visual.getClosestMatchingAngle(self._fixed_rotation)	
 
@@ -597,6 +603,7 @@
 		if not self._animation:
 			rotations = visual.getStaticImageAngles()
 			for angle in rotations:
+#				angle += int(abs( self._camera.getRotation() ))
 				self._avail_rotations.append(angle)
 	
 			self._image_default_x_offset = self._image.getXShift()
@@ -639,7 +646,6 @@
 					self.highlight_selected_instance()
 					self.get_instance_data()
 					self.update_gui()
-					self.container.adaptLayout()
 					self.container.show()
 				else:
 					self._reset()