Esempio n. 1
0
 public void addItemObjectToInventory(ItemObject _ItemObject)
 {
     if(this.inventory.addItemObjectToInventory(_ItemObject))
     {
         Configuration.Configuration.networkManager.addEvent(new GameLibrary.Connection.Message.UpdateCreatureInventoryMessage(this.Id, this.inventory), GameMessageImportance.VeryImportant);
     }
 }
Esempio n. 2
0
 public InventoryItem(Rectangle _Bounds, Container _Parent, CreatureObject _InventoryOwner)
     : base(_Bounds)
 {
     this.itemObject = null;
     this.parent = _Parent;
     this.inventoryOwner = _InventoryOwner;
 }
Esempio n. 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));
        }
Esempio n. 4
0
        public ItemObject createItemObject(ItemEnum _ItemEnum)
        {
            GameLibrary.Model.Object.ItemObject var_ItemObject = new ItemObject();
            var_ItemObject.ItemEnum = _ItemEnum;
            var_ItemObject.Scale = 1;
            var_ItemObject.Velocity = new Vector3(0, 0, 0);

            switch (_ItemEnum)
            {
                case ItemEnum.GoldCoin:
                    {
                        var_ItemObject.Body.MainBody.TexturePath = "Character/GoldCoin";
                        var_ItemObject.ItemIconGraphicPath = "Character/GoldCoin";
                        var_ItemObject.Size = new Microsoft.Xna.Framework.Vector3(16, 16, 0);
                        var_ItemObject.StackMax = 5;
                        var_ItemObject.OnlyFromPlayerTakeAble = true;
                        break;
                    }
            }
            return var_ItemObject;
        }
Esempio n. 5
0
 private void itemDropedIn(ItemObject _ItemObject)
 {
     this.inventoryOwner.guiSetItemToEquipment(_ItemObject, this.fieldId);
 }
Esempio n. 6
0
 public void guiSetItemToEquipment(ItemObject _ItemObject, int _FieldId)
 {
     if (_ItemObject.PositionInInventory != -1)
     {
         if(this.inventory.Items.Contains(_ItemObject))
         {
             Configuration.Configuration.networkManager.addEvent(new GameLibrary.Connection.Message.CreatureInventoryToEquipmentMessage(this.Id, _ItemObject.PositionInInventory, _FieldId), GameMessageImportance.VeryImportant);
         }
         else
         {
             //Kommt nicht aus dem Inventar, sondern woadners he. Aus anderem Inv., ode Equip.
         }
     }
     else
     {
         // Kommt aus der world ;)
     }
 }
Esempio n. 7
0
 public void guiSetItemToInventory(ItemObject _ItemObject, int _FieldId)
 {
     this.inventory.itemDropedInInventory(this, _ItemObject, _FieldId);
     this.inventory.InventoryChanged = true;
 }
Esempio n. 8
0
 private void itemDropedIn(ItemObject _ItemObject)
 {
     this.inventoryOwner.guiSetItemToInventory(_ItemObject, this.fieldId);
     //this.inventoryOwner.Inventory.itemDropedInInventory(inventoryOwner, _ItemObject, this.fieldId);
     //this.inventoryOwner.Inventory.InventoryChanged = true;
 }