(93b920f3f) Fixed Chinese text wrapping (can't wrap based on spaces because there's no spaces)

This commit is contained in:
Joonas Rikkonen
2019-05-06 11:36:38 +03:00
parent e0ddeef023
commit 8e53c38461
7 changed files with 87 additions and 245 deletions
@@ -1,6 +1,7 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Barotrauma
@@ -104,7 +105,19 @@ namespace Barotrauma
text = text.Replace("\n", " \n ");
string[] words = text.Split(' ');
string[] words;
if (TextManager.NoWhiteSpace)
{
words = new string[text.Length];
for (int i = 0; i < text.Length; i++)
{
words[i] = text[i].ToString();
}
}
else
{
words = text.Split(' ');
}
StringBuilder wrappedText = new StringBuilder();
float linePos = 0f;