Exemplo n.º 1
0
 public static Func <PKM, IComparable>[] GetSortFunctions()
 {
     return(Gen1_Kanto.GetSortFunctions());
 }
Exemplo n.º 2
0
        private void LoadMenuStrip(ToolStripDropDownItem menuTools)
        {
            int         gen      = SaveFileEditor.SAV.Generation;
            GameVersion version  = SaveFileEditor.SAV.Version;
            bool        isLetsGo = version == GameVersion.GP || version == GameVersion.GE;

            menuTools.DropDownItems.RemoveByKey("SortBoxesBy");
            ToolStripMenuItem sortBoxesItem = new ToolStripMenuItem("Sort Boxes By")
            {
                Name = "SortBoxesBy"
            };

            sortBoxesItem.Image = Properties.Resources.SortIcon;
            menuTools.DropDownItems.Add(sortBoxesItem);
            ToolStripItemCollection sortItems = sortBoxesItem.DropDownItems;

            if (isLetsGo)
            {
                sortItems.Add(GetSortButton("Gen 7 Kanto", Gen7_Kanto.GetSortFunctions()));
            }
            else
            {
                bool isSwSh = version == GameVersion.SW || version == GameVersion.SH;
                bool isBDSP = version == GameVersion.BD || version == GameVersion.SP;
                bool isPLA  = version == GameVersion.PLA;

                if (gen >= 1)
                {
                    sortItems.Add(GetSortButton("Gen 1 Kanto", Gen1_Kanto.GetSortFunctions()));
                }

                if (gen >= 2)
                {
                    sortItems.Add(GetSortButton("Gen 2 Johto", Gen2_Johto.GetSortFunctions()));
                }

                if (gen >= 3)
                {
                    sortItems.Add(GetSortButton("Gen 3 Hoenn", Gen3_Hoenn.GetSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 3 Kanto", Gen3_Kanto.GetSortFunctions()));
                }

                if (gen >= 4)
                {
                    sortItems.Add(GetSortButton("Gen 4 Sinnoh Diamond/Pearl", Gen4_Sinnoh.GetDPSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 4 Sinnoh Platinum", Gen4_Sinnoh.GetPtSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 4 Johto", Gen4_Johto.GetSortFunctions()));
                }

                if (gen >= 5 && !isBDSP)
                {
                    sortItems.Add(GetSortButton("Gen 5 Unova Black/White", Gen5_Unova.GetBWSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 5 Unova Black 2/White 2", Gen5_Unova.GetB2W2SortFunctions()));
                }

                if (gen >= 6 && !isBDSP)
                {
                    sortItems.Add(GetSortButton("Gen 6 Kalos", Gen6_Kalos.GetSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 6 Hoenn", Gen6_Hoenn.GetSortFunctions()));
                }

                if (gen >= 7 && !isBDSP && !isPLA)
                {
                    sortItems.Add(GetSortButton("Gen 7 Alola Sun/Moon", Gen7_Alola.GetFullSMSortFunctions()));
                    sortItems.Add(GetSortButton("Gen 7 Alola Ultra Sun/Ultra Moon", Gen7_Alola.GetFullUSUMSortFunctions()));
                }

                if (gen >= 8)
                {
                    if (isSwSh)
                    {
                        sortItems.Add(GetSortButton("Gen 7 Kanto", Gen7_Kanto.GetSortFunctions()));
                        sortItems.Add(GetSortButton("Gen 8 Galar", Gen8_Galar.GetGalarDexSortFunctions()));
                        sortItems.Add(GetSortButton("Gen 8 Galar Isle of Armor", Gen8_Galar.GetIoADexSortFunctions()));
                        sortItems.Add(GetSortButton("Gen 8 Galar Crown Tundra", Gen8_Galar.GetCTDexSortFunction()));
                        sortItems.Add(GetSortButton("Gen 8 Galar Complete", Gen8_Galar.GetFullGalarDexSortFunctions()));
                    }
                    else if (isBDSP)
                    {
                        sortItems.Add(GetSortButton("Gen 8 Sinnoh", Gen8_Sinnoh.GetSortFunctions()));
                    }
                    else if (isPLA)
                    {
                        sortItems.Add(GetSortButton("Gen 8 Hisui", Gen8_Hisui.GetSortFunctions()));
                    }
                }

                if (gen != 1)
                {
                    ToolStripMenuItem sortButton = new ToolStripMenuItem("National Pokédex");
                    sortButton.Click += (s, e) => SortByNationalDex();
                    sortItems.Add(sortButton);
                }
            }
        }