Exemplo n.º 1
0
    private void SetEntry()
    {
        if (species < 0)
        {
            return;
        }

        var Dex = SAV.Zukan;

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

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

        if (species <= 493)
        {
            for (int i = 0; i < 7; i++)
            {
                Dex.SetLanguageFlag(species - 1, i, CL[i].Checked);
            }
        }

        int fc = SAV.Personal[species].FormCount;
        int f  = SAV is SAV5B2W2?DexFormUtil.GetDexFormIndexB2W2(species, fc) : DexFormUtil.GetDexFormIndexBW(species, fc);

        if (f < 0)
        {
            return;
        }

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

        editing = true;
        for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++) // Displayed
        {
            Dex.SetFormFlag(f + i, 2, CLB_FormDisplayed.GetItemChecked(i));
        }
        for (int i = 0; i < CLB_FormDisplayed.Items.Count / 2; i++)  // Displayed Shiny
        {
            Dex.SetFormFlag(f + i, 3, CLB_FormDisplayed.GetItemChecked(i + (CLB_FormDisplayed.Items.Count / 2)));
        }
        editing = false;
    }
Exemplo n.º 2
0
        private void SetEntry()
        {
            if (species < 0)
            {
                return;
            }

            for (int i = 0; i < 9; i++)
            {
                specbools[i, species - 1] = CP[i].Checked;
            }

            if (species <= 493)
            {
                for (int i = 0; i < 7; i++)
                {
                    langbools[i, species - 1] = CL[i].Checked;
                }
            }

            int fc = SAV.Personal[species].FormeCount;
            int f  = SAV.B2W2 ? DexFormUtil.GetDexFormIndexB2W2(species, fc) : DexFormUtil.GetDexFormIndexBW(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;
        }
Exemplo n.º 3
0
    private void GetEntry()
    {
        // Load Bools for the data
        int pk = species;

        // Load Partitions
        var Dex = SAV.Zukan;

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

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

        if (species > 493)
        {
            for (int i = 0; i < 7; i++)
            {
                CL[i].Checked = false;
            }
            GB_Language.Enabled = false;
        }
        else
        {
            for (int i = 0; i < 7; i++)
            {
                CL[i].Checked = SAV.Zukan.GetLanguageFlag(species - 1, i);
            }
            GB_Language.Enabled = true;
        }

        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);

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

        int fc = pi.FormCount;
        int f  = SAV is SAV5B2W2?DexFormUtil.GetDexFormIndexB2W2(species, fc) : DexFormUtil.GetDexFormIndexBW(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], Dex.GetFormFlag(f + i, 0));
        }
        for (int i = 0; i < forms.Length; i++) // Seen Shiny
        {
            CLB_FormsSeen.Items.Add($"* {forms[i]}", Dex.GetFormFlag(f + i, 1));
        }

        for (int i = 0; i < forms.Length; i++) // Displayed
        {
            CLB_FormDisplayed.Items.Add(forms[i], Dex.GetFormFlag(f + i, 2));
        }
        for (int i = 0; i < forms.Length; i++) // Displayed Shiny
        {
            CLB_FormDisplayed.Items.Add($"* {forms[i]}", Dex.GetFormFlag(f + i, 3));
        }
    }
Exemplo n.º 4
0
        private void GetEntry()
        {
            // Load Bools for the data
            int pk = species;

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

            if (species > 493)
            {
                for (int i = 0; i < 7; i++)
                {
                    CL[i].Checked = false;
                }
                GB_Language.Enabled = false;
            }
            else
            {
                for (int i = 0; i < 7; i++)
                {
                    CL[i].Checked = langbools[i, pk - 1];
                }
                GB_Language.Enabled = true;
            }

            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

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

            int fc = SAV.Personal[species].FormeCount;
            int f  = SAV.B2W2 ? DexFormUtil.GetDexFormIndexB2W2(species, fc) : DexFormUtil.GetDexFormIndexBW(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;
            }

            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)]);
            }
        }