Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Source/Items/CharacterInventory.cs
	Subsurface/Source/Items/Inventory.cs
	Subsurface/Source/Items/Item.cs
This commit is contained in:
Regalis
2016-10-12 21:12:21 +03:00
9 changed files with 89 additions and 19 deletions
@@ -168,7 +168,7 @@ namespace Barotrauma
if (allowedSlot.HasFlag(limbSlots[i]) && Items[i]!=null && Items[i]!=item)
{
free = false;
break;
if (slots != null) slots[i].ShowBorderHighlight(Color.Red, 0.1f, 0.9f);
}
}
@@ -238,9 +238,8 @@ namespace Barotrauma
TryPutItem(item, currentIndex, false);
TryPutItem(existingItem, index, false);
}
}
return combined;
}
@@ -292,17 +291,21 @@ namespace Barotrauma
protected override void CreateSlots()
{
slots = new InventorySlot[capacity];
if (slots == null) slots = new InventorySlot[capacity];
int rectWidth = 40, rectHeight = 40;
Rectangle slotRect = new Rectangle(0, 0, rectWidth, rectHeight);
for (int i = 0; i < capacity; i++)
{
if (slots[i] == null) slots[i] = new InventorySlot(slotRect);
slots[i].Disabled = false;
slotRect.X = (int)(SlotPositions[i].X + DrawOffset.X);
slotRect.Y = (int)(SlotPositions[i].Y + DrawOffset.Y);
slots[i] = new InventorySlot(slotRect);
slots[i].Rect = slotRect;
slots[i].Color = limbSlots[i] == InvSlotType.Any ? Color.White * 0.2f : Color.White * 0.4f;
}