Esempio n. 1
0
        private void SetupComboBoxes()
        {
            CB_Ball.InitializeBinding();
            CB_HeldItem.InitializeBinding();
            CB_Species.InitializeBinding();
            CB_Nature.InitializeBinding();
            CB_Ability.InitializeBinding();
            CB_Form.InitializeBinding();

            CB_Ball.DataSource     = new BindingSource(GameInfo.BallDataSource.Where(b => b.Value <= SAV.MaxBallID).ToList(), null);
            CB_HeldItem.DataSource = new BindingSource(GameInfo.ItemDataSource.Where(i => i.Value < SAV.MaxItemID).ToList(), null);
            CB_Species.DataSource  = new BindingSource(GameInfo.SpeciesDataSource.Where(s => s.Value <= SAV.MaxSpeciesID).ToList(), null);
            CB_Nature.DataSource   = new BindingSource(GameInfo.NatureDataSource, null);

            CB_Move1.InitializeBinding();
            CB_Move2.InitializeBinding();
            CB_Move3.InitializeBinding();
            CB_Move4.InitializeBinding();

            var moves = GameInfo.MoveDataSource;

            CB_Move1.DataSource = new BindingSource(moves, null);
            CB_Move2.DataSource = new BindingSource(moves, null);
            CB_Move3.DataSource = new BindingSource(moves, null);
            CB_Move4.DataSource = new BindingSource(moves, null);
        }
Esempio n. 2
0
    public SAV_PokedexBDSP(SaveFile sav)
    {
        InitializeComponent();
        WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
        SAV   = (SAV8BS)(Origin = sav).Clone();
        Zukan = SAV.Zukan;

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

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

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

        editing = false;
        LB_Species.SelectedIndex = 0;
        CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
        CHK_National.Checked     = Zukan.HasNationalDex;
    }
Esempio n. 3
0
    public SAV_Pokedex5(SaveFile sav)
    {
        InitializeComponent();
        WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
        SAV = (SAV5)(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 };

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

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

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

        editing = false;
        LB_Species.SelectedIndex = 0;
        CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
    }
Esempio n. 4
0
        public SAV_PokedexXY(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV   = (SAV6XY)(Origin = sav).Clone();
            Zukan = SAV.Zukan;
            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, };

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

            // Fill List
            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).Where(id => id.Value <= SAV.MaxSpeciesID).ToList(), null);

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

            editing = false;
            LB_Species.SelectedIndex = 0;
            TB_Spinda.Text           = Zukan.SpindaPID.ToString("X8");
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
        }
Esempio n. 5
0
        private void SetupComboBoxes()
        {
            CB_Ball.InitializeBinding();
            CB_HeldItem.InitializeBinding();
            CB_Species.InitializeBinding();
            CB_Nature.InitializeBinding();
            CB_Ability.InitializeBinding();
            CB_Form.InitializeBinding();

            var filtered = GameInfo.FilteredSources;

            CB_Ball.DataSource     = new BindingSource(filtered.Balls, null);
            CB_HeldItem.DataSource = new BindingSource(filtered.Items, null);
            CB_Species.DataSource  = new BindingSource(filtered.Species, null);
            CB_Nature.DataSource   = new BindingSource(filtered.Natures, null);

            CB_Move1.InitializeBinding();
            CB_Move2.InitializeBinding();
            CB_Move3.InitializeBinding();
            CB_Move4.InitializeBinding();

            var moves = filtered.Moves;

            CB_Move1.DataSource = new BindingSource(moves, null);
            CB_Move2.DataSource = new BindingSource(moves, null);
            CB_Move3.DataSource = new BindingSource(moves, null);
            CB_Move4.DataSource = new BindingSource(moves, null);
        }
Esempio n. 6
0
    private void Setup()
    {
        CB_Species.Items.Clear();
        CB_HeldItem.Items.Clear();
        CB_Move1.Items.Clear();
        CB_Move2.Items.Clear();
        CB_Move3.Items.Clear();
        CB_Move4.Items.Clear();

        var filtered = GameInfo.FilteredSources;

        CB_Species.InitializeBinding();
        CB_Species.DataSource = new BindingSource(filtered.Species, null);

        CB_Move1.InitializeBinding();
        CB_Move2.InitializeBinding();
        CB_Move3.InitializeBinding();
        CB_Move4.InitializeBinding();

        var MoveList = filtered.Moves;

        CB_Move1.DataSource = new BindingSource(MoveList, null);
        CB_Move2.DataSource = new BindingSource(MoveList, null);
        CB_Move3.DataSource = new BindingSource(MoveList, null);
        CB_Move4.DataSource = new BindingSource(MoveList, null);

        CB_HeldItem.InitializeBinding();
        CB_HeldItem.DataSource = new BindingSource(filtered.Items, null);
    }
