# HG changeset patch # User chewie@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1267524659 0 # Node ID 2134cb02bbb34e532b9baf6882397110e4927b72 # Parent a00cc3039abb24c0c96486fea38564084daf1a27 - 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 diff -r a00cc3039abb -r 2134cb02bbb3 tools/editor/plugins/ObjectEdit.py --- 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 definition into the object file tmp = open(file, 'w') tmp.write('\n')