Mercurial > parpg-source
changeset 146:abfeac863dd6
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 | 46570c1ee4ca |
children | bb29d81d7ce6 |
files | gui/inventorygui.py |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/inventorygui.py Sun Oct 09 20:50:01 2011 +0200 +++ b/gui/inventorygui.py Sun Oct 09 20:50:31 2011 +0200 @@ -316,7 +316,21 @@ except (container.BulkLimitError): #Do we want to notify the player why the item can't be dropped? pass - + + def createMenuItems(self, item, actions): + """Creates context menu items for the InventoryGUI""" + menu_actions = ContainerGUIBase.createMenuItems(self, item, actions) + param_dict = {} + param_dict["controller"] = self.controller + param_dict["commands"] = {} + param_dict["item"] = item.containable + param_dict["container_gui"] = self + menu_actions.append(["Drop", + "Drop", + self.executeMenuItem, + ACTIONS["DropFromInventory"](**param_dict)]) + return menu_actions + class CharacterGUI(object): def __init__(self, controller, gui, container, equip, callbacks): self.engine = controller.engine