mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
Tabbed inventory
This commit is contained in:
parent
c81a92679b
commit
6d7282f5cb
214 changed files with 9329 additions and 186 deletions
|
|
@ -10,7 +10,7 @@ public partial class InventoryManager : Node2D
|
|||
public static InventoryManager Instance { get; private set; }
|
||||
public bool RedKeycard { get; set; }
|
||||
|
||||
private Dictionary<string, ItemContainer> _itemsDict = new Dictionary<string, ItemContainer>();
|
||||
private Dictionary<string, ItemContainer> _itemsDict = new();
|
||||
|
||||
public List<ItemContainer> Items => _itemsDict.Where(x => x.Value.Count > 0).Select(x => x.Value).ToList();
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public partial class InventoryManager : Node2D
|
|||
return _itemsDict.TryGetValue(key, out item);
|
||||
}
|
||||
|
||||
public bool HasItems(List<string> itemKeys)
|
||||
public bool HasItems(IList<string> itemKeys)
|
||||
{
|
||||
return itemKeys.Aggregate(false, (current, item) => current || GetItemCount(item) > 0);
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ public partial class InventoryManager : Node2D
|
|||
return true;
|
||||
}
|
||||
|
||||
public bool UseItem(string itemKey)
|
||||
public bool UseItem(StringName itemKey)
|
||||
{
|
||||
if (!_itemsDict.TryGetValue(itemKey, out var itm)) return false;
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ public partial class InventoryManager : Node2D
|
|||
return true;
|
||||
}
|
||||
|
||||
public void NotifyLoadedAmmoChange(string weaponDataItemKey, int loadedAmmo)
|
||||
public void NotifyLoadedAmmoChange(StringName weaponDataItemKey, int loadedAmmo)
|
||||
{
|
||||
EmitSignal(SignalName.LoadedAmmoChanged, weaponDataItemKey, loadedAmmo);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue