Faction Test 100.4.0.0
This commit is contained in:
@@ -214,6 +214,7 @@ namespace Barotrauma
|
||||
return splitValue;
|
||||
}
|
||||
|
||||
|
||||
public static Identifier[] GetAttributeIdentifierArray(this XElement element, string name, Identifier[] defaultValue, bool trim = true)
|
||||
{
|
||||
return element.GetAttributeStringArray(name, null, trim: trim, convertToLowerInvariant: false)
|
||||
@@ -221,6 +222,12 @@ namespace Barotrauma
|
||||
?? defaultValue;
|
||||
}
|
||||
|
||||
public static ImmutableHashSet<Identifier> GetAttributeIdentifierImmutableHashSet(this XElement element, string key, ImmutableHashSet<Identifier> defaultValue, bool trim = true)
|
||||
{
|
||||
return element.GetAttributeIdentifierArray(key, null, trim)?.ToImmutableHashSet()
|
||||
?? defaultValue;
|
||||
}
|
||||
|
||||
public static float GetAttributeFloat(this XElement element, float defaultValue, params string[] matchingAttributeName)
|
||||
{
|
||||
if (element == null) { return defaultValue; }
|
||||
@@ -769,7 +776,15 @@ namespace Barotrauma
|
||||
#endif
|
||||
return Color.White;
|
||||
}
|
||||
|
||||
if (stringColor.StartsWith("faction.", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Identifier factionId = stringColor.Substring(8).ToIdentifier();
|
||||
if (FactionPrefab.Prefabs.TryGet(factionId, out var faction))
|
||||
{
|
||||
return faction.IconColor;
|
||||
}
|
||||
return Color.White;
|
||||
}
|
||||
|
||||
string[] strComponents = stringColor.Split(',');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user