Ignore:
Timestamp:
07/11/09 21:55:33 (11 years ago)
Author:
bretzel_parpg
Message:

Added a getItems function to inventory.py that will return a dictionary that is arranged
like: {slot:item, slot:item}. Also fixed an issue with the title in world.createBoxGUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/inventory.py

    r205 r208  
    251251            data_drag.dragging = False 
    252252 
     253    def getItems(self): 
     254        """ 
     255        Get the items in the inventory slots. If there is no item in the slot, it is skipped 
     256         
     257        @rtype: dict 
     258        @return: The items in the inventory 
     259        """ 
     260        items = {} 
     261 
     262        for button in self.buttons: 
     263            widget = self.inventory.findChild(name=button) 
     264            if (widget.item != ""): 
     265                items[button] = widget.item 
     266 
     267        return items 
     268                 
     269 
Note: See TracChangeset for help on using the changeset viewer.