(5670a7c58) Don't get stuck if cannot use the button.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:44:48 +03:00
parent 96b2d953d2
commit f8090d470e
87 changed files with 1711 additions and 2564 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)
{