示例#1
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;
        }
示例#2
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;
        }
示例#3
0
        public void setItem(ItemObject _ItemObject)
        {
            this.item = new InventoryItem(new Rectangle(this.Bounds.X + (int)(this.Bounds.Width - _ItemObject.Size.X) / 2, this.Bounds.Y + (int)(this.Bounds.Height - _ItemObject.Size.Y) / 2, (int)_ItemObject.Size.X, (int)_ItemObject.Size.Y), this, inventoryOwner);
            this.item.BackgroundGraphicPath = _ItemObject.ItemIconGraphicPath;
            this.item.IsTextEditAble = false;
            this.item.Text = _ItemObject.OnStack.ToString();
            this.item.IsDragAndDropAble = true;
            this.item.ItemObject = _ItemObject;
            this.item.ItemObject.PositionInInventory = this.fieldId;

            this.add(this.item);
            //this.inventoryOwner.Inventory.InventoryChanged = true;
            //Event.EventList.Add(new Event(new GameLibrary.Connection.Message.UpdateCreatureInventoryMessage(this.inventoryOwner.Id, this.inventoryOwner.Inventory), GameMessageImportance.VeryImportant));
        }
示例#4
0
 public void removeItem()
 {
     this.remove(this.item);
     this.item = null;
     this.clear();
 }
示例#5
0
 public void removeItem()
 {
     this.remove(this.item);
     this.item = null;
     this.clear();
 }