comparison gamescenecontroller.py @ 116:7f7f54c4077b

Fixed dropping items on the map.
author KarstenBock@gmx.net
date Mon, 03 Oct 2011 18:25:31 +0200
parents 26e65f27dbd7
children 452bbc3d915d
comparison
equal deleted inserted replaced
115:26e65f27dbd7 116:7f7f54c4077b
243 if(data_drag.dragging): 243 if(data_drag.dragging):
244 coord = self.model.getCoords(scr_point)\ 244 coord = self.model.getCoords(scr_point)\
245 .getExactLayerCoordinates() 245 .getExactLayerCoordinates()
246 commands = ({"Command": "ResetMouseCursor"}, 246 commands = ({"Command": "ResetMouseCursor"},
247 {"Command": "StopDragging"}) 247 {"Command": "StopDragging"})
248 self.model.game_state.getObjectById("PlayerCharacter").fifeagent.approach([coord.x, 248 player_char = (self.model.game_state.
249 coord.y], 249 getObjectById("PlayerCharacter"))
250 DropItemAction(self, 250 action = DropItemAction(self,
251 data_drag.dragged_item, 251 data_drag.dragged_item,
252 commands)) 252 commands)
253 player_char.fifeagent.behaviour.approach([coord.x, coord.y],
254 action)
253 else: 255 else:
254 self.model.movePlayer(self.model.getCoords(scr_point)) 256 self.model.movePlayer(self.model.getCoords(scr_point))
255 elif(evt.getButton() == fife.MouseEvent.RIGHT): 257 elif(evt.getButton() == fife.MouseEvent.RIGHT):
256 # is there an object here? 258 # is there an object here?
257 tmp_active_map = self.model.active_map 259 tmp_active_map = self.model.active_map