Changeset 3482
- Timestamp:
- 10/21/10 16:31:27 (3 years ago)
- Location:
- branches/active/light
- Files:
-
- 1 added
- 4 edited
-
engine/python/fife/extensions/savers.py (modified) (2 diffs)
-
engine/python/fife/extensions/serializers/xml_loader_tools.py (added)
-
engine/python/fife/extensions/serializers/xmlmap.py (modified) (2 diffs)
-
tools/editor/gui/simplelightedit.xml (modified) (2 diffs)
-
tools/editor/plugins/SimpleLightEdit.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/active/light/engine/python/fife/extensions/savers.py
r3481 r3482 289 289 img = self.pool.getImage(info.getId()); 290 290 name = img.getResourceFile() 291 attr_vals[(None, 'image')] = str( name)291 attr_vals[(None, 'image')] = str('../' + name) 292 292 attr_names[(None, 'image')] = 'image' 293 293 294 294 elif type == 'animation': 295 295 if info.getId() == -1: continue 296 ani = self.anim_pool.getAnimation(info.getId()); 297 dur = 0 296 ani = self.anim_pool.getAnimation(info.getId()); 298 297 count = 0 299 298 newstr = '' 300 for i in range(ani.getNumFrames()): 301 dur += ani.getFrameDuration(i) 302 if i == ani.getActionFrame(): 303 break 304 305 image = ani.getFrameByTimestamp(dur) 299 image = ani.getFrame(ani.getActionFrame()) 306 300 fname = image.getResourceFile() 307 301 strings = ([str(s) for s in fname.split('/')]) … … 311 305 count += 1 312 306 313 name = str( newstr + 'animation.' + fileExtensions)307 name = str('../' + newstr + 'animation.' + fileExtensions[0]) 314 308 attr_vals[(None, 'animation')] = str(name) 315 309 attr_names[(None, 'animation')] = 'animation' -
branches/active/light/engine/python/fife/extensions/serializers/xmlmap.py
r3481 r3482 356 356 continue 357 357 node['type'] = 'image' 358 #imgfile = str(image)358 image = reverse_root_subfile(self.source, image) 359 359 img_id = self.pool.addResourceFromFile(image) 360 360 node['image'] = int(img_id) … … 365 365 continue 366 366 node['type'] = 'animation' 367 #anifile = str(animation)367 animation = reverse_root_subfile(self.source, animation) 368 368 rloc = fife.ResourceLocation(animation) 369 369 ani_id = self.anim_pool.addResourceFromLocation(rloc) -
branches/active/light/tools/editor/gui/simplelightedit.xml
r3368 r3482 47 47 48 48 <HBox> 49 <Label text="X-Shift: " min_size="25,20"/>50 <TextBox text="0" name="xshift" size="30,20" min_size="30,20" max_size="30,20"/>51 <Button name="xshift_up" text="+" max_size="20,20"/>52 <Button name="xshift_dn" text="-" max_size="20,20"/>53 </HBox>54 55 <HBox>56 <Label text="Y-Shift: " min_size="25,20"/>57 <TextBox text="0" name="yshift" size="30,20" min_size="30,20" max_size="30,20"/>58 <Button name="yshift_up" text="+" max_size="20,20"/>59 <Button name="yshift_dn" text="-" max_size="20,20"/>60 </HBox>61 62 <HBox>63 49 <Label text="X-Stretch: " min_size="25,20"/> 64 50 <TextBox text="1" name="xstretch" size="30,20" min_size="30,20" max_size="30,20"/> … … 93 79 </VBox> 94 80 95 <!--<VBox>96 <Label text="Preferences" min_size="45,20"/>97 <HBox>98 <Label text="Intensity: " min_size="25,20"/>99 <TextBox text="0.00" name="intensity" size="30,20" min_size="30,20" max_size="30,20" />100 --><!--<Button name="intensity_up" text="+" max_size="20,20"/>--><!--101 <Button name="intensity_dn" text="-" max_size="20,20"/>102 <Slider position="10,42" size="100,10" orientation="0" name="intensity_up" scale_start="0" scale_end="1000"/>103 --><!--<Slider position="10,42" size="100,10" name="intensity_up" orientation="0" scale_start="0.0" scale_end="1.0" base_color="93,161,102" />--><!--104 </HBox>105 106 <HBox>107 <Label text="R: " min_size="25,20"/>108 <TextBox text="0.0" name="red" size="30,20" min_size="30,20" max_size="30,20"/>109 <Button name="red_up" text="+" max_size="20,20"/>110 <Button name="red_dn" text="-" max_size="20,20"/>111 </HBox>112 113 <HBox>114 <Label text="G: " min_size="25,20"/>115 <TextBox text="0.0" name="green" size="30,20" min_size="30,20" max_size="30,20"/>116 <Button name="green_up" text="+" max_size="20,20"/>117 <Button name="green_dn" text="-" max_size="20,20"/>118 </HBox>119 120 <HBox>121 <Label text="B: " min_size="25,20"/>122 <TextBox text="0.0" name="blue" size="30,20" min_size="30,20" max_size="30,20"/>123 <Button name="blue_up" text="+" max_size="20,20"/>124 <Button name="blue_dn" text="-" max_size="20,20"/>125 </HBox>126 127 <HBox>128 <Label text="Radius: " min_size="25,20"/>129 <TextBox text="0" name="radius" size="30,20" min_size="30,20" max_size="30,20"/>130 <Button name="radius_up" text="+" max_size="20,20"/>131 <Button name="radius_dn" text="-" max_size="20,20"/>132 </HBox>133 </VBox>-->134 135 136 81 </Panel> -
branches/active/light/tools/editor/plugins/SimpleLightEdit.py
r3481 r3482 83 83 self._light["xstretch"] = 1 84 84 self._light["ystretch"] = 1 85 self._light["xshift"] = 086 self._light["yshift"] = 087 85 self._light["src"] = -1 88 86 self._light["dst"] = -1 … … 144 142 "reset" : self.reset_simple_light, 145 143 146 "intensity_up" : cbwa(self.change_light, value= 0.01, option="intensity"),147 "intensity_dn" : cbwa(self.change_light, value=- 0.01, option="intensity"),148 "intensity/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="intensity"),149 "intensity/mouseWheelMovedDown" : cbwa(self.change_light, value=- 0.1, option="intensity"),144 "intensity_up" : cbwa(self.change_light, value=1, option="intensity"), 145 "intensity_dn" : cbwa(self.change_light, value=-1, option="intensity"), 146 "intensity/mouseWheelMovedUp" : cbwa(self.change_light, value=10, option="intensity"), 147 "intensity/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="intensity"), 150 148 151 149 "radius_up" : cbwa(self.change_light, value= 1, option="radius"), … … 159 157 "subdivisions/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="subdivisions"), 160 158 161 "xshift_up" : cbwa(self.change_light, value= 1, option="xshift"),162 "xshift_dn" : cbwa(self.change_light, value=-1, option="xshift"),163 "xshift/mouseWheelMovedUp" : cbwa(self.change_light, value= 1, option="xshift"),164 "xshift/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="xshift"),165 166 "yshift_up" : cbwa(self.change_light, value= 1, option="yshift"),167 "yshift_dn" : cbwa(self.change_light, value=-1, option="yshift"),168 "yshift/mouseWheelMovedUp" : cbwa(self.change_light, value= 1, option="yshift"),169 "yshift/mouseWheelMovedDown" : cbwa(self.change_light, value=-1, option="yshift"),170 171 159 "xstretch_up" : cbwa(self.change_light, value= 0.01, option="xstretch"), 172 160 "xstretch_dn" : cbwa(self.change_light, value=-0.01, option="xstretch"), … … 179 167 "ystretch/mouseWheelMovedDown" : cbwa(self.change_light, value=-0.1, option="ystretch"), 180 168 181 "red_up" : cbwa(self.change_light, value= 0.01, option="red"),182 "red_dn" : cbwa(self.change_light, value=- 0.01, option="red"),183 "red/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="red"),184 "red/mouseWheelMovedDown" : cbwa(self.change_light, value=- 0.1, option="red"),185 186 "green_up" : cbwa(self.change_light, value= 0.01, option="green"),187 "green_dn" : cbwa(self.change_light, value=- 0.01, option="green"),188 "green/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="green"),189 "green/mouseWheelMovedDown" : cbwa(self.change_light, value=- 0.1, option="green"),190 191 "blue_up" : cbwa(self.change_light, value= 0.01, option="blue"),192 "blue_dn" : cbwa(self.change_light, value=- 0.01, option="blue"),193 "blue/mouseWheelMovedUp" : cbwa(self.change_light, value= 0.1, option="blue"),194 "blue/mouseWheelMovedDown" : cbwa(self.change_light, value=- 0.1, option="blue"),169 "red_up" : cbwa(self.change_light, value= 1, option="red"), 170 "red_dn" : cbwa(self.change_light, value=-1, option="red"), 171 "red/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="red"), 172 "red/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="red"), 173 174 "green_up" : cbwa(self.change_light, value= 1, option="green"), 175 "green_dn" : cbwa(self.change_light, value=-1, option="green"), 176 "green/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="green"), 177 "green/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="green"), 178 179 "blue_up" : cbwa(self.change_light, value= 1, option="blue"), 180 "blue_dn" : cbwa(self.change_light, value=-1, option="blue"), 181 "blue/mouseWheelMovedUp" : cbwa(self.change_light, value= 10, option="blue"), 182 "blue/mouseWheelMovedDown" : cbwa(self.change_light, value=-10, option="blue"), 195 183 196 184 "src_up" : cbwa(self.change_light, value= 1, option="src"), … … 215 203 "xstretch" : self.container.findChild(name="xstretch"), 216 204 "ystretch" : self.container.findChild(name="ystretch"), 217 "xshift" : self.container.findChild(name="xshift"),218 "yshift" : self.container.findChild(name="yshift"),219 205 "src" : self.container.findChild(name="src"), 220 206 "dst" : self.container.findChild(name="dst"), … … 237 223 self._widgets["xstretch"].text = unicode(str(self._light["xstretch"])) 238 224 self._widgets["ystretch"].text = unicode(str(self._light["ystretch"])) 239 self._widgets["xshift"].text = unicode(str(self._light["xshift"]))240 self._widgets["yshift"].text = unicode(str(self._light["yshift"]))241 225 self._widgets["src"].text = unicode(str(self._light["src"])) 242 226 self._widgets["dst"].text = unicode(str(self._light["dst"])) … … 267 251 self._light["xstretch"] = 1 268 252 self._light["ystretch"] = 1 269 self._light["xshift"] = 0270 self._light["yshift"] = 0271 253 self._light["src"] = -1 272 254 self._light["dst"] = -1 … … 284 266 if self._light[option]+ value < -1 and (option == "src" or option == "dst"): 285 267 self._light[option] = -1 286 if self._light[option]+ value < 0 and option != " xshift" and option != "yshift" and option != "src" and option != "dst":268 if self._light[option]+ value < 0 and option != "src" and option != "dst": 287 269 self._light[option] = 0 288 270 if self._light[option]+ value > 7 and (option == "src" or option == "dst"): 289 271 self._light[option] = 7 290 if self._light[option]+ value > 1and (option == "intensity"272 if self._light[option]+ value > 255 and (option == "intensity" 291 273 or option == "red" 292 274 or option == "green" 293 275 or option == "blue"): 294 self._light[option] = 1.0276 self._light[option] = 255 295 277 296 278 self.update_gui() … … 317 299 self._light["radius"], 318 300 self._light["subdivisions"], 319 self._light["xshift"],320 self._light["yshift"],321 301 self._light["xstretch"], 322 302 self._light["ystretch"],
Note: See TracChangeset
for help on using the changeset viewer.
