Example #1
0
        private void B_GiveAll_Click(object sender, EventArgs e)
        {
            if (CHK_L1.Enabled)
            {
                CHK_L1.Checked                         =
                    CHK_L2.Checked                     =
                        CHK_L3.Checked                 =
                            CHK_L4.Checked             =
                                CHK_L5.Checked         =
                                    CHK_L6.Checked     =
                                        CHK_L7.Checked = ModifierKeys != Keys.Control;
            }
            if (CHK_P1.Enabled)
            {
                CHK_P1.Checked = ModifierKeys != Keys.Control;
            }
            int index = LB_Species.SelectedIndex + 1;
            int gt    = SAV.Personal[index].Gender;

            bool canBeMale   = gt != PersonalInfo.RatioMagicFemale;
            bool canBeFemale = gt is not(PersonalInfo.RatioMagicMale or PersonalInfo.RatioMagicGenderless);

            CHK_P2.Checked = CHK_P4.Checked = canBeMale && ModifierKeys != Keys.Control;
            CHK_P3.Checked = CHK_P5.Checked = canBeFemale && ModifierKeys != Keys.Control;

            if (ModifierKeys == Keys.Control)
            {
                foreach (var chk in new[] { CHK_P6, CHK_P7, CHK_P8, CHK_P9 })
                {
                    chk.Checked = false;
                }
            }
            else if (!(CHK_P6.Checked || CHK_P7.Checked || CHK_P8.Checked || CHK_P9.Checked))
            {
                (gt != PersonalInfo.RatioMagicFemale ? CHK_P6 : CHK_P7).Checked = true;
            }

            for (int i = 0; i < CLB_FormsSeen.Items.Count; i++)
            {
                CLB_FormsSeen.SetItemChecked(i, ModifierKeys != Keys.Control);
            }
            if (CLB_FormsSeen.Items.Count > 0 && CLB_FormDisplayed.CheckedItems.Count == 0)
            {
                CLB_FormDisplayed.SetItemChecked(0, ModifierKeys != Keys.Control);
            }

            if (Util.ToInt32(MT_Count.Text) == 0)
            {
                MT_Count.Text = "1";
            }
        }
Example #2
0
        private void ModifyAllForms(object sender, EventArgs e)
        {
            for (int i = 0; i < CB_Species.Items.Count; i++)
            {
                LB_Species.SelectedIndex = i;
                if (CLB_FormsSeen.Items.Count == 0)
                {
                    continue;
                }

                if (sender == mnuForm1)
                {
                    if (CLB_FormsSeen.CheckedItems.Count == 0)
                    {
                        CLB_FormsSeen.SetItemChecked(0, true);
                    }

                    if (CLB_FormDisplayed.CheckedItems.Count == 0)
                    {
                        CLB_FormDisplayed.SetItemChecked(0, true);
                    }
                }
                else if (sender == mnuFormAll)
                {
                    for (int f = 0; f < CLB_FormsSeen.Items.Count; f++)
                    {
                        CLB_FormsSeen.SetItemChecked(f, true);
                    }
                    if (CLB_FormDisplayed.CheckedItems.Count == 0)
                    {
                        CLB_FormDisplayed.SetItemChecked(0, true);
                    }
                }
                else // none
                {
                    for (int f = 0; f < CLB_FormsSeen.Items.Count; f++)
                    {
                        CLB_FormsSeen.SetItemChecked(f, false);
                    }
                    for (int f = 0; f < CLB_FormDisplayed.Items.Count; f++)
                    {
                        CLB_FormDisplayed.SetItemChecked(f, false);
                    }
                }
            }
        }
Example #3
0
        private void modifyAllForms(object sender, EventArgs e)
        {
            if (sender == mnuFormNone)
            {
                formbools = new BitArray(new bool[formbools.Length]); // reset false
                getEntry();
                return;
            }

            for (int i = 0; i < CB_Species.Items.Count; i++)
            {
                LB_Species.SelectedIndex = i;
                if (CLB_FormsSeen.Items.Count == 0)
                {
                    continue;
                }

                if (sender == mnuForm1)
                {
                    if (CLB_FormsSeen.CheckedItems.Count == 0)
                    {
                        CLB_FormsSeen.SetItemChecked(0, true);
                    }

                    if (CLB_FormDisplayed.CheckedItems.Count == 0)
                    {
                        CLB_FormDisplayed.SetItemChecked(0, true);
                    }
                }
                else if (sender == mnuFormAll)
                {
                    for (int f = 0; f < CLB_FormsSeen.Items.Count; f++)
                    {
                        CLB_FormsSeen.SetItemChecked(f, true);
                    }
                    if (CLB_FormDisplayed.CheckedItems.Count == 0)
                    {
                        CLB_FormDisplayed.SetItemChecked(0, true);
                    }
                }
            }
        }
Example #4
0
        private void updateDisplayedForm(object sender, ItemCheckEventArgs e)
        {
            if (editing)
            {
                return;
            }

            // Only allow one form to be displayed if the user sets a new display value
            if (e.NewValue != CheckState.Checked)
            {
                return;
            }
            for (int i = 0; i < CLB_FormDisplayed.Items.Count; i++)
            {
                if (i != e.Index)
                {
                    CLB_FormDisplayed.SetItemChecked(i, false);
                }
                else if (sender == CLB_FormDisplayed)
                {
                    CLB_FormsSeen.SetItemChecked(e.Index, true); // ensure this form is seen
                }
            }
        }