Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public SAV_SecretBase(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV         = (SAV6AO)(Origin = sav).Clone();
            abilitylist = GameInfo.Strings.abilitylist;

            SetupComboBoxes();
            PopFavorite();
            PopFavorite();
            TB_FOT.Font = TB_FT1.Font = TB_FT2.Font = TB_FSay1.Font = TB_FSay2.Font = TB_FSay3.Font = TB_FSay4.Font = LB_Favorite.Font = FontUtil.GetPKXFont();
            CB_Ability.InitializeBinding();

            LB_Favorite.SelectedIndex = 0;
            MT_Flags.Text             = SAV.Records.GetRecord(080).ToString(); // read counter; also present in the Secret Base data block
            B_SAV2FAV(null, EventArgs.Empty);
        }
Exemplo n.º 5
0
        public SAV_SecretBase(SaveFile sav)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV         = (SAV6)(Origin = sav).Clone();
            abilitylist = GameInfo.Strings.abilitylist;

            SetupComboBoxes();
            PopFavorite();
            PopFavorite();
            TB_FOT.Font = TB_FT1.Font = TB_FT2.Font = TB_FSay1.Font = TB_FSay2.Font = TB_FSay3.Font = TB_FSay4.Font = LB_Favorite.Font = FontUtil.GetPKXFont(11);
            CB_Ability.InitializeBinding();

            LB_Favorite.SelectedIndex = 0;
            // MT_Flags.Text = BitConverter.ToUInt16(sav, 0x24800 + 0x140).ToString(); PSS Stat transmitted
            MT_Flags.Text = BitConverter.ToUInt32(SAV.Data, SAV.SecretBase + 0x62C).ToString(); // read counter
            B_SAV2FAV(null, EventArgs.Empty);
        }