# HG changeset patch # User KarstenBock@gmx.net # Date 1318186231 -7200 # Node ID abfeac863dd6ac39b22b202b6d4d8b867923fbd0 # Parent 46570c1ee4ca60d2cde3b6a526fe0fe12899f4eb Items can now be dropped on the ground from the players inventory. diff -r 46570c1ee4ca -r abfeac863dd6 gui/inventorygui.py --- 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