Esempio n. 7
0
        private void Setup()
        {
            CB_Species.Items.Clear();
            CB_HeldItem.Items.Clear();
            CB_Move1.Items.Clear();
            CB_Move2.Items.Clear();
            CB_Move3.Items.Clear();
            CB_Move4.Items.Clear();

            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).Where(s => s.Value <= SAV.MaxSpeciesID).ToList(), null);

            CB_Move1.InitializeBinding();
            CB_Move2.InitializeBinding();
            CB_Move3.InitializeBinding();
            CB_Move4.InitializeBinding();

            var MoveList = GameInfo.MoveDataSource;

            CB_Move1.DataSource = new BindingSource(MoveList, null);
            CB_Move2.DataSource = new BindingSource(MoveList, null);
            CB_Move3.DataSource = new BindingSource(MoveList, null);
            CB_Move4.DataSource = new BindingSource(MoveList, null);

            CB_HeldItem.InitializeBinding();
            CB_HeldItem.DataSource = new BindingSource(GameInfo.ItemDataSource, null);
        }
Esempio n. 8
0
        public SAV_PokedexGG(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV7b)(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();

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

            Dex = SAV.Blocks.Zukan;

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

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

            RecordUsed   = new[] { CHK_RMinHeight, CHK_RMaxHeight, CHK_RMinWeight, CHK_RMaxWeight };
            RecordHeight = new[] { NUD_RHeightMin, NUD_RHeightMax, NUD_RWeightMinHeight, NUD_RWeightMaxHeight };
            RecordWeight = new[] { NUD_RHeightMinWeight, NUD_RHeightMaxWeight, NUD_RWeightMin, NUD_RWeightMax };

            editing = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
        }
Esempio n. 9
0
        private void PopulateComboBoxes()
        {
            // Set the Text
            CB_Species.InitializeBinding();

            var Any = new ComboItem {
                Text = MsgAny, Value = -1
            };

            var DS_Species = new List <ComboItem>(GameInfo.SpeciesDataSource);

            DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;

            // Set the Move ComboBoxes too..
            var DS_Move = new List <ComboItem>(GameInfo.MoveDataSource);

            DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
            {
                foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
                {
                    cb.InitializeBinding();
                    cb.DataSource = new BindingSource(DS_Move, null);
                }
            }

            // Trigger a Reset
            ResetFilters(null, null);
        }
Esempio n. 10
0
        public SAV_Capture7GG(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV7b)(Origin = sav).Clone();
            Dex = SAV.Blocks.Zukan;
            Captured = SAV.Blocks.Captured;

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

            // Fill List
            var list = GetLegalSpecies().ToArray();
            var species = GameInfo.SpeciesDataSource.Where(z => list.Contains(z.Value)).ToList();
            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(species, null);
            foreach (var (text, value) in species.OrderBy(z => z.Value))
                LB_Species.Items.Add($"{value:000}: {text}");

            GetTotals();
            CB_Species.KeyDown += WinFormsUtil.RemoveDropCB;
            LB_Species.SelectedIndex = Index = 0;
            GetEntry();
            Loading = false;
        }
Esempio n. 11
0
        private void AddTrashEditing(int count)
        {
            FLP_Hex.Visible      = true;
            GB_Trash.Visible     = true;
            NUD_Generation.Value = SAV.Generation;
            for (int i = 0; i < count; i++)
            {
                var l = GetLabel($"${i:X2}");
                l.Font = NUD_Generation.Font;
                var n = GetNUD(min: 0, max: 255, hex: true);
                n.Click += (s, e) =>
                {
                    switch (ModifierKeys)
                    {
                    case Keys.Shift: n.Value = n.Maximum; break;

                    case Keys.Alt: n.Value = n.Minimum; break;
                    }
                };
                n.Value         = Raw[i];
                n.ValueChanged += UpdateNUD;

                FLP_Hex.Controls.Add(l);
                FLP_Hex.Controls.Add(n);
                Bytes.Add(n);
            }
            TB_Text.TextChanged += UpdateString;

            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource, null);

            CB_Language.InitializeBinding();
            CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation);
        }
