(a185ec0cd) Don't report on broken items that have condition above the threshold. Optimize and fix.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:41:25 +03:00
parent 79d01822d2
commit 1d5de494cd
84 changed files with 1733 additions and 1805 deletions
@@ -107,42 +107,24 @@ namespace Barotrauma
text = text.Replace("\n", " \n ");
List<string> words = new List<string>();
string currWord = "";
for (int i = 0; i < text.Length; i++)
string[] words;
if (TextManager.NoWhiteSpace)
{
if (isCJK.IsMatch(text[i].ToString()))
words = new string[text.Length];
for (int i = 0; i < text.Length; i++)
{
if (currWord.Length > 0)
{
words.Add(currWord);
currWord = "";
}
words.Add(text[i].ToString());
}
else if (text[i] == ' ')
{
if (currWord.Length > 0)
{
words.Add(currWord);
currWord = "";
}
}
else
{
currWord += text[i];
words[i] = text[i].ToString();
}
}
if (currWord.Length > 0)
else
{
words.Add(currWord);
currWord = "";
words = text.Split(' ');
}
StringBuilder wrappedText = new StringBuilder();
float linePos = 0f;
Vector2 spaceSize = font.MeasureString(" ") * textScale;
for (int i = 0; i < words.Count; ++i)
for (int i = 0; i < words.Length; ++i)
{
if (words[i].Length == 0)
{