changeset 436:2134cb02bbb3

- fixed small bug in object saving - added additional mouselistener for x/y offset manipulation FEATURES: - object offsets can now be saved to the object.xml file (again) - offsets can now be manipulated by using the mousewheel above the x/y offset values
author chewie@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 02 Mar 2010 10:10:59 +0000
parents a00cc3039abb
children e236185eec40
files tools/editor/plugins/ObjectEdit.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tools/editor/plugins/ObjectEdit.py	Thu Feb 25 18:44:41 2010 +0000
+++ b/tools/editor/plugins/ObjectEdit.py	Tue Mar 02 10:10:59 2010 +0000
@@ -35,7 +35,6 @@
 from scripts.events import *
 from scripts.gui.action import Action
 
-
 import os
 try:
 	import xml.etree.cElementTree as ET
@@ -167,9 +166,15 @@
 			'x_offset_up' 		: cbwa(self.change_offset_x, 1),
 			'x_offset_dn' 		: cbwa(self.change_offset_x, -1),
 			
+			'x_offset/mouseWheelMovedUp'	: cbwa(self.change_offset_x, 1),
+			'x_offset/mouseWheelMovedDown': cbwa(self.change_offset_x, -1),
+
 			'y_offset_up' 		: cbwa(self.change_offset_y, 1),
 			'y_offset_dn' 		: cbwa(self.change_offset_y, -1),
 			
+			'y_offset/mouseWheelMovedUp'	: cbwa(self.change_offset_x, 1),
+			'y_offset/mouseWheelMovedDown': cbwa(self.change_offset_x, -1),
+			
 			'use_data'			: self.use_user_data,
 			'change_data'		: self.save_user_data,
 			
@@ -438,16 +443,16 @@
 		self.tree = ET.parse(file)
 		
 		img_lst = self.tree.findall("image")
-		
+
 		# apply changes to the XML structure due to current user settings in the gui
 		for img_tag in img_lst:
-			if img_tag.attrib["direction"] == self._avail_rotations[self._gui_rotation_dropdown._getSelected()]:
+			if img_tag.attrib["direction"] == str(self._avail_rotations[self._gui_rotation_dropdown._getSelected()]):
 				img_tag.attrib["x_offset"] = self._gui_xoffset_textfield._getText()
 				img_tag.attrib["y_offset"] = self._gui_yoffset_textfield._getText()
 				break
 
 		xmlcontent = ET.tostring(self.tree.getroot())
-		
+
 		# save xml data beneath the <?fife type="object"?> definition into the object file
 		tmp = open(file, 'w')
 		tmp.write('<?fife type="object"?>\n')