mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
0d45075d4b
- Settings now stored as json next to exe - Settings now exposes all legality checking setttings that can be changed - Slot hovering now can play cries in MGDB/PKMDB/etc, not just the main boxes. - Enhanced hover text for mystery gifts and encounters that have movesets - Show recently loaded save files in ctrl-f browser - Toggle auto-load savefile setting to be none/detect-latest/last-loaded - Custom extensions & extra backup paths can now be configured directly in the json settings - Settings editor now uses propertygrid & tabs.
31 lines
1.2 KiB
C#
31 lines
1.2 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
|
|
ParseSettings.ChangeLocalizationStrings(str.movelist, str.specieslist);
|
|
|
|
// Update Legality Strings
|
|
Task.Run(() =>
|
|
{
|
|
RibbonStrings.ResetDictionary(str.ribbons);
|
|
LocalizationUtil.SetLocalization(typeof(LegalityCheckStrings), lang);
|
|
LocalizationUtil.SetLocalization(typeof(MessageStrings), lang);
|
|
});
|
|
}
|
|
}
|
|
}
|