Fix reload configs breaking NH translations

This commit is contained in:
Nick 2022-09-14 21:08:28 -04:00
parent 3f1b803b0f
commit 27386e1730
2 changed files with 9 additions and 6 deletions

View File

@ -121,7 +121,7 @@ namespace NewHorizons
_wasConfigured = true;
}
public static void ResetConfigs(bool resetTranslation = true)
public void ResetConfigs(bool resetTranslation = true)
{
BodyDict.Clear();
SystemDict.Clear();
@ -160,9 +160,13 @@ namespace NewHorizons
}
};
if (!resetTranslation) return;
TranslationHandler.ClearTables();
TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage());
if (resetTranslation)
{
TranslationHandler.ClearTables();
TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage());
}
LoadTranslations(Instance.ModHelper.Manifest.ModFolderPath + "Assets/", this);
}
public void Awake()
@ -212,7 +216,6 @@ namespace NewHorizons
OnStarSystemLoaded.AddListener(RichPresenceHandler.OnStarSystemLoaded);
OnChangeStarSystem.AddListener(RichPresenceHandler.OnChangeStarSystem);
LoadTranslations(ModHelper.Manifest.ModFolderPath + "Assets/", this);
LoadAddonManifest("Assets/addon-manifest.json", this);
}

View File

@ -31,7 +31,7 @@ namespace NewHorizons.Utility.DebugUtilities
{
Logger.Log("Begin reload of config files...");
Main.ResetConfigs();
Main.Instance.ResetConfigs();
try
{