Unstable 0.1500.2.0 (Rokvach's dog edition)
This commit is contained in:
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user