Ejemplo n.º 1
0
 def __init__(self, controller, gui, equip, callbacks, slot_size=(50, 50)):
     ContainerGUIBase.__init__(self, controller, gui)
     self.equip = equip
     self.equip_to_gui = {
         "head": "headSlot",
         "neck": "neckSlot",
         "body": "shirtSlot",
         "belt": "beltSlot",
         "leg": "pantsSlot",
         "feet": "bootsSlot",
         "l_arm": "leftHandSlot",
         "r_arm": "rightHandSlot",
     }
     self.setSlotEvents()
     self.slot_size = slot_size
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 def __init__(self, controller, gui, container, callbacks):
     ContainerGUIBase.__init__(self, controller, gui)
     self.grid = self.gui.findChildByName("Grid")
     assert isinstance(self.grid, InventoryGrid)
     self.container = container
     self.setSlotEvents()