Ignore:
Timestamp:
07/27/10 10:20:23 (10 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Dropping items menu action now only shows when right-clicking on an item in the players inventory
  • Actions that are supposed to happen when a key is pressed now work again.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/gui/inventorygui.py

    r596 r600  
    2121from scripts.objects.base import Container 
    2222from scripts.gui.containergui_base import ContainerGUIBase 
     23from scripts.objects.action import ACTIONS 
    2324 
    2425class InventoryGUI(ContainerGUIBase): 
     
    200201        self.updateInventoryButtons() 
    201202               
     203    def createMenuItems(self, item, actions): 
     204        """Creates context menu items for the InventoryGUI""" 
     205        menu_actions = super(InventoryGUI, self).createMenuItems(item, actions) 
     206        param_dict = {} 
     207        param_dict["controller"] = self.controller 
     208        param_dict["commands"] = {} 
     209        param_dict["item"] = item 
     210        param_dict["container_gui"] = self 
     211        menu_actions.append(["Drop", 
     212                             "Drop",  
     213                             self.executeMenuItem,  
     214                             ACTIONS["Drop"](**param_dict)])         
     215        return menu_actions 
     216     
    202217    def getImage(self, name): 
    203218        """Return a current image from the inventory 
Note: See TracChangeset for help on using the changeset viewer.