v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -209,7 +209,7 @@ namespace Barotrauma
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray(value));
break;
case "identifierarray":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray(value).ToIdentifiers().ToArray());
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseIdentifierArray(value));
break;
}
}
@@ -218,8 +218,6 @@ namespace Barotrauma
DebugConsole.ThrowError($"Failed to set the value of the property \"{Name}\" of \"{parentObject}\" to {value}", e);
return false;
}
return true;
}
@@ -295,7 +293,7 @@ namespace Barotrauma
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray((string)value));
return true;
case "identifierarray":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray((string)value).ToIdentifiers().ToArray());
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseIdentifierArray((string)value));
return true;
default:
DebugConsole.ThrowError($"Failed to set the value of the property \"{Name}\" of \"{parentObject}\" to {value}");
@@ -1089,7 +1087,7 @@ namespace Barotrauma
{
case "requireditem":
case "requireditems":
itemComponent.requiredItems.Clear();
itemComponent.RequiredItems.Clear();
itemComponent.DisabledRequiredItems.Clear();
itemComponent.SetRequiredItems(element, allowEmpty: true);
@@ -1041,6 +1041,12 @@ namespace Barotrauma
public static bool IsOverride(this XElement element) => element.NameAsIdentifier() == "override";
/// <summary>
/// Get the root element of the document, or the first child element of the root if it's an override element.
/// Or in other words, the "rootmost element that actually contains some content".
/// </summary>
public static XElement GetRootExcludingOverride(this XDocument doc) => doc.Root.IsOverride() ? doc.Root.FirstElement() : doc.Root;
public static XElement FirstElement(this XElement element) => element.Elements().FirstOrDefault();
public static XAttribute GetAttribute(this XElement element, string name, StringComparison comparisonMethod = StringComparison.OrdinalIgnoreCase) => element.GetAttribute(a => a.Name.ToString().Equals(name, comparisonMethod));