예제 #1
0
파일: GameInfo.cs 프로젝트: zzzzRuby/PKHeX
 public static GameStrings GetStrings(int index)
 {
     return(Languages[index] ??= new GameStrings(GameLanguage.Language2Char(index)));
 }
예제 #2
0
파일: GameInfo.cs 프로젝트: zzzzRuby/PKHeX
        public static GameStrings GetStrings(string lang)
        {
            int index = GameLanguage.GetLanguageIndex(lang);

            return(GetStrings(index));
        }
예제 #3
0
        public GameStrings(string l)
        {
            lang          = l;
            LanguageIndex = GameLanguage.GetLanguageIndex(l);
            ribbons       = Get("ribbons");
            // Past Generation strings
            g3items = Get("ItemsG3");
            // XD and Colosseum
            {
                g3coloitems = (string[])g3items.Clone();
                string[] tmp = Get("ItemsG3Colosseum");
                Array.Resize(ref g3coloitems, 500 + tmp.Length);
                for (int i = g3items.Length; i < g3coloitems.Length; i++)
                {
                    g3coloitems[i] = $"UNUSED {i}";
                }
                tmp.CopyTo(g3coloitems, g3coloitems.Length - tmp.Length);

                g3xditems = (string[])g3items.Clone();
                string[] tmp2 = Get("ItemsG3XD");
                Array.Resize(ref g3xditems, 500 + tmp2.Length);
                for (int i = g3items.Length; i < g3xditems.Length; i++)
                {
                    g3xditems[i] = $"UNUSED {i}";
                }
                tmp2.CopyTo(g3xditems, g3xditems.Length - tmp2.Length);
            }
            g2items          = Get("ItemsG2");
            g1items          = Get("ItemsG1");
            metRSEFRLG_00000 = Get("rsefrlg_00000");
            metGSC_00000     = Get("gsc_00000");

            metCXD_00000 = Get("cxd_00000");
            metCXD_00000 = SanitizeMetStringsCXD(metCXD_00000);

            // Current Generation strings
            natures     = Util.GetNaturesList(l);
            types       = Get("types");
            abilitylist = Get("abilities");

            movelist = Get("moves");
            string[] ps = { "P", "S" }; // Distinguish Physical/Special
            for (int i = 622; i < 658; i++)
            {
                movelist[i] += $" ({ps[i % 2]})";
            }

            itemlist          = Get("items");
            characteristics   = Get("character");
            specieslist       = Get("species");
            wallpapernames    = Get("wallpaper");
            encountertypelist = Get("encountertype");
            gamelist          = Get("games");

            balllist = new string[Legal.Items_Ball.Length];
            for (int i = 0; i < balllist.Length; i++)
            {
                balllist[i] = itemlist[Legal.Items_Ball[i]];
            }

            pokeblocks    = Get("pokeblock");
            forms         = Get("forms");
            memories      = Get("memories");
            genloc        = Get("genloc");
            trainingbags  = Get("trainingbag");
            trainingstage = Get("supertraining");
            puffs         = Get("puff");
            Array.Resize(ref puffs, puffs.Length + 1); // shift all down, 0th will be 'none' -- applied later
            Array.Copy(puffs, 0, puffs, 1, puffs.Length - 1);

            EggName       = specieslist[0];
            metHGSS_00000 = Get("hgss_00000");
            metHGSS_02000 = Get("hgss_02000");
            metHGSS_03000 = Get("hgss_03000");
            metBW2_00000  = Get("bw2_00000");
            metBW2_30000  = Get("bw2_30000");
            metBW2_40000  = Get("bw2_40000");
            metBW2_60000  = Get("bw2_60000");
            metXY_00000   = Get("xy_00000");
            metXY_30000   = Get("xy_30000");
            metXY_40000   = Get("xy_40000");
            metXY_60000   = Get("xy_60000");
            metSM_00000   = Get("sm_00000");
            metSM_30000   = Get("sm_30000");
            metSM_40000   = Get("sm_40000");
            metSM_60000   = Get("sm_60000");

            metGG_00000 = Get("gg_00000");
            metGG_30000 = metSM_30000;
            metGG_40000 = Get("gg_40000");
            metGG_60000 = metSM_60000;

            // todo
            metSWSH_00000 = Enumerable.Range(1, 500).Select(z => $"a{z}").ToArray();
            metSWSH_30000 = Enumerable.Range(1, 500).Select(z => $"b{z}").ToArray();
            metSWSH_40000 = Enumerable.Range(1, 500).Select(z => $"c{z}").ToArray();
            metSWSH_60000 = Enumerable.Range(1, 500).Select(z => $"d{z}").ToArray();

            Sanitize();

            g4items = (string[])itemlist.Clone();
            Get("mail4").CopyTo(g4items, 137);
        }
