mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Stop reference frames warning you every second
This commit is contained in:
parent
abed1b2439
commit
a501baf7d5
@ -19,7 +19,9 @@ namespace NewHorizons.Handlers
|
|||||||
UI
|
UI
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetTranslation(string text, TextType type)
|
public static string GetTranslation(string text, TextType type) => GetTranslation(text, type, true);
|
||||||
|
|
||||||
|
public static string GetTranslation(string text, TextType type, bool warn)
|
||||||
{
|
{
|
||||||
Dictionary<TextTranslation.Language, Dictionary<string, string>> dictionary;
|
Dictionary<TextTranslation.Language, Dictionary<string, string>> dictionary;
|
||||||
var language = TextTranslation.Get().m_language;
|
var language = TextTranslation.Get().m_language;
|
||||||
@ -36,7 +38,7 @@ namespace NewHorizons.Handlers
|
|||||||
dictionary = _uiTranslationDictionary;
|
dictionary = _uiTranslationDictionary;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger.LogVerbose($"Invalid TextType {type}");
|
if (warn) Logger.LogVerbose($"Invalid TextType {type}");
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,14 +47,14 @@ namespace NewHorizons.Handlers
|
|||||||
if (table.TryGetValue(text, out var translatedText))
|
if (table.TryGetValue(text, out var translatedText))
|
||||||
return translatedText;
|
return translatedText;
|
||||||
|
|
||||||
Logger.LogVerbose($"Defaulting to english for {text}");
|
if (warn) Logger.LogVerbose($"Defaulting to english for {text}");
|
||||||
|
|
||||||
// Try to default to English
|
// Try to default to English
|
||||||
if (dictionary.TryGetValue(TextTranslation.Language.ENGLISH, out var englishTable))
|
if (dictionary.TryGetValue(TextTranslation.Language.ENGLISH, out var englishTable))
|
||||||
if (englishTable.TryGetValue(text, out var englishText))
|
if (englishTable.TryGetValue(text, out var englishText))
|
||||||
return englishText;
|
return englishText;
|
||||||
|
|
||||||
Logger.LogVerbose($"Defaulting to key for {text}");
|
if (warn) Logger.LogVerbose($"Defaulting to key for {text}");
|
||||||
|
|
||||||
// Default to the key
|
// Default to the key
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ namespace NewHorizons.Patches
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(customName))
|
if (!string.IsNullOrWhiteSpace(customName))
|
||||||
{
|
{
|
||||||
__result = TranslationHandler.GetTranslation(customName, TranslationHandler.TextType.UI);
|
__result = TranslationHandler.GetTranslation(customName, TranslationHandler.TextType.UI, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user