Esempio n. 12
0
        public SAV_PokedexSM(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV7)(Origin = sav).Clone();
            Dex = SAV.Zukan;
            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.FilteredSources.Species.Skip(1).ToList(), null);

            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;
        }
Esempio n. 13
0
        private void PopulateComboBoxes()
        {
            // Set the Text
            CB_Species.InitializeBinding();
            CB_GameOrigin.InitializeBinding();

            var Any = new ComboItem(MsgAny, -1);

            var DS_Species = new List <ComboItem>(GameInfo.SpeciesDataSource);

            DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;

            // Set the Move ComboBoxes too..
            var DS_Move = new List <ComboItem>(GameInfo.MoveDataSource);

            DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
            {
                foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
                {
                    cb.InitializeBinding();
                    cb.DataSource = new BindingSource(DS_Move, null);
                }
            }

            var DS_Version = new List <ComboItem>(GameInfo.VersionDataSource);

            DS_Version.Insert(0, Any); CB_GameOrigin.DataSource = DS_Version;

            // Trigger a Reset
            ResetFilters(null, EventArgs.Empty);
        }
Esempio n. 14
0
        private void PopulateComboBoxes()
        {
            // Set the Text
            CB_HeldItem.InitializeBinding();
            CB_Species.InitializeBinding();
            CB_Ability.InitializeBinding();
            CB_Nature.InitializeBinding();
            CB_GameOrigin.InitializeBinding();
            CB_HPType.InitializeBinding();

            var Any = new ComboItem {
                Text = MsgAny, Value = -1
            };

            var DS_Species = new List <ComboItem>(GameInfo.SpeciesDataSource);

            DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;

            var DS_Item = new List <ComboItem>(GameInfo.ItemDataSource);

            DS_Item.Insert(0, Any); CB_HeldItem.DataSource = DS_Item;

            var DS_Nature = new List <ComboItem>(GameInfo.NatureDataSource);

            DS_Nature.Insert(0, Any); CB_Nature.DataSource = DS_Nature;

            var DS_Ability = new List <ComboItem>(GameInfo.AbilityDataSource);

            DS_Ability.Insert(0, Any); CB_Ability.DataSource = DS_Ability;

            var DS_Version = new List <ComboItem>(GameInfo.VersionDataSource);

            DS_Version.Insert(0, Any); CB_GameOrigin.DataSource = DS_Version;

            string[] hptypes = new string[GameInfo.Strings.types.Length - 2]; Array.Copy(GameInfo.Strings.types, 1, hptypes, 0, hptypes.Length);
            var      DS_Type = Util.GetCBList(hptypes);

            DS_Type.Insert(0, Any); CB_HPType.DataSource = DS_Type;

            // Set the Move ComboBoxes too..
            var DS_Move = new List <ComboItem>(GameInfo.MoveDataSource);

            DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
            {
                foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
                {
                    cb.InitializeBinding();
                    cb.DataSource = new BindingSource(DS_Move, null);
                }
            }

            // Trigger a Reset
            ResetFilters(null, EventArgs.Empty);
        }
Esempio n. 15
0
        public SAV_Roamer3(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            Reader = new Roamer3((SAV3)sav);

            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Where(id => id.Value <= sav.MaxSpeciesID).ToList(), null);

            LoadData();
        }
Esempio n. 16
0
        public SAV_Roamer3(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            Reader = new Roamer3((SAV3)sav);

            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.FilteredSources.Species, null);

            LoadData();
        }
Esempio n. 17
0
        public SAV_PokedexSWSH(SAV8SWSH sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV8SWSH)(Origin = sav).Clone();
            Dex = SAV.Blocks.Zukan;
            var indexes      = Dex.GetRawIndexes(PersonalTable.SWSH, Dex.GetRevision());
            var speciesNames = GameInfo.Strings.Species;

            Indexes = indexes.OrderBy(z => z.GetEntryName(speciesNames)).ToArray();
            CL      = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9 };
            CHK     = new[] { CLB_1, CLB_2, CLB_3, CLB_4 };

            Loading = true;
            // Clear Listbox and ComboBox
            LB_Species.Items.Clear();
            CB_Species.Items.Clear();
            foreach (var c in CHK)
            {
                c.Items.Clear();
                for (int j = 0; j < 63; j++)
                {
                    c.Items.Add($"{j:00} - N/A");
                }
                c.Items.Add("Gigantamax (0)");
            }

            // Fill List
            CB_Species.InitializeBinding();
            var species = GameInfo.FilteredSources.Species.Where(z => Dex.DexLookup.ContainsKey(z.Value)).ToArray();

            CB_Species.DataSource = new BindingSource(species, null);

            var names = Indexes.Select(z => z.GetEntryName(speciesNames) + (Dex.DexLookup[z.Species].DexType == z.Entry.DexType ? string.Empty : "***"));

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

            Loading = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
            CanSave = true;
        }
