Unstable 0.17.0.0

This commit is contained in:
Markus Isberg
2022-02-26 02:43:01 +09:00
parent a83f375681
commit 3974067915
913 changed files with 32472 additions and 32364 deletions
@@ -1,5 +1,6 @@
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Barotrauma
{
@@ -20,18 +21,17 @@ namespace Barotrauma
private const string metadataDefinition = "metadata";
private const string endDefinition = "end";
public static List<RichTextData> GetRichTextData(string text, out string sanitizedText)
public static ImmutableArray<RichTextData>? GetRichTextData(string text, out string sanitizedText)
{
List<RichTextData> textColors = null;
sanitizedText = text;
if (!string.IsNullOrEmpty(text) && text.Contains(definitionIndicator))
if (!string.IsNullOrEmpty(text) && text.Contains(definitionIndicator, System.StringComparison.Ordinal))
{
text = text.Replace("\r", "");
string[] segments = text.Split(definitionIndicator);
sanitizedText = string.Empty;
textColors = new List<RichTextData>();
List<RichTextData> textColors = new List<RichTextData>();
RichTextData tempData = null;
int prevIndex = 0;
@@ -80,9 +80,9 @@ namespace Barotrauma
}
}
}
return textColors.ToImmutableArray();
}
return textColors;
return null;
}
}
}