comparison src/parpg/gui/inventorygui.py @ 176:94857239b890

Items can now be dropped on the ground from the players inventory.
author KarstenBock@gmx.net
date Sun, 09 Oct 2011 20:50:31 +0200
parents ee4c1fe78be1
children 32dc19350db3
comparison
equal deleted inserted replaced
175:c50a7adeae85 176:94857239b890
314 drop_widget.item = drag_item.entity 314 drop_widget.item = drag_item.entity
315 self.updateImage(drop_widget) 315 self.updateImage(drop_widget)
316 except (container.BulkLimitError): 316 except (container.BulkLimitError):
317 #Do we want to notify the player why the item can't be dropped? 317 #Do we want to notify the player why the item can't be dropped?
318 pass 318 pass
319 319
320 def createMenuItems(self, item, actions):
321 """Creates context menu items for the InventoryGUI"""
322 menu_actions = ContainerGUIBase.createMenuItems(self, item, actions)
323 param_dict = {}
324 param_dict["controller"] = self.controller
325 param_dict["commands"] = {}
326 param_dict["item"] = item.containable
327 param_dict["container_gui"] = self
328 menu_actions.append(["Drop",
329 "Drop",
330 self.executeMenuItem,
331 ACTIONS["DropFromInventory"](**param_dict)])
332 return menu_actions
333
320 class CharacterGUI(object): 334 class CharacterGUI(object):
321 def __init__(self, controller, gui, container, equip, callbacks): 335 def __init__(self, controller, gui, container, equip, callbacks):
322 self.engine = controller.engine 336 self.engine = controller.engine
323 self.inventory_shown = False 337 self.inventory_shown = False
324 if isinstance(gui, pychan.Widget): 338 if isinstance(gui, pychan.Widget):