private void GetEntry()
        {
            // Load Bools for the data
            int pk = species;

            L_Spinda.Visible = TB_Spinda.Visible = pk == 327;

            // Load Partitions
            for (int i = 0; i < 9; i++)
            {
                CP[i].Checked = specbools[i, pk - 1];
            }
            for (int i = 0; i < 7; i++)
            {
                CL[i].Checked = langbools[i, pk - 1];
            }

            int gt = SAV.Personal[pk].Gender;

            CHK_P2.Enabled = CHK_P4.Enabled = CHK_P6.Enabled = CHK_P8.Enabled = gt != 254;            // Not Female-Only
            CHK_P3.Enabled = CHK_P5.Enabled = CHK_P7.Enabled = CHK_P9.Enabled = gt != 0 && gt != 255; // Not Male-Only and Not Genderless

            // Load Encountered Count
            MT_Count.Text = BitConverter.ToUInt16(SAV.Data, SAV.EncounterCount + ((pk - 1) * 2)).ToString();

            CLB_FormsSeen.Items.Clear();
            CLB_FormDisplayed.Items.Clear();

            int fc = SAV.Personal[species].FormeCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }
            string[] forms = PKX.GetFormList(species, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation);
            if (forms.Length < 1)
            {
                return;
            }

            // 0x26 packs of bools
            for (int i = 0; i < forms.Length; i++) // Seen
            {
                CLB_FormsSeen.Items.Add(forms[i], formbools[f + i + (0 * FormLen * 8)]);
            }
            for (int i = 0; i < forms.Length; i++) // Seen Shiny
            {
                CLB_FormsSeen.Items.Add($"* {forms[i]}", formbools[f + i + (1 * FormLen * 8)]);
            }

            for (int i = 0; i < forms.Length; i++) // Displayed
            {
                CLB_FormDisplayed.Items.Add(forms[i], formbools[f + i + (2 * FormLen * 8)]);
            }
            for (int i = 0; i < forms.Length; i++) // Displayed Shiny
            {
                CLB_FormDisplayed.Items.Add($"* {forms[i]}", formbools[f + i + (3 * FormLen * 8)]);
            }
        }
Ejemplo n.º 2
0
        private void SetEntry()
        {
            if (species < 0)
            {
                return;
            }

            Zukan.SetCaught(species, CP[0].Checked);
            for (int i = 0; i < 4; i++)
            {
                Zukan.SetSeen(species, i, CP[i + 1].Checked);
            }
            for (int i = 0; i < 4; i++)
            {
                Zukan.SetDisplayed(species - 1, i, CP[i + 5].Checked);
            }

            for (int i = 0; i < CL.Length; i++)
            {
                Zukan.SetLanguageFlag(species - 1, i, CL[i].Checked);
            }

            if (CHK_F1.Enabled) // species < 650 // (1-649)
            {
                Zukan.SetForeignFlag(species - 1, CHK_F1.Checked);
            }

            int fc = SAV.Personal[species].FormCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }

            var seen = CLB_FormsSeen;

            for (int i = 0; i < seen.Items.Count / 2; i++) // Seen
            {
                Zukan.SetFormFlag(f + i, 0, seen.GetItemChecked(i));
            }
            for (int i = 0; i < seen.Items.Count / 2; i++)  // Seen Shiny
            {
                Zukan.SetFormFlag(f + i, 1, seen.GetItemChecked(i + (seen.Items.Count / 2)));
            }

            var display = CLB_FormDisplayed;

            for (int i = 0; i < display.Items.Count / 2; i++) // Displayed
            {
                Zukan.SetFormFlag(f + i, 2, display.GetItemChecked(i));
            }
            for (int i = 0; i < display.Items.Count / 2; i++)  // Displayed Shiny
            {
                Zukan.SetFormFlag(f + i, 3, display.GetItemChecked(i + (display.Items.Count / 2)));
            }
        }
        private void SetEntry()
        {
            if (species < 0)
            {
                return;
            }

            specbools[0, species - 1] = CHK_P1.Checked;
            specbools[1, species - 1] = CHK_P2.Checked;
            specbools[2, species - 1] = CHK_P3.Checked;
            specbools[3, species - 1] = CHK_P4.Checked;
            specbools[4, species - 1] = CHK_P5.Checked;
            specbools[5, species - 1] = CHK_P6.Checked;
            specbools[6, species - 1] = CHK_P7.Checked;
            specbools[7, species - 1] = CHK_P8.Checked;
            specbools[8, species - 1] = CHK_P9.Checked;
            if (CHK_F1.Enabled) // species < 650 // (1-649)
            {
                foreignbools[species - 1] = CHK_F1.Checked;
            }

            langbools[0, species - 1] = CHK_L1.Checked;
            langbools[1, species - 1] = CHK_L2.Checked;
            langbools[2, species - 1] = CHK_L3.Checked;
            langbools[3, species - 1] = CHK_L4.Checked;
            langbools[4, species - 1] = CHK_L5.Checked;
            langbools[5, species - 1] = CHK_L6.Checked;
            langbools[6, species - 1] = CHK_L7.Checked;

            int fc = SAV.Personal[species].FormeCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }

            for (int i = 0; i < CLB_FormsSeen.Items.Count / 2; i++) // Seen
            {
                formbools[f + i + (0 * FormLen * 8)] = CLB_FormsSeen.GetItemChecked(i);
            }
            for (int i = 0; i < CLB_FormsSeen.Items.Count / 2; i++)  // Seen Shiny
            {
                formbools[f + i + (1 * FormLen * 8)] = CLB_FormsSeen.GetItemChecked(i + (CLB_FormsSeen.Items.Count / 2));
            }

            editing = true;
            for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++) // Displayed
            {
                formbools[f + i + (2 * FormLen * 8)] = CLB_FormDisplayed.GetItemChecked(i);
            }
            for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++)  // Displayed Shiny
            {
                formbools[f + i + (3 * FormLen * 8)] = CLB_FormDisplayed.GetItemChecked(i + (CLB_FormDisplayed.Items.Count / 2));
            }
            editing = false;
        }
