mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-21 09:53:14 +00:00
cf9e5ec37f
Change Ability array to IReadOnlyList, add method to check ability index in personal data Suppress some message warnings Change EvolutionChain short-circuit for VC to jump from gen6 directly down to gen2. There aren't any notradeback 1 situations, so a notradeback1 will always start with g=1, so no need for the other if-continue. Simplify pk5 conversion
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System.Threading.Tasks;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public static class LocalizeUtil
|
|
{
|
|
/// <summary>
|
|
/// Initializes PKHeX's runtime strings to the specified language.
|
|
/// </summary>
|
|
/// <param name="lang">2-char language ID</param>
|
|
/// <param name="sav">Save data (optional)</param>
|
|
/// <param name="hax">Permit illegal things (items, only)</param>
|
|
public static void InitializeStrings(string lang, SaveFile? sav = null, bool hax = false)
|
|
{
|
|
var str = GameInfo.Strings = GameInfo.GetStrings(lang);
|
|
if (sav != null)
|
|
GameInfo.FilteredSources = new FilteredGameDataSource(sav, GameInfo.Sources, hax);
|
|
|
|
// Update Legality Analysis strings
|
|
LegalityAnalysis.ChangeLocalizationStrings(str.movelist, str.specieslist);
|
|
|
|
// Update Legality Strings
|
|
Task.Run(() =>
|
|
{
|
|
RibbonStrings.ResetDictionary(str.ribbons);
|
|
Util.SetLocalization(typeof(LegalityCheckStrings), lang);
|
|
Util.SetLocalization(typeof(MessageStrings), lang);
|
|
});
|
|
}
|
|
}
|
|
}
|