# HG changeset patch # User KarstenBock@gmx.net # Date 1318186231 -7200 # Node ID 94857239b89034e1eb570f77173d06e498a9ab04 # Parent c50a7adeae85240bde778b0bd4fb26d1e4511ed0 Items can now be dropped on the ground from the players inventory. diff -r c50a7adeae85 -r 94857239b890 src/parpg/gui/inventorygui.py --- a/src/parpg/gui/inventorygui.py Sun Oct 09 20:50:01 2011 +0200 +++ b/src/parpg/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