(3315662d5) Implement optional required items (lol) and fix the doors. It's a bit confusing, but should work.

This commit is contained in:
Joonas Rikkonen
2019-04-10 13:26:56 +03:00
parent f941a21ada
commit 74da38bd10
3 changed files with 75 additions and 32 deletions
@@ -16,6 +16,8 @@ namespace Barotrauma
Container
}
public bool IsOptional { get; set; }
private string[] identifiers;
private string[] excludedIdentifiers;
@@ -138,7 +140,8 @@ namespace Barotrauma
{
element.Add(
new XAttribute("identifiers", JoinedIdentifiers),
new XAttribute("type", type.ToString()));
new XAttribute("type", type.ToString()),
new XAttribute("optional", IsOptional));
if (excludedIdentifiers.Length > 0)
{
@@ -218,7 +221,8 @@ namespace Barotrauma
if (subElement.Name.ToString().ToLowerInvariant() != "statuseffect") continue;
ri.statusEffects.Add(StatusEffect.Load(subElement, parentDebugName));
}
ri.IsOptional = element.GetAttributeBool("optional", false);
return ri;
}
}