Exemplo n.º 1
0
        public LevelUp()
        {
            InitializeComponent();
            string[] specieslist = Personal.getSpeciesIndexStrings(Main.oras);
            specieslist[0] = movelist[0] = "";

            string[] sortedspecies = (string[])specieslist.Clone();
            Array.Resize(ref sortedspecies, 722); Array.Sort(sortedspecies);
            setupDGV();

            var newlist = new List <Util.cbItem>();

            for (int i = 1; i < 722; i++) // add all species
            {
                newlist.Add(new Util.cbItem {
                    Text = sortedspecies[i], Value = Array.IndexOf(specieslist, sortedspecies[i])
                });
            }
            for (int i = 722; i < specieslist.Length; i++) // add all forms
            {
                newlist.Add(new Util.cbItem {
                    Text = specieslist[i], Value = i
                });
            }

            CB_Species.DisplayMember = "Text";
            CB_Species.ValueMember   = "Value";
            CB_Species.DataSource    = newlist;
            CB_Species.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        public LevelUp()
        {
            InitializeComponent();

            specieslist = Personal.getSpeciesIndexStrings(Main.oras);

            specieslist[0] = movelist[0] = "";

            sortedmoves = (string[])movelist.Clone();
            Array.Sort(sortedmoves);

            // Sort Species list but only for the regular dex entries.
            string[] sortedspecies = (string[])specieslist.Clone();
            Array.Resize(ref sortedspecies, 722);
            Array.Sort(sortedspecies);
            Array.Resize(ref sortedspecies, specieslist.Length);
            Array.Copy(specieslist, 722, sortedspecies, 722, specieslist.Length - 722);

            foreach (string s in sortedspecies)
            {
                CB_Species.Items.Add(s);
            }
            CB_Species.Items.RemoveAt(0);

            setupDGV();
            CB_Species.SelectedIndex = 0;
        }