(93b920f3f) Fixed Chinese text wrapping (can't wrap based on spaces because there's no spaces)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -15,7 +16,15 @@ namespace Barotrauma
|
||||
private static string[] serverMessageCharacters = new string[] { "~", "[", "]", "=" };
|
||||
|
||||
public static string Language;
|
||||
|
||||
public static bool NoWhiteSpace
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!textPacks.ContainsKey(Language)) { return false; }
|
||||
return textPacks[Language].Any(t => t.NoWhiteSpace);
|
||||
}
|
||||
}
|
||||
|
||||
private static HashSet<string> availableLanguages = new HashSet<string>();
|
||||
public static IEnumerable<string> AvailableLanguages
|
||||
{
|
||||
|
||||
@@ -12,7 +12,9 @@ namespace Barotrauma
|
||||
|
||||
private Dictionary<string, List<string>> texts;
|
||||
|
||||
private string filePath;
|
||||
public readonly bool NoWhiteSpace;
|
||||
|
||||
private readonly string filePath;
|
||||
|
||||
public TextPack(string filePath)
|
||||
{
|
||||
@@ -23,6 +25,7 @@ namespace Barotrauma
|
||||
if (doc == null || doc.Root == null) return;
|
||||
|
||||
Language = doc.Root.GetAttributeString("language", "Unknown");
|
||||
NoWhiteSpace = doc.Root.GetAttributeBool("nowhitespace", false);
|
||||
|
||||
foreach (XElement subElement in doc.Root.Elements())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user