예제 #1
0
 public InventoryItem(Rectangle _Bounds, Container _Parent, CreatureObject _InventoryOwner)
     : base(_Bounds)
 {
     this.itemObject = null;
     this.parent = _Parent;
     this.inventoryOwner = _InventoryOwner;
 }
예제 #2
0
        public InventoryMenu(CreatureObject _InventoryOwner)
            : base()
        {
            this.inventoryOwner = _InventoryOwner;

            this.Bounds = new Rectangle(475, 0, 700, 1000); // TODO: Größe an Bildschirm anpassen!

            this.AllowMultipleFocus = true;

            this.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryMenu";

            this.equipmentContainer = new Container(this.Bounds);

            int var_Count = this.inventoryOwner.Body.BodyParts.Count;
            for (int y = 0; y < var_Count; y++)
            {
                Component var_InventoryItemSpace = new Component(new Rectangle(this.Bounds.X, this.Bounds.Y + y * 36, 36, 36));
                var_InventoryItemSpace.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryItemSpace";
                this.add(var_InventoryItemSpace);
            }

            for (int y = 0; y < var_Count; y++)
            {
                EquipmentField var_EquipmentField = new EquipmentField(this.inventoryOwner, this.inventoryOwner.Body.BodyParts[y].Id, this.inventoryOwner.Body.BodyParts[y].AcceptedItemTypes, new Rectangle(this.Bounds.X, this.Bounds.Y + y * 36, 36, 36));
                this.equipmentContainer.add(var_EquipmentField);
            }

            this.itemContainer = new Container(new Rectangle(this.Bounds.X, this.Bounds.Y + 300, this.Bounds.Width, this.Bounds.Height));

            int var_BackbackSize = this.inventoryOwner.Inventory.MaxItems;

            int var_SizeY = var_BackbackSize / 4 + var_BackbackSize % 4;

            for (int y = 0; y < var_SizeY; y++)
            {
                for (int x = 0; x < 4; x++)
                {
                    int var_ItemId = y * 4 + x;
                    if (var_BackbackSize > 0)
                    {
                        InventoryField var_InventoryField = new InventoryField(this.inventoryOwner, var_ItemId, new Rectangle(this.Bounds.X + 92 + 36 * x, this.Bounds.Y + 306 + y * 36, 36, 36));
                        this.itemContainer.add(var_InventoryField);

                        var_BackbackSize -= 1;
                    }
                }
            }

            this.checkItems();
            this.add(this.equipmentContainer);
            this.add(this.itemContainer);
        }
예제 #3
0
        public InventoryField(CreatureObject _InventoryOwner, int _FieldId, Rectangle _Bounds)
            : base(_Bounds)
        {
            this.inventoryOwner = _InventoryOwner;

            this.fieldId = _FieldId;

            /*this.itemSpace = new Component(new Rectangle(this.Bounds.X, this.Bounds.Y, this.Bounds.Width, this.Bounds.Height));
            this.itemSpace.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryItemSpace";
            this.add(this.itemSpace);*/

            //this.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryItemSpace";

            this.item = null;
        }
예제 #4
0
        public EquipmentField(CreatureObject _InventoryOwner, int _FieldId, List<ItemEnum> _AcceptedItemTypes, Rectangle _Bounds)
            : base(_Bounds)
        {
            this.inventoryOwner = _InventoryOwner;

            this.fieldId = _FieldId;

            this.acceptedItemTypes = _AcceptedItemTypes;

            /*this.itemSpace = new Component(new Rectangle(this.Bounds.X, this.Bounds.Y, this.Bounds.Width, this.Bounds.Height));
            this.itemSpace.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryItemSpace";
            this.add(this.itemSpace);*/

            //this.BackgroundGraphicPath = "Gui/Menu/Inventory/InventoryItemSpace";

            this.item = null;
        }