Example #1
0
        void Start()
        {
            slot = new SlotData();

                foreach(string item in initListItems)
                    addItem(DObjectList.getInstance().getItem(item));

                background = DImageList.getInstance().getImage("external_inventory_background");
                correctCellImage = DImageList.getInstance().getImage("inventory_correct_cell");

                playerInventory = SingletonNames.getInventory().GetComponent<UInventory>();
                drawService = new ItemDrawService(playerInventory.iconStyle, playerInventory.iconShadow);
                titleStyle = playerInventory.titleStyle;

                titleText = CLang.getInstance().get(titleTextId);
                captionText = CLang.getInstance().get(captionTextId);

                initListItems.Clear();

                slot.position.CellsXCount = cellXCount;
                slot.position.CellsYCount = cellYCount;
        }
Example #2
0
        public void TryInit()
        {
            if(slot==null)
                slot = new SlotData();

            if(slot.position.CellsXCount<1)
                slot.position.CellsXCount=1;

            if(slot.position.CellsYCount<1)
                slot.position.CellsYCount=1;

            if(background==null)
                background = DImageList.getInstance().getImage("external_inventory_background");

            if(correctCellImage==null)
                correctCellImage = DImageList.getInstance().getImage("inventory_correct_cell");

            if(playerInventory==null)
                playerInventory = SingletonNames.getInventory().GetComponent<UInventory>();

            if(drawService==null)
                drawService = new ItemDrawService(playerInventory.iconStyle, playerInventory.iconShadow);

            titleStyle = playerInventory.titleStyle;

            titleText   = CLang.getInstance().get(titleTextId);
            captionText = CLang.getInstance().get(captionTextId);
        }
Example #3
0
 public SlotDrawService(List<RectangleSlot> slots, GUIStyle iconStyle, GUIStyle iconShadow)
 {
     this.slots=slots;
     itemDrawService = new ItemDrawService(iconStyle,iconShadow);
 }