コード例 #1
0
        private void ChangeLBForms(object sender, EventArgs e)
        {
            if (allModifying || editing)
            {
                return;
            }
            SetEntry();

            editing = true;
            int fspecies = LB_Species.SelectedIndex + 1;
            var bspecies = Dex.GetBaseSpecies(fspecies);
            int form     = LB_Forms.SelectedIndex;

            if (form > 0)
            {
                int fc = SAV.Personal[bspecies].FormeCount;
                if (fc > 1) // actually has forms
                {
                    int f = Dex.GetDexFormIndex(bspecies, fc, form);
                    species = f >= 0 ? f + 1 : bspecies;
                }
                else
                {
                    species = bspecies;
                }
            }
            else
            {
                species = bspecies;
            }

            CB_Species.SelectedValue = species;
            LB_Species.SelectedIndex = species - 1;
            LB_Species.TopIndex      = LB_Species.SelectedIndex;
            GetEntry();
            editing = false;
        }