public void SwitchHotbarInventory(Item item) { //inventory to hotbar, CHECK if we have enaugh space foreach (Item i in inventoryItemList) { if (i == item) { if (hotbarItemList.Count >= hotbarController.HotbarSlotSize) { Debug.Log("No more slots available in hotbar"); } else { hotbarItemList.Add(item); inventoryItemList.Remove(item); onItemChange.Invoke(); } return; } } //hotbar to inventory foreach (Item i in hotbarItemList) { if (i == item) { hotbarItemList.Remove(item); inventoryItemList.Add(item); onItemChange.Invoke(); return; } } }
public void ChangeHotbarInventory(Item item) // Muda item do Inventário p/ Hotbar e vice-versa { foreach (Item i in itemsList) { if (i == item) // Se o item existir no index { if (hotbarList.Count >= hotbarManager.HotbarSlotSize) // Checa se tem espaço suficiente nos Slots { Debug.Log("Não há espaço suficiente para mais items"); } else { hotbarList.Add(item); itemsList.Remove(item); onItemChange.Invoke(); } return; } } foreach (Item i in hotbarList) { if (i == item) { hotbarList.Remove(item); itemsList.Add(item); onItemChange.Invoke(); return; } } }
public void AddItem(Item item) { items.Add(item); if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } }
//private void Update() //{ // if() //} public bool Add(Item item) { if (items.Count >= space) { Debug.Log("Not enough room in inventory"); return(false); } items.Add(item); onItemChangeCallback.Invoke(); return(true); }
public bool Add(Item iItem) { if (lItems.Count >= iInventorySpace) { //full inventory return(false); } lItems.Add(iItem); if (onItemChangeUpdate != null) { onItemChangeUpdate.Invoke(); } return(true); }
public void Add(Item item) { if (items.Count < space) { items.Add(item); if (onItemChange != null) { onItemChange.Invoke(); } } else { Debug.LogWarning("Spacio insuficiente en inventario"); } }
//add items into the inventory public bool ADD(Item item) { if (items.Count >= space) { Debug.Log("Not enough room for inventory"); return(false); } items.Add(item); //when the event is triggered this will update the UI if (OnItemChangeCallBack != null) { OnItemChangeCallBack.Invoke(); } return(true); }
public void AddItem(Item item) { if (item.Stackable()) { bool isInInv = false; // Increment the item's quantity if its already in the inventory foreach (Item inventoryItem in itemList) { if (inventoryItem.itemType == item.itemType) { inventoryItem.quantity += item.quantity; isInInv = true; } } // If the item is not in the inventory, then add it if (!isInInv) { itemList.Add(item); } } else { itemList.Add(item); } // When the player picks up an item, it will trigger the EventHandler // which invokes its method in the InvUI.cs to force a re-draw of the inventory with the update OnItemChange?.Invoke(this, EventArgs.Empty); }
private void InvokeChanged(OptionsItemChangedEventArgs <TKey, TOptionsItem> args) { if (OnItemChange != null) { OnItemChange?.Invoke(args); } }
public bool Add(Item item) { if (items.Count >= space) { Debug.Log("Not enough room."); return(false); } items.Add(item); FindObjectOfType <AudioManager>().PlaySFX("Buy"); if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (listItem.Count >= space) { Debug.Log("Inventory is full!"); return(false); } listItem.Add(item); if (onItemChangeCallBack != null) { onItemChangeCallBack.Invoke(); } } return(true); }
public bool AddItem(Item item) { if (items.Count >= capacity) { Debug.Log("Not enough room"); return(false);; } items.Add(item); if (OnItemChangeCallBack != null) { OnItemChangeCallBack.Invoke(); } return(true); }
public bool AddItem(Item item) { if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough space in inventory!"); return(false); } items.Add(item); if (onItemChangeCallback != null) { onItemChangeCallback.Invoke(); } } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("No more inventory slots"); return(false); } items.Add(item); if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough room in the inventory"); return(false); } items.Add(item); //if to make sure we have some method subsribed, if not, we would get error without if statement if (onItemChangedCallBack != null) { onItemChangedCallBack.Invoke(); } } return(true); }
public bool AddItem(ItemDetails item) { if (items.Count == space) { Debug.Log("No space in inventory"); // ToDo: tell player inventory is full return(false); } items.Add(item); if (onItemChangeCallback != null) { onItemChangeCallback.Invoke(); } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("No more space"); return(false); } items.Add(item); //trigger event if (onItemChangedCallBack != null) { onItemChangedCallBack.Invoke(); } } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (invItems.Count >= space) { Debug.Log("Not Enough Space"); return(false); } invItems.Add(item); if (OnItemChangeCallBack != null) { OnItemChangeCallBack.Invoke(); } } return(true); }
public bool Add(Item item) { if (!item.b_IsDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough room in inventory"); return(false); } items.Add(item); if (onItemChangedCallBack != null) { onItemChangedCallBack.Invoke(); } } return(true); }
public bool Add(Item item) { if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough space!"); return(false); } items.Add(item); //isso vai ser utilizado para a interface dar update if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } } return(true); }
//Adds an item on the array public bool Add(Item item) { //If our item is not a default item add it to the array if (!item.isDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough room."); return(false); } items.Add(item); if (onItemChangeCallback != null) { //This means we are triggering the delegate onItemChangeCallback.Invoke(); } } return(true); }
public bool Add(Item newItem) { if (!newItem.isDefaultItem) { if (items.Count >= space) { Debug.Log("Not enough room, sowwy: " + items.Count + " " + space); return(false); } else { items.Add(newItem); if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } } } return(true); }
// add item to list public bool Add(Item item) { // check it is a equipment not custom clothes if (!item.isDefaultItem) { if (items.Count >= space) { notification.GetComponent <NotificationManager>().displayAble = true; notice.text = "Inventory Full, cannot pickup!"; //Debug.Log("Inventory FULL"); return(false); } items.Add(item); if (onItemChangeCallBack != null) { onItemChangeCallBack.Invoke(); } } return(true); }
public bool Add(Itemscript item, Player player) { if (items.Count >= player.GetMaxInv()) { Debug.Log("MON SAC EST FAIT (Plein)"); return(false); } items.Add(item); AddSats(item, player); //Ceci est temporaire, le but sera d'utiliser Equiped par la suite if (onItemChangeCallback != null) { onItemChangeCallback.Invoke(); } return(true); }
public bool Add(Item item) { if (items.Count < maxSpace) { items.Add(item); if (OnItemChangeCallBack != null) { OnItemChangeCallBack.Invoke(); } return(true); } else { Debug.Log("Inventory Full"); return(false); } }
void MouseDown(UIMouseEvent evt, UIElement listeningElement) { Player player = Main.LocalPlayer; if (player.itemAnimation == 0 && player.itemTime == 0 && !IsLocked() && CanPutIntoSlot(Main.mouseItem)) { Item tempItem = Main.mouseItem.Clone(); Main.mouseItem = item.Clone(); if (!Main.mouseItem.IsAir) { Main.playerInventory = true; } item = tempItem; Main.PlaySound(SoundID.Grab, Main.LocalPlayer.position); OnItemChange?.Invoke(Main.mouseItem, item); } }
public void AddItemInInventory(Inventory inv, ItemDataScriptable item) { if (inv == kitchenInvIngredients) { kitchenInvIngredients.items.Add(item); } else if (inv == personalInvIngredients) { personalInvIngredients.items.Add(item); } if (onItemChangeCallback != null) { onItemChangeCallback.Invoke(); } }
public void AddItem(Item item) { inventoryItemList.Add(item); onItemChange.Invoke(); }