diff --git a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs index 6ccfbc19c..6c609618e 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs @@ -39,7 +39,7 @@ namespace Barotrauma case 3: case 4: SlotPositions[i] = new Vector2( - spacing * 2 + rectWidth + (spacing + rectWidth) * (i - 2), + spacing * 2 + rectWidth + (spacing + rectWidth) * (i - 1), GameMain.GraphicsHeight - (spacing + rectHeight) * 3); useOnSelfButton[i - 3] = new GUIButton( @@ -52,16 +52,24 @@ namespace Barotrauma break; + //face case 5: SlotPositions[i] = new Vector2( spacing * 2 + rectWidth + (spacing + rectWidth) * (i - 5), GameMain.GraphicsHeight - (spacing + rectHeight) * 3); + break; + //id card + case 6: + SlotPositions[i] = new Vector2( + spacing * 2 + rectWidth + (spacing + rectWidth) * (i - 5), + GameMain.GraphicsHeight - (spacing + rectHeight) * 3); + break; default: SlotPositions[i] = new Vector2( - spacing * 2 + rectWidth + (spacing + rectWidth) * ((i - 6) % 5), - GameMain.GraphicsHeight - (spacing + rectHeight) * ((i > 10) ? 2 : 1)); + spacing * 2 + rectWidth + (spacing + rectWidth) * ((i - 7) % 5), + GameMain.GraphicsHeight - (spacing + rectHeight) * ((i > 11) ? 2 : 1)); break; } } @@ -247,6 +255,13 @@ namespace Barotrauma new Vector2(15.0f, 16.0f), Vector2.One, SpriteEffects.None, 0.1f); } + else if (i == 6) + { + spriteBatch.Draw(icons, new Vector2(slotRect.Center.X, slotRect.Center.Y), + new Rectangle(62, 36, 22, 18), Color.White * 0.7f, 0.0f, + new Vector2(11.0f, 9.0f), Vector2.One, + SpriteEffects.None, 0.1f); + } } base.Draw(spriteBatch); diff --git a/Barotrauma/BarotraumaShared/Content/Items/Reactor/reactor.xml b/Barotrauma/BarotraumaShared/Content/Items/Reactor/reactor.xml index 5ac35b6f1..255bf051f 100644 --- a/Barotrauma/BarotraumaShared/Content/Items/Reactor/reactor.xml +++ b/Barotrauma/BarotraumaShared/Content/Items/Reactor/reactor.xml @@ -68,7 +68,7 @@ - + - + diff --git a/Barotrauma/BarotraumaShared/Content/Items/Tools/tools.xml b/Barotrauma/BarotraumaShared/Content/Items/Tools/tools.xml index 0d6c81251..2f194ca87 100644 --- a/Barotrauma/BarotraumaShared/Content/Items/Tools/tools.xml +++ b/Barotrauma/BarotraumaShared/Content/Items/Tools/tools.xml @@ -116,7 +116,7 @@ - + diff --git a/Barotrauma/BarotraumaShared/Content/Items/idcard.xml b/Barotrauma/BarotraumaShared/Content/Items/idcard.xml index 1c2d8c62e..d6659ef30 100644 --- a/Barotrauma/BarotraumaShared/Content/Items/idcard.xml +++ b/Barotrauma/BarotraumaShared/Content/Items/idcard.xml @@ -10,8 +10,5 @@ - - - - - + + \ No newline at end of file diff --git a/Barotrauma/BarotraumaShared/Content/Jobs.xml b/Barotrauma/BarotraumaShared/Content/Jobs.xml index 17fa0ac06..c46354b4e 100644 --- a/Barotrauma/BarotraumaShared/Content/Jobs.xml +++ b/Barotrauma/BarotraumaShared/Content/Jobs.xml @@ -8,7 +8,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -105,7 +105,7 @@ - + diff --git a/Barotrauma/BarotraumaShared/Content/UI/inventoryIcons.png b/Barotrauma/BarotraumaShared/Content/UI/inventoryIcons.png index ab2341432..885ca8b46 100644 Binary files a/Barotrauma/BarotraumaShared/Content/UI/inventoryIcons.png and b/Barotrauma/BarotraumaShared/Content/UI/inventoryIcons.png differ diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index a506e62d1..85e74eb6b 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -591,7 +591,7 @@ namespace Barotrauma { AnimController = new HumanoidAnimController(this, doc.Root.Element("ragdoll")); AnimController.TargetDir = Direction.Right; - inventory = new CharacterInventory(16, this); + inventory = new CharacterInventory(17, this); } else { diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Jobs/Job.cs b/Barotrauma/BarotraumaShared/Source/Characters/Jobs/Job.cs index 2d207ec02..d2b3e28e8 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Jobs/Job.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Jobs/Job.cs @@ -130,6 +130,7 @@ namespace Barotrauma { item.AddTag(s); } + item.Description = "This belongs to " + character.Name + ", the " + Name + "."; } if (parentItem != null) parentItem.Combine(item); diff --git a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs index b25a8e34a..00483a2e4 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/CharacterInventory.cs @@ -10,7 +10,7 @@ namespace Barotrauma [Flags] public enum InvSlotType { - None = 0, Any = 1, RightHand = 2, LeftHand = 4, Head = 8, Torso = 16, Legs = 32, Face=64 + None = 0, Any = 1, RightHand = 2, LeftHand = 4, Head = 8, Torso = 16, Legs = 32, Face=64, Card=128 }; partial class CharacterInventory : Inventory @@ -18,7 +18,7 @@ namespace Barotrauma private Character character; public static InvSlotType[] limbSlots = new InvSlotType[] { - InvSlotType.Head, InvSlotType.Torso, InvSlotType.Legs, InvSlotType.LeftHand, InvSlotType.RightHand, InvSlotType.Face, + InvSlotType.Head, InvSlotType.Torso, InvSlotType.Legs, InvSlotType.LeftHand, InvSlotType.RightHand, InvSlotType.Face, InvSlotType.Card, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any, InvSlotType.Any}; diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index d6c4d2aad..1667a41bd 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -119,9 +119,11 @@ namespace Barotrauma get { return prefab.Name; } } + private string description; public string Description { - get { return prefab.Description; } + get { return description == null ? prefab.Description : description; } + set { description = value; } } public float ImpactTolerance @@ -1458,6 +1460,7 @@ namespace Barotrauma if (GameMain.Server == null) return; msg.Write(Prefab.Name); + msg.Write(Description); msg.Write(ID); if (ParentInventory == null || ParentInventory.Owner == null) @@ -1476,7 +1479,8 @@ namespace Barotrauma msg.Write(index < 0 ? (byte)255 : (byte)index); } - if (Name == "ID Card") msg.Write(Tags); + //TODO: See if tags are different from their prefab before sending 'em + msg.Write(Tags); } public static Item ReadSpawnData(NetBuffer msg, bool spawn = true) @@ -1484,6 +1488,7 @@ namespace Barotrauma if (GameMain.Server != null) return null; string itemName = msg.ReadString(); + string itemDesc = msg.ReadString(); ushort itemId = msg.ReadUInt16(); ushort inventoryId = msg.ReadUInt16(); @@ -1507,11 +1512,7 @@ namespace Barotrauma } } - string tags = ""; - if (itemName == "ID Card") - { - tags = msg.ReadString(); - } + string tags = msg.ReadString(); if (!spawn) return null; @@ -1541,6 +1542,7 @@ namespace Barotrauma var item = new Item(itemPrefab, pos, sub); + item.Description = itemDesc; item.ID = itemId; if (sub != null) {