Пример #1
0
        protected override void LoadCalculationOptions()
        {
            _loadingCalculationOptions = true;
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsCat();
            }
            //if (!Character.CalculationOptions.ContainsKey("TargetLevel"))
            //    Character.CalculationOptions["TargetLevel"] = "73";
            //if (!Character.CalculationOptions.ContainsKey("TargetArmor"))
            //    Character.CalculationOptions["TargetArmor"] = "7700";
            //if (!Character.CalculationOptions.ContainsKey("ExposeWeaknessAPValue"))
            //    Character.CalculationOptions["ExposeWeaknessAPValue"] = "200";
            //if (!Character.CalculationOptions.ContainsKey("Powershift"))
            //    Character.CalculationOptions["Powershift"] = "4";
            //if (!Character.CalculationOptions.ContainsKey("PrimaryAttack"))
            //    Character.CalculationOptions["PrimaryAttack"] = "Both";
            //if (!Character.CalculationOptions.ContainsKey("Finisher"))
            //    Character.CalculationOptions["Finisher"] = "Rip";
            //if (!Character.CalculationOptions.ContainsKey("EnforceMetagemRequirements"))
            //    Character.CalculationOptions["EnforceMetagemRequirements"] = "No";
            //if (!Character.CalculationOptions.ContainsKey("BloodlustUptime"))
            //    Character.CalculationOptions["BloodlustUptime"] = "15";
            //if (!Character.CalculationOptions.ContainsKey("DrumsOfBattleUptime"))
            //    Character.CalculationOptions["DrumsOfBattleUptime"] = "25";
            //if (!Character.CalculationOptions.ContainsKey("DrumsOfWarUptime"))
            //    Character.CalculationOptions["DrumsOfWarUptime"] = "25";
            //if (!Character.CalculationOptions.ContainsKey("ShattrathFaction"))
            //    Character.CalculationOptions["ShattrathFaction"] = "Aldor";

            CalculationOptionsCat calcOpts = Character.CalculationOptions as CalculationOptionsCat;

            comboBoxTargetLevel.SelectedItem            = calcOpts.TargetLevel.ToString();
            trackBarTargetArmor.Value                   = calcOpts.TargetArmor;
            trackBarExposeWeakness.Value                = calcOpts.ExposeWeaknessAPValue;
            trackBarNumberOfFerociousInspirations.Value = calcOpts.NumberOfFerociousInspirations;
            trackBarBloodlustUptime.Value               = (int)Math.Round(calcOpts.BloodlustUptime * 100);
            trackBarDrumsOfBattleUptime.Value           = (int)Math.Round(calcOpts.DrumsOfBattleUptime * 100);
            trackBarDrumsOfWarUptime.Value              = (int)Math.Round(calcOpts.DrumsOfWarUptime * 100);
            comboBoxPowershift.SelectedIndex            = calcOpts.Powershift;
            radioButtonMangle.Checked                   = calcOpts.PrimaryAttack == "Mangle";
            radioButtonShred.Checked                   = calcOpts.PrimaryAttack == "Shred";
            radioButtonBoth.Checked                    = calcOpts.PrimaryAttack == "Both";
            radioButtonRip.Checked                     = calcOpts.Finisher == "Rip";
            radioButtonFerociousBite.Checked           = calcOpts.Finisher == "Ferocious Bite";
            radioButtonNone.Checked                    = calcOpts.Finisher == "None";
            checkBoxEnforceMetagemRequirements.Checked = Character.EnforceMetagemRequirements;
            radioButtonAldor.Checked                   = calcOpts.ShattrathFaction == "Aldor";
            radioButtonScryer.Checked                  = calcOpts.ShattrathFaction == "Scryer";

            labelTargetArmorDescription.Text        = trackBarTargetArmor.Value.ToString() + (armorBosses.ContainsKey(trackBarTargetArmor.Value) ? armorBosses[trackBarTargetArmor.Value] : "");
            labelNumberOfFerociousInspirations.Text = trackBarNumberOfFerociousInspirations.Value.ToString();
            labelBloodlustUptime.Text     = trackBarBloodlustUptime.Value.ToString() + "%";
            labelDrumsOfBattleUptime.Text = trackBarDrumsOfBattleUptime.Value.ToString() + "%";
            labelDrumsOfWarUptime.Text    = trackBarDrumsOfWarUptime.Value.ToString() + "%";

            _loadingCalculationOptions = false;
        }
Пример #2
0
        private void calculationOptionControl_Changed(object sender, EventArgs e)
        {
            if (!_loadingCalculationOptions)
            {
                trackBarTargetArmor.Value               = 100 * (trackBarTargetArmor.Value / 100);
                labelTargetArmorDescription.Text        = trackBarTargetArmor.Value.ToString() + (armorBosses.ContainsKey(trackBarTargetArmor.Value) ? armorBosses[trackBarTargetArmor.Value] : "");
                labelExposeWeakness.Text                = trackBarExposeWeakness.Value.ToString();
                labelNumberOfFerociousInspirations.Text = trackBarNumberOfFerociousInspirations.Value.ToString();
                labelBloodlustUptime.Text               = trackBarBloodlustUptime.Value.ToString() + "%";
                labelDrumsOfBattleUptime.Text           = trackBarDrumsOfBattleUptime.Value.ToString() + "%";
                labelDrumsOfWarUptime.Text              = trackBarDrumsOfWarUptime.Value.ToString() + "%";

                CalculationOptionsCat calcOpts = Character.CalculationOptions as CalculationOptionsCat;
                Character.EnforceMetagemRequirements = checkBoxEnforceMetagemRequirements.Checked;
                calcOpts.TargetLevel = int.Parse(comboBoxTargetLevel.SelectedItem.ToString());
                calcOpts.TargetArmor = trackBarTargetArmor.Value;
                calcOpts.NumberOfFerociousInspirations = trackBarNumberOfFerociousInspirations.Value;
                calcOpts.BloodlustUptime       = (float)trackBarBloodlustUptime.Value / 100f;
                calcOpts.DrumsOfBattleUptime   = (float)trackBarDrumsOfBattleUptime.Value / 100f;
                calcOpts.DrumsOfWarUptime      = (float)trackBarDrumsOfWarUptime.Value / 100f;
                calcOpts.ExposeWeaknessAPValue = trackBarExposeWeakness.Value;
                calcOpts.Powershift            = comboBoxPowershift.SelectedIndex;
                calcOpts.ShattrathFaction      = radioButtonAldor.Checked ? "Aldor" : "Scryer";
                foreach (RadioButton radioButtonPrimaryAttack in groupBoxPrimaryAttack.Controls)
                {
                    if (radioButtonPrimaryAttack.Checked)
                    {
                        calcOpts.PrimaryAttack = radioButtonPrimaryAttack.Tag.ToString();
                    }
                }
                foreach (RadioButton radioButtonFinisher in groupBoxFinisher.Controls)
                {
                    if (radioButtonFinisher.Checked)
                    {
                        calcOpts.Finisher = radioButtonFinisher.Tag.ToString();
                    }
                }

                Character.OnItemsChanged();
            }
        }