Example #1
0
        private void WeaponCreation_Load(object sender, EventArgs e)
        {
            nameBox            = (nameControl.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            propBox            = (props.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            rollBox            = (rollNameTextBox.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            rollBox.Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(105, 105, 105));
            rollBox.Text       = "roll name";

            bothRadioButton.Checked = true;
            if (selectedWeapon != null)
            {
                //enter in weapon stats to controls
                nameBox.Text           = selectedWeapon.Name;
                propBox.Text           = selectedWeapon.Properties;
                profCheckBox.Checked   = selectedWeapon.Proficient;
                finessCheckBox.Checked = selectedWeapon.Finesse;
                damageRoll             = selectedWeapon.Damage;
                damageRollDisplay.Text = damageRoll.ToString();
                saveButton.Text        = "Save Weapon";
                titleLabel.Text        = "Edit Weapon";
                foreach (Roll r in selectedWeapon.BonusRolls)
                {
                    AddBonusRolls(r.DieNum, r.DieAmount, r.Flat, r.Name, r.Type, r.Optional);
                }
            }
            else
            {
                saveButton.Enabled = false;
                this.ActiveControl = nameControl;
            }
            nameBox.TextChanged += nameBoxTextChanged;
        }
Example #2
0
 //set damage roll
 public void SetDamageRoll(Roll r)
 {
     damageRoll             = r;
     damageRollDisplay.Text = r.ToString();
     if (nameBox.Text != "")
     {
         saveButton.Enabled = true;
     }
 }
Example #3
0
 //initialize form
 private void FeatCreation_Load(object sender, EventArgs e)
 {
     //check if creating or editing feat
     if (selectedFeat == null)
     {
         //disable buttons for roll
         usesRollCheckBox.Checked   = false;
         setRollButton.Enabled      = false;
         LimitedUsecheckBox.Checked = true;
         nameTextBox.Select();
     }
     else
     {
         //set controls to feat stats
         nameTextBox.Text         = selectedFeat.Name;
         abilitiesTextBox.Text    = selectedFeat.Abilities;
         usesRollCheckBox.Checked = selectedFeat.UseRoll;
         //limited use
         if (selectedFeat.LimitedUse)
         {
             if (selectedFeat.RefillTypeProperty == RefillType.SHORT)
             {
                 shortRestRadioButton.Checked = true;
             }
             else if (selectedFeat.RefillTypeProperty == RefillType.LONG)
             {
                 longRestradioButton.Checked = true;
             }
             else
             {
                 OtherradioButton.Checked = true;
             }
             numUsesBox.Value             = selectedFeat.NumUses;
             LimitedUsecheckBox.Checked   = selectedFeat.LimitedUse;
             shortRestRadioButton.Enabled = true;
             longRestradioButton.Enabled  = true;
             OtherradioButton.Enabled     = true;
         }
         //roll
         if (selectedFeat.UseRoll)
         {
             usesRollCheckBox.Checked = true;
             roll = selectedFeat.Roll;
             rollDisplayTextBox.Text = "Roll: " + roll.ToString();
         }
         saveButton.Text = "Save Feat";
     }
 }
Example #4
0
 //set new roll
 public void SetRoll(Roll r)
 {
     roll = r;
     rollDisplayTextBox.Text = "Roll: " + roll.ToString();
     saveButton.Enabled      = true;
 }