From 53f92029099df6b7a23c5552c8b742f1ca583962 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 15 Apr 2019 13:43:50 +0300 Subject: [PATCH] (8f7813f79) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev --- .../Characters/Health/CharacterHealth.cs | 1 - .../Data/ContentPackages/Vanilla 0.9.xml | 11 +- .../BarotraumaShared/SharedContent.projitems | 129 +++++++++++++----- .../Source/Items/Components/Wearable.cs | 6 +- .../BarotraumaShared/Source/Map/Hull.cs | 19 +++ 5 files changed, 123 insertions(+), 43 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs b/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs index bcf19b931..25a281ca5 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs @@ -601,7 +601,6 @@ namespace Barotrauma var limbHealth = limbHealths.OrderByDescending(l => l.TotalDamage).FirstOrDefault(); selectedLimbIndex = limbHealths.IndexOf(limbHealth); } - } LimbHealth selectedLimb = selectedLimbIndex < 0 ? highlightedLimb : limbHealths[selectedLimbIndex]; if (selectedLimb != currentDisplayedLimb || forceAfflictionContainerUpdate) diff --git a/Barotrauma/BarotraumaShared/Data/ContentPackages/Vanilla 0.9.xml b/Barotrauma/BarotraumaShared/Data/ContentPackages/Vanilla 0.9.xml index 529a93864..5d1bf37a2 100644 --- a/Barotrauma/BarotraumaShared/Data/ContentPackages/Vanilla 0.9.xml +++ b/Barotrauma/BarotraumaShared/Data/ContentPackages/Vanilla 0.9.xml @@ -5,11 +5,14 @@ - - - + + + + + + + - diff --git a/Barotrauma/BarotraumaShared/SharedContent.projitems b/Barotrauma/BarotraumaShared/SharedContent.projitems index 33d18209c..87350b127 100644 --- a/Barotrauma/BarotraumaShared/SharedContent.projitems +++ b/Barotrauma/BarotraumaShared/SharedContent.projitems @@ -24,6 +24,10 @@ + + + + @@ -366,6 +370,60 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -612,94 +670,94 @@ PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest @@ -1322,7 +1380,7 @@ PreserveNewest - + PreserveNewest @@ -1589,7 +1647,7 @@ PreserveNewest - + PreserveNewest @@ -1601,10 +1659,7 @@ PreserveNewest - - PreserveNewest - - + PreserveNewest @@ -1613,10 +1668,10 @@ PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Wearable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Wearable.cs index eeee9efe1..b30c71253 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Wearable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Wearable.cs @@ -66,6 +66,8 @@ namespace Barotrauma public LightComponent LightComponent { get; set; } + public int Variant { get; private set; } + private Gender _gender; /// /// None = Any/Not Defined -> no effect. @@ -112,10 +114,11 @@ namespace Barotrauma /// /// Note: this constructor cannot initialize automatically, because the gender is unknown at this point. We only know it when the item is equipped. /// - public WearableSprite(XElement subElement, Wearable wearable) + public WearableSprite(XElement subElement, Wearable wearable, int variant = 1) { Type = WearableType.Item; WearableComponent = wearable; + Variant = Math.Max(variant, 1); SpritePath = ParseSpritePath(subElement.GetAttributeString("texture", string.Empty)); SourceElement = subElement; } @@ -131,6 +134,7 @@ namespace Barotrauma { SpritePath = SpritePath.Replace("[GENDER]", (_gender == Gender.Female) ? "female" : "male"); } + SpritePath = SpritePath.Replace("[VARIANT]", Variant.ToString()); if (Sprite != null) { Sprite.Remove(); diff --git a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs index 838ab56f1..4b5a0fea4 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs @@ -546,6 +546,25 @@ namespace Barotrauma } } + public string DisplayName + { + get; + private set; + } + + private string roomName; + [Editable, Serialize("", true, translationTextTag: "RoomName.")] + public string RoomName + { + get { return roomName; } + set + { + if (roomName == value) { return; } + roomName = value; + DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName; + } + } + public override Rectangle Rect { get