Esempio n. 18
0
        private void Setup()
        {
            dataGridView1.Rows.Clear();
            dataGridView1.Columns.Clear();
            {
                CB_Species.InitializeBinding();
                CB_Species.DataSource = new BindingSource(GameInfo.FilteredSources.Species, null);

                CB_S2.InitializeBinding();
                CB_S2.DataSource = new BindingSource(GameInfo.FilteredSources.Species, null);
            }
            listBox1.SelectedIndex = 0;
            FillTrainingBags();

            CB_S2.SelectedValue = (int)BitConverter.ToUInt16(SAV.Data, offsetSpec + (4 * 30));
            TB_Time1.Text       = BitConverter.ToSingle(SAV.Data, offsetTime + (4 * 30)).ToString(CultureInfo.InvariantCulture);
            TB_Time2.Text       = BitConverter.ToSingle(SAV.Data, offsetTime + (4 * 31)).ToString(CultureInfo.InvariantCulture);
        }
Esempio n. 19
0
        private void Setup()
        {
            dataGridView1.Rows.Clear();
            dataGridView1.Columns.Clear();
            {
                CB_Species.InitializeBinding();
                CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Where(s => s.Value <= SAV.MaxSpeciesID).ToList(), null);

                CB_S2.InitializeBinding();
                CB_S2.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Where(s => s.Value <= SAV.MaxSpeciesID).ToList(), null);
            }
            listBox1.SelectedIndex = 0;
            FillTrainingBags();

            CB_S2.SelectedValue = (int)BitConverter.ToUInt16(SAV.Data, offsetSpec + (4 * 30));
            TB_Time1.Text       = BitConverter.ToSingle(SAV.Data, offsetTime + (4 * 30)).ToString();
            TB_Time2.Text       = BitConverter.ToSingle(SAV.Data, offsetTime + (4 * 31)).ToString();
        }
Esempio n. 20
0
        public SAV_Pokedex4(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            CL  = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L5, CHK_L4, CHK_L6 }; // JPN,ENG,FRA,GER,ITA,SPA
            SAV = (SAV4)(Origin = sav).Clone();

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

            // Fill List
            CB_Species.InitializeBinding();
            var filtered = GameInfo.FilteredSources;

            CB_Species.DataSource = new BindingSource(filtered.Species.Skip(1).ToList(), null);

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

            editing = false;
            LB_Species.SelectedIndex = 0;

            string[] dexMode = { "not given", "simple mode", "detect forms", "national dex", "other languages" };
            if (SAV is SAV4HGSS)
            {
                dexMode = dexMode.Where((_, i) => i != 2).ToArray();
            }
            foreach (string mode in dexMode)
            {
                CB_DexUpgraded.Items.Add(mode);
            }
            if (SAV.DexUpgraded < CB_DexUpgraded.Items.Count)
            {
                CB_DexUpgraded.SelectedIndex = SAV.DexUpgraded;
            }

            CB_Species.KeyDown += WinFormsUtil.RemoveDropCB;
        }
Esempio n. 21
0
        private void LoadForest()
        {
            Forest             = SAV.EntreeData;
            AllSlots           = Forest.Slots;
            NUD_Unlocked.Value = Forest.Unlock38Areas + 2;
            CHK_Area9.Checked  = Forest.Unlock9thArea;

            var areas = AllSlots.Select(z => z.Area).Distinct()
                        .Select(z => new ComboItem(z.ToString(), (int)z)).ToList();

            CB_Species.InitializeBinding();
            CB_Move.InitializeBinding();
            CB_Areas.InitializeBinding();

            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Where(s => s.Value <= SAV.MaxSpeciesID).ToList(), null);
            CB_Move.DataSource    = new BindingSource(GameInfo.MoveDataSource, null);
            CB_Areas.DataSource   = new BindingSource(areas, null);

            CB_Areas.SelectedIndex = 0;
        }
