(965c31410) v0.10.4.0

This commit is contained in:
Joonas Rikkonen
2020-07-30 13:00:09 +03:00
parent eeac247a8e
commit 4978af3d60
539 changed files with 45803 additions and 25359 deletions
@@ -111,6 +111,9 @@ namespace Barotrauma
get;
protected set;
}
[Serialize("", false)]
public string AllowedUpgrades { get; set; }
[Serialize(false, false)]
public bool HideInMenus { get; set; }
@@ -207,6 +210,11 @@ namespace Barotrauma
Category = MapEntityCategory.Structure;
}
public string[] GetAllowedUpgrades()
{
return string.IsNullOrWhiteSpace(AllowedUpgrades) ? new string[0] : AllowedUpgrades.Split(",");
}
protected virtual void CreateInstance(Rectangle rect)
{
if (constructor == null) return;
@@ -300,6 +308,8 @@ namespace Barotrauma
public bool IsLinkAllowed(MapEntityPrefab target)
{
if (target == null) { return false; }
if (target is StructurePrefab && AllowedLinks.Contains("structure")) { return true; }
if (target is ItemPrefab && AllowedLinks.Contains("item")) { return true; }
return AllowedLinks.Contains(target.Identifier) || target.AllowedLinks.Contains(identifier)
|| target.Tags.Any(t => AllowedLinks.Contains(t)) || Tags.Any(t => target.AllowedLinks.Contains(t));
}