Exemplo n.º 1
0
        public SAV_PokedexSM(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV7)(Origin = sav).Clone();
            CP  = new[] { CHK_P1, CHK_P2, CHK_P3, CHK_P4, CHK_P5, CHK_P6, CHK_P7, CHK_P8, CHK_P9, };
            CL  = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9, };

            editing = true;
            // Clear Listbox and ComboBox
            LB_Species.Items.Clear();
            CB_Species.Items.Clear();
            LB_Forms.Items.Clear();

            // Fill List
            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).ToList(), null);


            Dex = new PokeDex7(SAV);
            var Species = GameInfo.Strings.Species;
            var names   = Dex.GetEntryNames(Species);

            foreach (var n in names)
            {
                LB_Species.Items.Add(n);
            }

            editing = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
        }
Exemplo n.º 2
0
        public SAV_PokedexSM(SaveFile sav)
        {
            SAV = (SAV7)(Origin = sav).Clone();
            InitializeComponent();
            CP = new[] { CHK_P1, CHK_P2, CHK_P3, CHK_P4, CHK_P5, CHK_P6, CHK_P7, CHK_P8, CHK_P9, };
            CL = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9, };
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);

            editing = true;
            // Clear Listbox and ComboBox
            LB_Species.Items.Clear();
            CB_Species.Items.Clear();
            LB_Forms.Items.Clear();

            // Fill List
            CB_Species.DisplayMember = "Text";
            CB_Species.ValueMember   = "Value";
            CB_Species.DataSource    = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).ToList(), null);

            for (int i = 1; i < SAV.MaxSpeciesID + 1; i++)
            {
                LB_Species.Items.Add($"{i:000} - {GameInfo.Strings.specieslist[i]}");
            }

            // Add Formes
            int ctr = SAV.MaxSpeciesID;

            baseSpecies = new List <int>();
            for (int i = 1; i < SAV.MaxSpeciesID + 1; i++)
            {
                int c = SAV.Personal[i].FormeCount;
                for (int j = 0; j < c; j++)
                {
                    int x = SAV.USUM ? SaveUtil.GetDexFormIndexUSUM(i, c, j) : SaveUtil.GetDexFormIndexSM(i, c, j);
                    if (x == -1 || j == 0)
                    {
                        continue;
                    }
                    baseSpecies.Add(i);
                    ctr++;
                    LB_Species.Items.Add($"{ctr:000} - {GameInfo.Strings.specieslist[i]}-{j}");
                }
            }

            Dex     = new PokeDex7(SAV);
            editing = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
        }
Exemplo n.º 3
0
        public SAV_PokedexSM()
        {
            InitializeComponent();
            CP = new[] { CHK_P1, CHK_P2, CHK_P3, CHK_P4, CHK_P5, CHK_P6, CHK_P7, CHK_P8, CHK_P9, };
            CL = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9, };
            WinFormsUtil.TranslateInterface(this, Main.curlanguage);

            editing = true;
            // Clear Listbox and ComboBox
            LB_Species.Items.Clear();
            CB_Species.Items.Clear();

            // Fill List
            CB_Species.DisplayMember = "Text";
            CB_Species.ValueMember   = "Value";
            CB_Species.DataSource    = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).ToList(), null);

            for (int i = 1; i < SAV.MaxSpeciesID + 1; i++)
            {
                LB_Species.Items.Add($"{i:000} - {GameInfo.Strings.specieslist[i]}");
            }

            // Add Formes
            int ctr = SAV.MaxSpeciesID;

            for (int i = 0; i < SAV.MaxSpeciesID + 1; i++)
            {
                int c = SAV.Personal[i].FormeCount;
                for (int j = 0; j < c; j++)
                {
                    int x = SaveUtil.getDexFormIndexSM(i, c, j);
                    if (x == -1 || j == 0)
                    {
                        continue;
                    }
                    ctr++;
                    LB_Species.Items.Add($"{ctr:000} - {GameInfo.Strings.specieslist[i]}-{j}");
                }
            }

            Dex     = new PokeDex7(SAV);
            editing = false;
            LB_Species.SelectedIndex = 0;
        }