Unstable 0.1500.2.0 (Rokvach's dog edition)

This commit is contained in:
Markus Isberg
2021-09-10 04:52:34 +09:00
parent e7b7c1a748
commit 1231170fce
126 changed files with 2424 additions and 1083 deletions
@@ -19,6 +19,8 @@ namespace Barotrauma.Items.Components
/// </summary>
private float[] containedSpriteDepths;
private Sprite[] slotIcons;
public Sprite InventoryTopSprite
{
get { return inventoryTopSprite; }
@@ -88,6 +90,7 @@ namespace Barotrauma.Items.Components
partial void InitProjSpecific(XElement element)
{
slotIcons = new Sprite[capacity];
foreach (XElement subElement in element.Elements())
{
switch (subElement.Name.ToString().ToLowerInvariant())
@@ -107,6 +110,17 @@ namespace Barotrauma.Items.Components
case "containedstateindicatorempty":
ContainedStateIndicatorEmpty = new Sprite(subElement);
break;
case "sloticon":
int index = subElement.GetAttributeInt("slotindex", -1);
Sprite icon = new Sprite(subElement);
for (int i = 0; i < capacity; i++)
{
if (i == index || index == -1)
{
slotIcons[i] = icon;
}
}
break;
}
}
@@ -208,6 +222,12 @@ namespace Barotrauma.Items.Components
}
}
public Sprite GetSlotIcon(int slotIndex)
{
if (slotIndex < 0 || slotIndex >= slotIcons.Length) { return null; }
return slotIcons[slotIndex];
}
public bool KeepOpenWhenEquippedBy(Character character)
{
if (!character.CanAccessInventory(Inventory) ||