예제 #4
0
 private string[] Get(string ident) => GameLanguage.GetStrings(ident, lang);
예제 #5
0
        public GameStrings(string l)
        {
            lang          = l;
            LanguageIndex = GameLanguage.GetLanguageIndex(l);
            ribbons       = Get("ribbons");

            // Past Generation strings
            g3items     = Get("ItemsG3");
            g3coloitems = GetG3CXD(g3items, "ItemsG3Colosseum");
            g3xditems   = GetG3CXD(g3items, "ItemsG3XD");

            g2items          = Get("ItemsG2");
            g1items          = Get("ItemsG1");
            metRSEFRLG_00000 = Get("rsefrlg_00000");
            metGSC_00000     = Get("gsc_00000");

            metCXD_00000 = Get("cxd_00000");
            SanitizeMetStringsCXD(metCXD_00000);

            // Current Generation strings
            natures     = Util.GetNaturesList(l);
            types       = Get("types");
            abilitylist = Get("abilities");

            movelist = Get("moves");
            string[] ps = { "P", "S" }; // Distinguish Physical/Special
            for (int i = 622; i < 658; i++)
            {
                movelist[i] += $" ({ps[i % 2]})";
            }

            itemlist        = Get("items");
            characteristics = Get("character");
            specieslist     = Get("species");
            wallpapernames  = Get("wallpaper");
            groundtiletypes = Get("groundtile");
            gamelist        = Get("games");

            balllist = new string[Items_Ball.Length];
            for (int i = 0; i < balllist.Length; i++)
            {
                balllist[i] = itemlist[Items_Ball[i]];
            }

            pokeblocks    = Get("pokeblock");
            forms         = Get("forms");
            memories      = Get("memories");
            feeling6      = Get("feeling6");
            feeling8      = Get("feeling");
            intensity     = Get("intensity");
            genloc        = Get("genloc");
            trainingbags  = Get("trainingbag");
            trainingstage = Get("supertraining");
            puffs         = Get("puff");

            walkercourses = Get("hgss_walkercourses");

            uggoods     = Get("dppt_uggoods");
            ugspheres   = Get("dppt_ugspheres");
            ugtraps     = Get("dppt_ugtraps");
            ugtreasures = Get("dppt_ugtreasures");

            EggName       = specieslist[0];
            metHGSS_00000 = Get("hgss_00000");
            metHGSS_02000 = Get("hgss_02000");
            metHGSS_03000 = Get("hgss_03000");
            metBW2_00000  = Get("bw2_00000");
            metBW2_30000  = Get("bw2_30000");
            metBW2_40000  = Get("bw2_40000");
            metBW2_60000  = Get("bw2_60000");
            metXY_00000   = Get("xy_00000");
            metXY_30000   = Get("xy_30000");
            metXY_40000   = Get("xy_40000");
            metXY_60000   = Get("xy_60000");
            metSM_00000   = Get("sm_00000");
            metSM_30000   = Get("sm_30000");
            metSM_40000   = Get("sm_40000");
            metSM_60000   = Get("sm_60000");

            metGG_00000 = Get("gg_00000");
            metGG_30000 = metSM_30000;
            metGG_40000 = Get("gg_40000");
            metGG_60000 = metSM_60000;

            metSWSH_00000 = Get("swsh_00000");
            metSWSH_30000 = Get("swsh_30000");
            metSWSH_40000 = Get("swsh_40000");
            metSWSH_60000 = Get("swsh_60000");

            metLA_00000 = Get("la_00000");
            metLA_30000 = Get("la_30000");
            metLA_40000 = Get("la_40000");
            metLA_60000 = Get("la_60000");

            metBDSP_00000 = Get("bdsp_00000");
            metBDSP_30000 = Get("bdsp_30000");
            metBDSP_40000 = Get("bdsp_40000");
            metBDSP_60000 = Get("bdsp_60000");

            Sanitize();

            g4items = (string[])itemlist.Clone();
            Get("mail4").CopyTo(g4items, 137);
        }
예제 #6
0
 /// <summary>
 /// Gets the localized Text representation of the set details.
 /// </summary>
 /// <param name="lang">2 character language code</param>
 public string LocalizedText(string lang) => LocalizedText(GameLanguage.GetLanguageIndex(lang));