comparison clients/editor/plugins/ObjectEdit.py @ 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 6add14ebe9f5
comparison
equal deleted inserted replaced
307:22253b2c9b14 308:af0b233e246f
310 'object_blocking' : unicode( self._blocking ), 310 'object_blocking' : unicode( self._blocking ),
311 'object_static' : unicode( self._static ), 311 'object_static' : unicode( self._static ),
312 }) 312 })
313 313
314 if not self._animation: 314 if not self._animation:
315 index = self._avail_rotations.index( self._fixed_rotation ) 315 if self._fixed_rotation in self._avail_rotations:
316 self._gui_rotation_dropdown._setSelected(index) 316 index = self._avail_rotations.index( self._fixed_rotation )
317 self._gui_rotation_dropdown._setSelected(index)
318 else:
319 print "Internal FIFE rotation: ", self._instances[0].getRotation()
320 print "Fixed rotation (cam rot) ", self._fixed_rotation + int(abs(self._camera.getRotation()))
321 print "Collected rots from object ", self._avail_rotations
322
317 323
318 self.container.adaptLayout() 324 self.container.adaptLayout()
319 325
320 def toggle_gui(self): 326 def toggle_gui(self):
321 """ 327 """
559 565
560 # print "Camera tilt: ", self._camera.getTilt() 566 # print "Camera tilt: ", self._camera.getTilt()
561 # print "Camera rotation: ", self._camera.getRotation() 567 # print "Camera rotation: ", self._camera.getRotation()
562 # print "Instance rotation: ", instance.getRotation() 568 # print "Instance rotation: ", instance.getRotation()
563 569
564 self._fixed_rotation = int(instance.getRotation() + abs( self._camera.getTilt() ) ) 570 # self._fixed_rotation = int(instance.getRotation() + abs( self._camera.getRotation() ) )
565 self._fixed_rotation = instance.getRotation() 571 self._fixed_rotation = instance.getRotation()
566 # self._fixed_rotation = visual.getClosestMatchingAngle(self._fixed_rotation) 572 # self._fixed_rotation = visual.getClosestMatchingAngle(self._fixed_rotation)
567 573
568 index = visual.getStaticImageIndexByAngle(self._fixed_rotation) 574 index = visual.getStaticImageIndexByAngle(self._fixed_rotation)
569 575
595 self._image = self.imagepool.getImage(index) 601 self._image = self.imagepool.getImage(index)
596 602
597 if not self._animation: 603 if not self._animation:
598 rotations = visual.getStaticImageAngles() 604 rotations = visual.getStaticImageAngles()
599 for angle in rotations: 605 for angle in rotations:
606 # angle += int(abs( self._camera.getRotation() ))
600 self._avail_rotations.append(angle) 607 self._avail_rotations.append(angle)
601 608
602 self._image_default_x_offset = self._image.getXShift() 609 self._image_default_x_offset = self._image.getXShift()
603 self._image_default_y_offset = self._image.getYShift() 610 self._image_default_y_offset = self._image.getYShift()
604 else: 611 else:
637 644
638 if self._instances != (): 645 if self._instances != ():
639 self.highlight_selected_instance() 646 self.highlight_selected_instance()
640 self.get_instance_data() 647 self.get_instance_data()
641 self.update_gui() 648 self.update_gui()
642 self.container.adaptLayout()
643 self.container.show() 649 self.container.show()
644 else: 650 else:
645 self._reset() 651 self._reset()
646 self.container.hide() 652 self.container.hide()
647 653