예제 #1
0
 private string[] get(string ident)
 {
     string[] data = Util.getStringList(ident, Language);
     if (data == null || data.Length == 0)
     {
         data = Util.getStringList(ident, DefaultLanguage);
     }
     return(data);
 }
예제 #2
0
 private string[] getStringList(string type)
 {
     string[] text = null;
     if (SAV.ORAS)
     {
         text = Util.getStringList($"{type}_oras");
     }
     else if (SAV.XY)
     {
         text = Util.getStringList($"{type}_xy");
     }
     return(text);
 }
예제 #3
0
파일: GameInfo.cs 프로젝트: wbsr9876/PKHeX
            private string[] get(string ident)
            {
                string[] data = Util.getStringList(ident, Language);
                if (data == null || data.Length == 0)
                {
                    data = Util.getStringList(ident, DefaultLanguage);
                }

                // Use alternate (Fan Translated) species names since GameFreak decided to use non-Unicode characters which are now game-font dependent.
                // PKX still fetches nickname with the actual string
                if (ident == "species" && new[] { "zh", "zh2" }.Contains(Language))
                {
                    return(Util.getSpeciesList(Language + "_alt"));
                }

                return(data);
            }
예제 #4
0
        private void updateNickname(object sender, EventArgs e)
        {
            if (!CHK_Nicknamed.Checked)
            {
                // Fetch Current Species and set it as Nickname Text
                int species = Util.getIndex(CB_Species);
                if (species == 0 || species > 721)
                {
                    TB_Nickname.Text = "";
                }
                else
                {
                    // get language
                    string l = Form1.curlanguage;
                    TB_Nickname.Text = Util.getStringList("Species", l)[species];
                }
            }
            TB_Nickname.ReadOnly = !CHK_Nicknamed.Checked;

            Write_Entry(null, null);
        }
예제 #5
0
        private string[] getStringList(string type)
        {
            switch (SAV.Version)
            {
            case GameVersion.X:
            case GameVersion.Y:
                gamePrefix = "xy";
                break;

            case GameVersion.OR:
            case GameVersion.AS:
                gamePrefix = "oras";
                break;

            case GameVersion.SN:
            case GameVersion.MN:
                gamePrefix = "sm";
                break;

            default:
                return(null);
            }
            return(Util.getStringList($"{type}_{gamePrefix}"));
        }
예제 #6
0
파일: GameInfo.cs 프로젝트: wbsr9876/PKHeX
            public GameStrings(string l)
            {
                Language = l;
                // 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}";
                    }
                    Array.Copy(tmp, 0, g3coloitems, g3coloitems.Length - tmp.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}";
                    }
                    Array.Copy(tmp2, 0, g3xditems, g3xditems.Length - tmp2.Length, tmp2.Length);
                }
                g2items          = get("ItemsG2");
                g1items          = get("ItemsG1");
                metRSEFRLG_00000 = get("rsefrlg_00000");
                metGSC_00000     = get("gsc_00000");

                metCXD_00000 = get("cxd_00000");
                // Sanitize a little
                var metSanitize = (string[])metCXD_00000.Clone();

                for (int i = 0; i < metSanitize.Length; i++)
                {
                    if (metCXD_00000.Count(r => r == metSanitize[i]) > 1)
                    {
                        metSanitize[i] += $" [{i:000}]";
                    }
                }
                metCXD_00000 = metSanitize;

                // Current Generation strings
                natures           = Util.getNaturesList(l);
                types             = get("types");
                abilitylist       = get("abilities");
                movelist          = get("moves");
                itemlist          = get("items");
                characteristics   = get("character");
                specieslist       = get("species");
                wallpapernames    = get("wallpaper");
                encountertypelist = get("encountertype");
                gamelist          = get("games");
                gamelanguages     = Util.getNulledStringArray(Util.getStringList("languages"));

                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");

                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");

                Sanitize();
            }