Release v0.15.12.0
This commit is contained in:
@@ -68,7 +68,13 @@ namespace Barotrauma
|
||||
Name = element.GetAttributeString("name", string.Empty);
|
||||
IsWallUpgrade = element.GetAttributeBool("wallupgrade", false);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Name))
|
||||
string nameIdentifier = element.GetAttributeString("nameidentifier", "");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(nameIdentifier))
|
||||
{
|
||||
Name = TextManager.Get($"{nameIdentifier}", returnNull: true) ?? string.Empty;
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(Name))
|
||||
{
|
||||
Name = TextManager.Get($"UpgradeCategory.{Identifier}", true) ?? string.Empty;
|
||||
}
|
||||
@@ -131,6 +137,8 @@ namespace Barotrauma
|
||||
|
||||
public string Description { get; }
|
||||
|
||||
public float IncreaseOnTooltip { get; }
|
||||
|
||||
public string Identifier { get; }
|
||||
|
||||
public string FilePath { get; }
|
||||
@@ -172,7 +180,13 @@ namespace Barotrauma
|
||||
|
||||
var targetProperties = new Dictionary<string, string[]>();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Name))
|
||||
string nameIdentifier = element.GetAttributeString("nameidentifier", "");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(nameIdentifier))
|
||||
{
|
||||
Name = TextManager.Get($"UpgradeName.{nameIdentifier}", returnNull: true) ?? string.Empty;
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(Name))
|
||||
{
|
||||
Name = TextManager.Get($"UpgradeName.{Identifier}", returnNull: true) ?? string.Empty;
|
||||
}
|
||||
@@ -182,6 +196,8 @@ namespace Barotrauma
|
||||
Description = TextManager.Get($"UpgradeDescription.{Identifier}", returnNull: true) ?? string.Empty;
|
||||
}
|
||||
|
||||
IncreaseOnTooltip = element.GetAttributeFloat("increaseontooltip", 0f);
|
||||
|
||||
DebugConsole.Log(" " + Name);
|
||||
|
||||
foreach (XElement subElement in element.Elements())
|
||||
@@ -249,7 +265,7 @@ namespace Barotrauma
|
||||
|
||||
public bool IsDisallowed(Item item)
|
||||
{
|
||||
return item.disallowedUpgrades.Contains(Identifier);
|
||||
return item.disallowedUpgrades.Contains(Identifier) || UpgradeCategories.Any(c => item.disallowedUpgrades.Contains(c.Identifier));
|
||||
}
|
||||
|
||||
public static UpgradePrefab? Find(string identifier)
|
||||
|
||||
Reference in New Issue
Block a user