(f6783d0df) Workarounds to missing texts (use a "fallback tag" if the correct tag can't be found, now used for "shuttle" and "savesubdialogdescription"), minor layout tweaks to fix overlapping texts in Pt-Br

This commit is contained in:
Joonas Rikkonen
2019-05-07 16:23:32 +03:00
parent 482f3c1f3c
commit 92f300128e
5 changed files with 22 additions and 10 deletions
@@ -79,7 +79,7 @@ namespace Barotrauma
}
}
public static string Get(string textTag, bool returnNull = false)
public static string Get(string textTag, bool returnNull = false, string fallBackTag = null)
{
if (!textPacks.ContainsKey(Language))
{
@@ -94,7 +94,16 @@ namespace Barotrauma
foreach (TextPack textPack in textPacks[Language])
{
string text = textPack.Get(textTag);
if (text != null) return text;
if (text != null) { return text; }
}
if (!string.IsNullOrEmpty(fallBackTag))
{
foreach (TextPack textPack in textPacks[Language])
{
string text = textPack.Get(fallBackTag);
if (text != null) { return text; }
}
}
//if text was not found and we're using a language other than English, see if we can find an English version