Пример #1
0
        /// <summary>
        /// Gets the localized Text representation of the set details.
        /// </summary>
        /// <param name="lang">Language ID</param>
        private string LocalizedText(int lang)
        {
            var strings = GameInfo.GetStrings(lang);

            lang      += lang >= 5 ? 2 : 1; // shift from array index to LanguageID
            LanguageID = lang;
            return(GetText(strings));
        }
Пример #2
0
        /// <summary>
        /// Gets all encounters where a <see cref="species"/> can learn all input <see cref="moves"/>.
        /// </summary>
        public static IEnumerable <IEncounterable> GetLearn(string species, IEnumerable <string> moves, string lang = GameLanguage.DefaultLanguage)
        {
            var str = GameInfo.GetStrings(lang);

            var spec    = StringUtil.FindIndexIgnoreCase(str.specieslist, species);
            var moveIDs = StringUtil.GetIndexes(str.movelist, moves.ToList());

            return(GetLearn(spec, moveIDs));
        }
Пример #3
0
        private void DumpLocation()
        {
            string loc = GameInfo.GetStrings("en").metGSC_00000[Location];

            System.Console.WriteLine($"Location: {loc}");
            System.Console.WriteLine("Valid:");
            foreach (var tree in ValidTrees)
            {
                System.Console.WriteLine($"{tree.Index} @ ({tree.X:D2},{tree.Y:D2})");
            }
            System.Console.WriteLine("Invalid:");
            foreach (var tree in InvalidTrees)
            {
                System.Console.WriteLine($"{tree.Index} @ ({tree.X:D2},{tree.Y:D2})");
            }
            System.Console.WriteLine("===");
        }
        public static IEnumerable <IEncounterable> GetLearn(string species, IEnumerable <string> moves, string lang = DefaultLang)
        {
            var str = GameInfo.GetStrings(lang);

            if (str == null)
            {
                return(Enumerable.Empty <IEncounterable>());
            }

            var spec = FindIndexIgnoreCase(str.specieslist, species);

            if (spec <= 0)
            {
                return(Enumerable.Empty <IEncounterable>());
            }

            var moveIDs = moves.Select(z => FindIndexIgnoreCase(str.movelist, z)).Where(z => z > 0).ToArray();

            return(GetLearn(spec, moveIDs));
        }
Пример #5
0
        /// <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);
            });
        }
Пример #6
0
 private string[] Get(string ident) => GameInfo.GetStrings(ident, lang);
Пример #7
0
        /// <summary>
        /// Gets the localized Text representation of the set details.
        /// </summary>
        /// <param name="lang">Language ID</param>
        private string LocalizedText(int lang)
        {
            var strings = GameInfo.GetStrings(lang);

            return(GetText(strings));
        }
Пример #8
0
 /// <summary>
 /// Gets the localized Text representation of the set details.
 /// </summary>
 /// <param name="lang">Language ID</param>
 public string LocalizedText(int lang) => GetText(GameInfo.GetStrings(LanguageID = lang));