(558678b4c) SerializableProperty names can be translated (the tags are "ClassName.PropertyName", e.g. "LightComponent.LightColor")

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:18:10 +03:00
parent 53cf6c2fef
commit 7497fec62a
3 changed files with 59 additions and 22 deletions
@@ -294,7 +294,8 @@ namespace Barotrauma
{
value = "";
}
string displayName = property.GetAttribute<Editable>().DisplayName;
string propertyName = (entity.GetType().Name + "." + property.PropertyInfo.Name).ToLowerInvariant();
string displayName = TextManager.Get(propertyName, returnNull: true) ?? property.GetAttribute<Editable>().DisplayName;
if (displayName == null)
{
displayName = property.Name.FormatCamelCaseWithSpaces();