Esempio n. 22
0
        public SAV_PokedexSWSH(SAV8SWSH sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV8SWSH)(Origin = sav).Clone();
            Dex = SAV.Blocks.Zukan;
            CL  = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, CHK_L7, CHK_L8, CHK_L9 };
            CHK = new[] { CLB_1, CLB_2, CLB_3, CLB_4 };

            // Clear Listbox and ComboBox
            LB_Species.Items.Clear();
            CB_Species.Items.Clear();
            foreach (var c in CHK)
            {
                c.Items.Clear();
                for (int j = 0; j < 63; j++)
                {
                    c.Items.Add($"{j:00} - N/A");
                }
                c.Items.Add("Gigantamax");
            }

            // Fill List
            CB_Species.InitializeBinding();
            var species = GameInfo.FilteredSources.Species.Where(z => Zukan8.DexLookup.ContainsKey(z.Value)).ToArray();

            CB_Species.DataSource = new BindingSource(species, null);

            var Species = GameInfo.Strings.Species;
            var names   = Zukan8.GetEntryNames(Species);

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

            Loading = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
            CanSave = true;
        }
Esempio n. 23
0
        private void PopulateComboBoxes()
        {
            // Set the Text
            CB_HeldItem.InitializeBinding();
            CB_Species.InitializeBinding();

            var Any = new ComboItem {
                Text = MsgAny, Value = -1
            };

            var DS_Species = new List <ComboItem>(GameInfo.SpeciesDataSource);

            DS_Species.RemoveAt(0);
            var filteredSpecies = DS_Species.Where(spec => RawDB.Any(mg => mg.Species == spec.Value)).ToList();

            filteredSpecies.Insert(0, Any);
            CB_Species.DataSource = filteredSpecies;

            var DS_Item = new List <ComboItem>(GameInfo.ItemDataSource);

            DS_Item.Insert(0, Any); CB_HeldItem.DataSource = DS_Item;

            // Set the Move ComboBoxes too..
            var DS_Move = new List <ComboItem>(GameInfo.MoveDataSource);

            DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
            {
                foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
                {
                    cb.InitializeBinding();
                    cb.DataSource = new BindingSource(DS_Move, null);
                }
            }

            // Trigger a Reset
            ResetFilters(null, null);
            B_Search.Enabled = true;
        }
Esempio n. 24
0
        private void ReadBattleFrontier()
        {
            BFV = new[] {
                new[] { 2, 0 },           // Max, Current
                new[] { 2, 0, 3, 1 },     // Max, Current, Max(Trade), Current(Trade)
                new[] { 2, 0, 1, -1, 3 }, // Max, Current, Current(CP), (UsedCP), Max(CP)
            };
            BFT = new[] {
                new[] { "Singles", "Doubles", "Multi" },
                new[] { "Singles", "Doubles", "Multi (Trainer)", "Multi (Friend)", "Wi-Fi" },
            };
            BFN = new[] { "Tower", "Factory", "Hall", "Castle", "Arcade" };
            if (SAV.DP)
            {
                BFN = BFN.Take(1).ToArray();
            }
            StatNUDA   = new[] { NUD_Stat0, NUD_Stat1, NUD_Stat2, NUD_Stat3 };
            StatLabelA = new[] { L_Stat0, L_Stat1, L_Stat2, L_Stat3 };
            StatRBA    = new[] { RB_Stats3_01, RB_Stats3_02 };

            if (ofsPrints > 0)
            {
                PrintColorA  = new[] { Color.Transparent, Color.Silver, Color.Gold };
                PrintButtonA = new[] { BTN_PrintTower, BTN_PrintFactory, BTN_PrintHall, BTN_PrintCastle, BTN_PrintArcade };
                Prints       = new int[PrintButtonA.Length];
                for (int i = 0; i < Prints.Length; i++)
                {
                    Prints[i] = 1 + Math.Sign((BitConverter.ToUInt16(SAV.General, ofsPrints + (i << 1)) >> 1) - 1);
                }
                SetPrints();

                HallNUDA = new[] {
                    NUD_HallType01, NUD_HallType02, NUD_HallType03, NUD_HallType04, NUD_HallType05, NUD_HallType06,
                    NUD_HallType07, NUD_HallType08, NUD_HallType09, NUD_HallType10, NUD_HallType11, NUD_HallType12,
                    NUD_HallType13, NUD_HallType14, NUD_HallType15, NUD_HallType16, NUD_HallType17
                };
                string[] TypeName      = Util.GetTypesList("en");
                int[]    typenameIndex = new[] { 0, 9, 10, 12, 11, 14, 1, 3, 4, 2, 13, 6, 5, 7, 15, 16, 8 };
                for (int i = 0; i < HallNUDA.Length; i++)
                {
                    tip2.SetToolTip(HallNUDA[i], TypeName[typenameIndex[i]]);
                }
            }
            if (ofsHallStat > 0)
            {
                bool f = false;
                for (int i = 0; i < 2; i++, ofsHallStat += 0x14)
                {
                    var h = BitConverter.ToInt32(SAV.Data, ofsHallStat);
                    if (h == -1)
                    {
                        continue;
                    }
                    for (int j = 0; j < 0x20; j++)
                    {
                        for (int k = 0, a = j + 0x20 << 12; k < 2; k++, a += 0x40000)
                        {
                            if (h != BitConverter.ToInt32(SAV.Data, a) || BitConverter.ToInt16(SAV.Data, a + 0xBA8) != 0xBA0)
                            {
                                continue;
                            }

                            f           = true;
                            ofsHallStat = a;
                            break;
                        }
                        if (f)
                        {
                            break;
                        }
                    }
                    if (f)
                    {
                        break;
                    }
                }
                if (!f)
                {
                    ofsHallStat             = -1;
                    NUD_HallStreaks.Visible = NUD_HallStreaks.Enabled = false;
                }
            }

            editing = true;
            CB_Stats1.Items.Clear();
            foreach (string t in BFN)
            {
                CB_Stats1.Items.Add(t);
            }
            StatRBA[0].Checked = true;

            // Clear Listbox and ComboBox
            CB_Species.Items.Clear();

            // Fill List
            CB_Species.InitializeBinding();
            CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).Where(id => id.Value <= SAV.MaxSpeciesID).ToList(), null);

            editing = false;
            CB_Stats1.SelectedIndex = 0;
        }