Ejemplo n.º 4
0
        private void SetEntry()
        {
            if (species < 0)
            {
                return;
            }

            Zukan.SetCaught(species, CP[0].Checked);
            for (int i = 0; i < 4; i++)
            {
                Zukan.SetSeen(species, i, CP[i + 1].Checked);
            }
            for (int i = 0; i < 4; i++)
            {
                Zukan.SetDisplayed(species - 1, i, CP[i + 5].Checked);
            }

            for (int i = 0; i < CL.Length; i++)
            {
                Zukan.SetLanguageFlag(species - 1, i, CL[i].Checked);
            }

            ushort count = (ushort)Math.Min(0xFFFF, Util.ToUInt32(MT_Count.Text));

            Zukan.SetEncounterCount(species - 1, count);

            int fc = SAV.Personal[species].FormCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }

            var seen = CLB_FormsSeen;

            for (int i = 0; i < seen.Items.Count / 2; i++) // Seen
            {
                Zukan.SetFormFlag(f + i, 0, seen.GetItemChecked(i));
            }
            for (int i = 0; i < seen.Items.Count / 2; i++)  // Seen Shiny
            {
                Zukan.SetFormFlag(f + i, 1, seen.GetItemChecked(i + (seen.Items.Count / 2)));
            }

            var display = CLB_FormDisplayed;

            for (int i = 0; i < display.Items.Count / 2; i++) // Displayed
            {
                Zukan.SetFormFlag(f + i, 2, display.GetItemChecked(i));
            }
            for (int i = 0; i < display.Items.Count / 2; i++)  // Displayed Shiny
            {
                Zukan.SetFormFlag(f + i, 3, display.GetItemChecked(i + (display.Items.Count / 2)));
            }
        }
        private void SetEntry()
        {
            if (species < 0)
            {
                return;
            }

            specbools[0, species - 1] = CHK_P1.Checked;
            specbools[1, species - 1] = CHK_P2.Checked;
            specbools[2, species - 1] = CHK_P3.Checked;
            specbools[3, species - 1] = CHK_P4.Checked;
            specbools[4, species - 1] = CHK_P5.Checked;
            specbools[5, species - 1] = CHK_P6.Checked;
            specbools[6, species - 1] = CHK_P7.Checked;
            specbools[7, species - 1] = CHK_P8.Checked;
            specbools[8, species - 1] = CHK_P9.Checked;

            langbools[0, species - 1] = CHK_L1.Checked;
            langbools[1, species - 1] = CHK_L2.Checked;
            langbools[2, species - 1] = CHK_L3.Checked;
            langbools[3, species - 1] = CHK_L4.Checked;
            langbools[4, species - 1] = CHK_L5.Checked;
            langbools[5, species - 1] = CHK_L6.Checked;
            langbools[6, species - 1] = CHK_L7.Checked;

            BitConverter.GetBytes((ushort)Math.Min(0xFFFF, Util.ToUInt32(MT_Count.Text))).CopyTo(SAV.Data, SAV.EncounterCount + ((species - 1) * 2));

            int fc = SAV.Personal[species].FormeCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }

            for (int i = 0; i < CLB_FormsSeen.Items.Count / 2; i++) // Seen
            {
                formbools[f + i + (0 * FormLen * 8)] = CLB_FormsSeen.GetItemChecked(i);
            }
            for (int i = 0; i < CLB_FormsSeen.Items.Count / 2; i++)  // Seen Shiny
            {
                formbools[f + i + (1 * FormLen * 8)] = CLB_FormsSeen.GetItemChecked(i + (CLB_FormsSeen.Items.Count / 2));
            }

            editing = true;
            for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++) // Displayed
            {
                formbools[f + i + (2 * FormLen * 8)] = CLB_FormDisplayed.GetItemChecked(i);
            }
            for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++)  // Displayed Shiny
            {
                formbools[f + i + (3 * FormLen * 8)] = CLB_FormDisplayed.GetItemChecked(i + (CLB_FormDisplayed.Items.Count / 2));
            }
            editing = false;
        }
