Пример #1
0
 private void chkOptimizeIncludesHeavyCaliber_CheckedChanged(object sender, EventArgs e)
 {
     using (this.MassStateChange)
     {
         this.ModSlots.ClearSelectedMods();
         this.ModSlots.SetModChoices(MainMods.AllMods(this.State.Weapon.WeaponClass, this.chkOptimizeIncludesHeavyCaliber.Checked, this.State.Weapon.AugmentNames));
         this.ModSlots.SetToDefaults(this.State.Weapon.WeaponClass, this.chkOptimizeIncludesHeavyCaliber.Checked);
     }
 }
Пример #2
0
        private void sniperSelectionBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (this.MassStateChange)
            {
                var lastClass = this.State.Weapon == null ? WeaponClass.None : this.State.Weapon.WeaponClass;

                this.State.Weapon = (Weapon)this.sniperSelectionBox.SelectedItem;

                if (lastClass != this.State.Weapon.WeaponClass)
                {
                    bool isRifle = this.State.Weapon.WeaponClass.HasFlag(WeaponClass.Rifle);
                    this.chkOptimizeIncludesHeavyCaliber.Enabled = isRifle;
                    if (!isRifle)
                    {
                        this.chkOptimizeIncludesHeavyCaliber.Checked = false;
                    }

                    this.ModSlots.ClearSelectedMods();
                    this.ModSlots.SetModChoices(MainMods.AllMods(this.State.Weapon.WeaponClass, this.chkOptimizeIncludesHeavyCaliber.Checked, this.State.Weapon.AugmentNames));
                    this.ModSlots.SetToDefaults(this.State.Weapon.WeaponClass, this.chkOptimizeIncludesHeavyCaliber.Checked);
                }
            }
        }