private void getLangStrings()
        {
            // Memory Chooser
            int memorycount = Form1.memories.Length - 38;

            string[] memories = new string[memorycount];
            int[]    allowed  = new int[memorycount];
            for (int i = 0; i < memorycount; i++)
            {
                memories[i] = Form1.memories[38 + i];
                allowed[i]  = i + 1;
            }
            Array.Resize(ref allowed, allowed.Length - 1);
            var memory_list1 = Util.getCBList(new string[] { memories[0] }, null);
            var memory_list  = Util.getOffsetCBList(memory_list1, memories, 0, allowed);

            CB_OTMemory.DataSource    = memory_list;
            CB_OTMemory.DisplayMember = "Text";
            CB_OTMemory.ValueMember   = "Value";

            var mem1_list = new BindingSource(memory_list, null);

            CB_CTMemory.DataSource    = mem1_list;
            CB_CTMemory.DisplayMember = "Text";
            CB_CTMemory.ValueMember   = "Value";

            // Quality Chooser
            CB_CTQual.Items.Clear();
            CB_OTQual.Items.Clear();
            for (int i = 0; i < 7; i++)
            {
                CB_CTQual.Items.Add(Form1.memories[2 + i]);
                CB_OTQual.Items.Add(Form1.memories[2 + i]);
            }

            // Feeling Chooser
            CB_CTFeel.Items.Clear();
            CB_OTFeel.Items.Clear();
            for (int i = 0; i < 24; i++)
            {
                CB_CTFeel.Items.Add(Form1.memories[10 + i]);
                CB_OTFeel.Items.Add(Form1.memories[10 + i]);
            }
        }
Пример #2
0
        public static void InitializeDataSources(GameStrings s)
        {
            int[] ball_nums = { 007, 576, 013, 492, 497, 014, 495, 493, 496, 494, 011, 498, 008, 006, 012, 015, 009, 005, 499, 010, 001, 016, 851 };
            int[] ball_vals = { 007, 025, 013, 017, 022, 014, 020, 018, 021, 019, 011, 023, 008, 006, 012, 015, 009, 005, 024, 010, 001, 016, 026 };
            BallDataSource    = Util.getVariedCBList(s.itemlist, ball_nums, ball_vals);
            SpeciesDataSource = Util.getCBList(s.specieslist, null);
            NatureDataSource  = Util.getCBList(s.natures, null);
            AbilityDataSource = Util.getCBList(s.abilitylist, null);
            VersionDataSource = Util.getCBList(s.gamelist, Legal.Games_7sm, Legal.Games_6oras, Legal.Games_6xy, Legal.Games_5, Legal.Games_4, Legal.Games_4e, Legal.Games_4r, Legal.Games_3, Legal.Games_3e, Legal.Games_3r, Legal.Games_3s);

            HaXMoveDataSource = Util.getCBList(s.movelist, null);
            MoveDataSource    = HaXMoveDataSource.Where(m => !Legal.Z_Moves.Contains(m.Value)).ToList();
            #region Met Locations
            // Gen 2
            {
                var met_list = Util.getCBList(s.metGSC_00000, Enumerable.Range(0, 0x5F).ToArray());
                met_list = Util.getOffsetCBList(met_list, s.metGSC_00000, 00000, new[] { 0x7E, 0x7F });
                metGen2  = met_list;
            }
            // Gen 3
            {
                var met_list = Util.getCBList(s.metRSEFRLG_00000, Enumerable.Range(0, 213).ToArray());
                met_list = Util.getOffsetCBList(met_list, s.metRSEFRLG_00000, 00000, new[] { 253, 254, 255 });
                metGen3  = met_list;

                var cxd_list = Util.getCBList(s.metCXD_00000, Enumerable.Range(0, s.metCXD_00000.Length).ToArray()).Where(c => c.Text.Length > 0).ToList();
                metGen3CXD = cxd_list;
            }
            // Gen 4
            {
                var met_list = Util.getCBList(s.metHGSS_00000, new[] { 0 });
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_02000, 2000, new[] { 2000 });
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_02000, 2000, new[] { 2002 });
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_03000, 3000, new[] { 3001 });
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_00000, 0000, Legal.Met_HGSS_0);
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_02000, 2000, Legal.Met_HGSS_2);
                met_list = Util.getOffsetCBList(met_list, s.metHGSS_03000, 3000, Legal.Met_HGSS_3);
                metGen4  = met_list;
            }
            // Gen 5
            {
                var met_list = Util.getCBList(s.metBW2_00000, new[] { 0 });
                met_list = Util.getOffsetCBList(met_list, s.metBW2_60000, 60001, new[] { 60002 });
                met_list = Util.getOffsetCBList(met_list, s.metBW2_30000, 30001, new[] { 30003 });
                met_list = Util.getOffsetCBList(met_list, s.metBW2_00000, 00000, Legal.Met_BW2_0);
                met_list = Util.getOffsetCBList(met_list, s.metBW2_30000, 30001, Legal.Met_BW2_3);
                met_list = Util.getOffsetCBList(met_list, s.metBW2_40000, 40001, Legal.Met_BW2_4);
                met_list = Util.getOffsetCBList(met_list, s.metBW2_60000, 60001, Legal.Met_BW2_6);
                metGen5  = met_list;
            }
            // Gen 6
            {
                var met_list = Util.getCBList(s.metXY_00000, new[] { 0 });
                met_list = Util.getOffsetCBList(met_list, s.metXY_60000, 60001, new[] { 60002 });
                met_list = Util.getOffsetCBList(met_list, s.metXY_30000, 30001, new[] { 30002 });
                met_list = Util.getOffsetCBList(met_list, s.metXY_00000, 00000, Legal.Met_XY_0);
                met_list = Util.getOffsetCBList(met_list, s.metXY_30000, 30001, Legal.Met_XY_3);
                met_list = Util.getOffsetCBList(met_list, s.metXY_40000, 40001, Legal.Met_XY_4);
                met_list = Util.getOffsetCBList(met_list, s.metXY_60000, 60001, Legal.Met_XY_6);
                metGen6  = met_list;
            }
            // Gen 7
            {
                var met_list = Util.getCBList(s.metSM_00000, new[] { 0 });
                met_list = Util.getOffsetCBList(met_list, s.metSM_60000, 60001, new[] { 60002 });
                met_list = Util.getOffsetCBList(met_list, s.metSM_30000, 30001, new[] { 30002 });
                met_list = Util.getOffsetCBList(met_list, s.metSM_00000, 00000, Legal.Met_SM_0);
                met_list = Util.getOffsetCBList(met_list, s.metSM_30000, 30001, Legal.Met_SM_3);
                met_list = Util.getOffsetCBList(met_list, s.metSM_40000, 40001, Legal.Met_SM_4);
                met_list = Util.getOffsetCBList(met_list, s.metSM_60000, 60001, Legal.Met_SM_6);
                metGen7  = met_list;
            }
            #endregion
        }