Exemplo n.º 1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            var diceRuleForm = new DiceRuleForm();
            if (diceRuleForm.ShowDialog() != DialogResult.OK)
                return;

            if (InputBoxForm.Open(LocaleString.Get("$askdiceruletitle")) != DialogResult.OK)
                return;

            diceRuleForm.Result.Name = InputBoxForm.Answer;
            DataManager.Settings.DiceRules.Add(diceRuleForm.Result);
            diceRuleListBox.Items.Add(diceRuleForm.Result);
        }
Exemplo n.º 2
0
        private void ModifyDiceRule(DiceRule dr)
        {
            var diceRuleForm = new DiceRuleForm();
            diceRuleForm.Result = dr;

            if (diceRuleForm.ShowDialog() != DialogResult.OK)
                return;

            if (InputBoxForm.Open(LocaleString.Get("$askdiceruletitle"), "", dr.Name) != DialogResult.OK)
                return;

            dr.CopyFrom(diceRuleForm.Result);
            dr.Name = InputBoxForm.Answer;
        }