Example #1
0
        private void EditAttackButton_Click(object sender, EventArgs e)
        {
            Attack selectedAttack = null;

            foreach (Control control in AttackPanel.Controls)
            {
                if (((AttackTab)control).Selected.Checked)
                {
                    selectedAttack = ((AttackTab)control).cAttack;
                    break;
                }
            }
            bool doTheThing = true;

            if (selectedAttack == null)
            {
                DialogResult noSelect = MessageBox.Show("Do you wish to create a new Attack?", "Nothing Selected", MessageBoxButtons.YesNoCancel);
                if (noSelect != DialogResult.Yes)
                {
                    doTheThing = false;
                }
            }

            if (doTheThing)
            {
                AddorEditAttack newAtk = new AddorEditAttack(player, selectedAttack);
                DialogResult    result = newAtk.ShowDialog();
                if (result == DialogResult.OK)
                {
                    Refresh_Click(null, null);
                }
            }
        }
Example #2
0
        private void AddAttackButton_Click(object sender, EventArgs e)
        {
            AddorEditAttack newAtk = new AddorEditAttack(player, null);
            DialogResult    result = newAtk.ShowDialog();

            if (result == DialogResult.OK)
            {
                Refresh_Click(null, null);
            }
        }