//Constructor:
 public Inventory(Image Slot, Image Selected, Image emptyIcon, Text slotNumber)
 {
     //Set defaut images
     noItemIcon      = emptyIcon;
     notSelectedIcon = Slot;
     selectedIcon    = Selected;
     //Create hotbar
     for (int i = 0; i < 10; i++)
     {
         //Create background slots
         Slots.Add(GameObject.Instantiate(Slot, Slot.transform.parent));
         Slots[i].transform.localPosition = new Vector3(-500 + 110 * i, -450, 0);
         Text temp = GameObject.Instantiate(slotNumber, slotNumber.transform.parent);
         temp.transform.localPosition = new Vector3(-470 + 110 * i, -480, 0);
         int tempNumber = i + 1;
         if (tempNumber == 10)
         {
             tempNumber = 0;
         }
         temp.text = tempNumber.ToString();
         //Create item slots
         ItemIcons.Add(GameObject.Instantiate(emptyIcon, emptyIcon.transform.parent));
         ItemIcons[i].transform.localPosition = new Vector3(-500 + 110 * i, -450, 0);
     }
     //Set selected slot to "Selected" sprite
     Slots[selected].GetComponent <Image>().sprite = selectedIcon.sprite;
 }
Ejemplo n.º 2
0
 public void Clear()
 {
     Items.Clear();
     ItemIcons.Clear();
     ItemSubTexts.Clear();
     ItemBackgroundColors.Clear();
 }
Ejemplo n.º 3
0
        public ItemPreview()
        {
            this.RoundedCorners     = true;
            this.EnableGenericIcons = true;

            this.itemIcons = new ItemIcons(this);
            this.pb        = null;
            this.isIcon    = false;
        }
Ejemplo n.º 4
0
        public ItemView()
        {
            itemIcons   = new ItemIcons(this);
            loadingIcon = this.RenderIcon(Icons.Icon.Stock_Find, ICON_SIZE);

            HeadersClickable = true;

            database          = null;
            currentVolumeType = (VolumeType)(-1);
            item_col          = -1;

            // event handlers
            RowExpanded      += OnRowExpanded;
            ButtonPressEvent += OnButtonPressEvent;
        }
Ejemplo n.º 5
0
        private void drawItems(Graphics graphics)
        {
            for (var i = 0; i < _inventory.items.Length; i++)
            {
                var item = _inventory.items[i];
                if (item == null)
                {
                    continue;
                }

                var position = itemPosition(i % PlayerInventory.MaxColumns, i / PlayerInventory.MaxColumns) + entity.position.ToPoint();
                var rect     = new Rectangle(position.X, position.Y, ItemSize, ItemSize);
                var iconRect = ItemIcons.getIconRect(item.icon);
                graphics.batcher.draw(_itemSheetTexture, rect, iconRect, Color.White);
            }
        }
Ejemplo n.º 6
0
        public SearchResultView()
        {
            itemIcons   = new ItemIcons(this);
            volumeCache = new Dictionary <long, Volume>();

            //
            // setup columns
            //
            TreeViewColumn col;

            col        = new TreeViewColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 0);
            col.Expand = false;
            AppendColumn(col);

            col        = new TreeViewColumn(string.Empty, new CellRendererText(), "markup", 1);
            col.Expand = true;
            AppendColumn(col);
        }
Ejemplo n.º 7
0
 private void Awake()
 {
     Instance = this;
 }