(1e5573bea) new outpost

This commit is contained in:
Joonas Rikkonen
2019-05-07 16:22:58 +03:00
parent cc46d452fa
commit bb6067df31
24 changed files with 98 additions and 200 deletions
@@ -11,7 +11,7 @@ namespace Barotrauma
{
private static Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"])*\"|[^,]*)", RegexOptions.Compiled); // Handling commas inside data fields surrounded by ""
private static List<int> conversationClosingIndent = new List<int>();
private static char[] separator = new char[1] { '|' };
private static char[] separator = new char[1] { ',' };
private const string conversationsPath = "Content/NPCConversations";
private const string infoTextPath = "Content/Texts";
@@ -151,7 +151,7 @@ namespace Barotrauma
for (int i = traitStart + NPCPersonalityTrait.List.Count; i < csvContent.Length; i++) // Conversations
{
string[] presplit = csvContent[i].Split(separator); // Handling speaker index fetching, somehow doesn't work with the regex
string[] presplit = csvContent[i].Split(','); // Handling speaker index fetching, somehow doesn't work with the regex
string[] split = SplitCSV(csvContent[i]);
int emptyFields = 0;
@@ -257,7 +257,7 @@ namespace Barotrauma
list.Add("");
}
list.Add(curr.TrimStart(separator));
list.Add(curr.TrimStart(','));
}
return list.ToArray();
@@ -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)
{