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