(3fbeb4c70) Option to make items use the name and description of another item

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:05:16 +03:00
parent 92e4c824f4
commit 36ee088738
13 changed files with 410 additions and 84 deletions
@@ -303,6 +303,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
@@ -1364,7 +1364,7 @@ namespace Barotrauma
foreach (Hull hull in matchingHulls)
{
if (string.IsNullOrEmpty(hull.RoomName) || !hull.RoomName.Contains("RoomName."))
if (string.IsNullOrEmpty(hull.RoomName))
{
hull.RoomName = hull.CreateRoomName();
}