Ejemplo n.º 6
0
        private void GetEntry()
        {
            // Load Bools for the data
            int pk = species;

            L_Spinda.Visible = TB_Spinda.Visible = pk == (int)Species.Spinda;

            // Load Partitions
            CP[0].Checked = Zukan.GetCaught(species);
            for (int i = 0; i < 4; i++)
            {
                CP[i + 1].Checked = Zukan.GetSeen(species, i);
            }

            for (int i = 0; i < 4; i++)
            {
                CP[i + 5].Checked = Zukan.GetDisplayed(species - 1, i);
            }

            for (int i = 0; i < CL.Length; i++)
            {
                CL[i].Checked = Zukan.GetLanguageFlag(species - 1, i);
            }

            var pi = SAV.Personal[pk];

            CHK_P2.Enabled = CHK_P4.Enabled = CHK_P6.Enabled = CHK_P8.Enabled = !pi.OnlyFemale;
            CHK_P3.Enabled = CHK_P5.Enabled = CHK_P7.Enabled = CHK_P9.Enabled = !(pi.OnlyMale || pi.Genderless);

            MT_Count.Text = Zukan.GetEncounterCount(species - 1).ToString();

            CLB_FormsSeen.Items.Clear();
            CLB_FormDisplayed.Items.Clear();

            int fc = pi.FormCount;
            int f  = DexFormUtil.GetDexFormIndexORAS(species, fc);

            if (f < 0)
            {
                return;
            }
            string[] forms = FormConverter.GetFormList(species, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation);
            if (forms.Length < 1)
            {
                return;
            }

            for (int i = 0; i < forms.Length; i++) // Seen
            {
                CLB_FormsSeen.Items.Add(forms[i], Zukan.GetFormFlag(f + i, 0));
            }
            for (int i = 0; i < forms.Length; i++) // Seen Shiny
            {
                CLB_FormsSeen.Items.Add($"* {forms[i]}", Zukan.GetFormFlag(f + i, 1));
            }

            for (int i = 0; i < forms.Length; i++) // Displayed
            {
                CLB_FormDisplayed.Items.Add(forms[i], Zukan.GetFormFlag(f + i, 2));
            }
            for (int i = 0; i < forms.Length; i++) // Displayed Shiny
            {
                CLB_FormDisplayed.Items.Add($"* {forms[i]}", Zukan.GetFormFlag(f + i, 3));
            }
        }