Esempio n. 25
0
        public SAV_PokedexLA(SAV8LA sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = (SAV8LA)(Origin = sav).Clone();
            Dex = SAV.Blocks.PokedexSave;
            var speciesNames = GameInfo.Strings.Species;

            CHK_SeenWild   = new[] { CHK_S0, CHK_S1, CHK_S2, CHK_S3, CHK_S4, CHK_S5, CHK_S6, CHK_S7 };
            CHK_Obtained   = new[] { CHK_O0, CHK_O1, CHK_O2, CHK_O3, CHK_O4, CHK_O5, CHK_O6, CHK_O7 };
            CHK_CaughtWild = new[] { CHK_C0, CHK_C1, CHK_C2, CHK_C3, CHK_C4, CHK_C5, CHK_C6, CHK_C7 };

            TaskControls = new []
            {
                PRT_1,
                PRT_2,
                PRT_3,
                PRT_4,
                PRT_5,
                PRT_6,
                PRT_7,
                PRT_8,
                PRT_9,
                PRT_10,
            };

            foreach (var tc in TaskControls)
            {
                tc.Visible = false;
                tc.SetStrings(TaskDescriptions, SpeciesQuests, TimeTaskDescriptions);
            }

            SpeciesToDex = new int[SAV.Personal.MaxSpeciesID + 1];

            var maxDex = 0;

            for (var s = 1; s <= SAV.Personal.MaxSpeciesID; s++)
            {
                var hisuiDex = PokedexSave8a.GetDexIndex(PokedexType8a.Hisui, s);
                if (hisuiDex == 0)
                {
                    continue;
                }

                SpeciesToDex[s] = hisuiDex;
                if (hisuiDex > maxDex)
                {
                    maxDex = hisuiDex;
                }
            }

            DexToSpecies = new int[maxDex + 1];
            for (var s = 1; s <= SAV.Personal.MaxSpeciesID; s++)
            {
                if (SpeciesToDex[s] != 0)
                {
                    DexToSpecies[SpeciesToDex[s]] = s;
                }
            }

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

            // Fill List
            CB_Species.InitializeBinding();
            var species = GameInfo.FilteredSources.Species.Where(z => PokedexSave8a.GetDexIndex(PokedexType8a.Hisui, z.Value) != 0).ToArray();

            CB_Species.DataSource = new BindingSource(species, null);

            CB_DisplayForm.InitializeBinding();
            DisplayedForms = new List <ComboItem> {
                new(GameInfo.Strings.types[0], 0)
            };
            CB_DisplayForm.DataSource = new BindingSource(DisplayedForms, null);

            for (var d = 1; d < DexToSpecies.Length; d++)
            {
                LB_Species.Items.Add($"{d:000} - {speciesNames[DexToSpecies[d]]}");
            }

            Editing = false;
            LB_Species.SelectedIndex = 0;
            CB_Species.KeyDown      += WinFormsUtil.RemoveDropCB;
            CanSave = true;
        }