Esempio n. 1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            GeneralSettings.Default.ShowRelativeToEquipped = CK_ShowRelToEqu.IsChecked.GetValueOrDefault(false);
            OptimizerSettings.Default.TemplateGemsEnabled  = TemplateGemsCheck.IsChecked.GetValueOrDefault(true);
            OptimizerSettings.Default.WarningsEnabled      = WarningsCheck.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.UseMultithreading      = CK_MultiThreading.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.DisplayBuffSource      = CK_BuffSource.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.DisplayGemNames        = CK_GemNames.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.DisplayUnusedStats     = CK_DisplayUnusedStats.IsChecked.GetValueOrDefault(true);
            //GeneralSettings.Default.DisplayExtraItemInfo        = CK_DisplayExtraItemInfo.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.HideProfEnchants              = CK_HideEnchantsBasedOnProfs.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements        = CK_EnforceGemCheck.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_Meta   = CK_EnforceMeta.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_JC     = CK_EnforceJC.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_Unique = CK_EnforceUnique.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.DisplayInCompactMode          = CK_CompactMode.IsChecked.GetValueOrDefault(false);
            GeneralSettings.Default.UIScale = SL_UIScale.Value;
            GeneralSettings.Default.ItemNameWidthSetting = CB_ItemNameWidthSetting.SelectedIndex;
            GeneralSettings.Default.PTRMode = CK_PTRModeCheck.IsChecked.GetValueOrDefault(false);
            OptimizerSettings.Default.OptimizationMethod       = (OptimizationMethod)OptimizationMethodCombo.SelectedIndex;
            OptimizerSettings.Default.GreedyOptimizationMethod = (GreedyOptimizationMethod)GreedyMethodCombo.SelectedIndex;
            GeneralSettings.Default.ProcEffectMode             = ProcEffectModeCombo.SelectedIndex;
            GeneralSettings.Default.CombinationEffectMode      = EffectCombinationsCalculationMode.SelectedIndex;
#if !SILVERLIGHT
            GeneralSettings.Default.AlertMeToBetaReleases = BetaAlertsCheck.IsChecked.GetValueOrDefault(false);
#endif
            OnDisplayBuffChanged();
            OnHideProfessionsChanged();
            SpecialEffect.UpdateCalculationMode();
            MainPage.Instance.Character.OnCalculationsInvalidated();
            this.DialogResult = true;
        }
Esempio n. 2
0
        public void GetAverageUptimeTest()
        {
            // test interpolation at proc chance = 100%
            Properties.GeneralSettings.Default.ProcEffectMode = 3;
            SpecialEffect.UpdateCalculationMode();
            SpecialEffect target = new SpecialEffect(Trigger.PhysicalCrit, new Stats()
            {
                AttackPower = 632
            }, 10.0f, 45.0f, 1.0f);                                                                                                // TODO: Initialize to an appropriate value
            float triggerInterval = 1.39778626F;
            float triggerChance   = 1.0F;
            float attackSpeed     = 3.4F;
            float fightDuration   = 300.0F;
            float expected        = 70.0F / 300.0F;
            float actual;

            actual = target.GetAverageUptime(triggerInterval, triggerChance, attackSpeed, fightDuration);
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            OptimizerSettings.Default.TemplateGemsEnabled = TemplateGemsCheck.IsChecked.GetValueOrDefault();
            OptimizerSettings.Default.WarningsEnabled     = WarningsCheck.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.UseMultithreading     = CK_MultiThreading.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.DisplayBuffSource     = CK_BuffSource.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.DisplayGemNames       = CK_GemNames.IsChecked.GetValueOrDefault();
            //GeneralSettings.Default.DisplayExtraItemInfo = CK_DisplayExtraItemInfo.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.HideProfEnchants              = CK_HideEnchantsBasedOnProfs.IsChecked.GetValueOrDefault();
            GeneralSettings.Default.EnforceGemRequirements        = CK_EnforceGemCheck.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_Meta   = CK_EnforceMeta.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_JC     = CK_EnforceJC.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.EnforceGemRequirements_Unique = CK_EnforceUnique.IsChecked.GetValueOrDefault(true);
            GeneralSettings.Default.ItemNameWidthSetting          = CB_ItemNameWidthSetting.SelectedIndex;
            switch (OptimizationMethodCombo.SelectedIndex)
            {
            case 0: OptimizerSettings.Default.OptimizationMethod = OptimizationMethod.GeneticAlgorithm; break;

            case 1: OptimizerSettings.Default.OptimizationMethod = OptimizationMethod.SimulatedAnnealing; break;
            }
            switch (GreedyMethodCombo.SelectedIndex)
            {
            case 0: OptimizerSettings.Default.GreedyOptimizationMethod = GreedyOptimizationMethod.AllCombinations; break;

            case 1: OptimizerSettings.Default.GreedyOptimizationMethod = GreedyOptimizationMethod.SingleChanges; break;

            case 2: OptimizerSettings.Default.GreedyOptimizationMethod = GreedyOptimizationMethod.GreedyBest; break;
            }
            GeneralSettings.Default.ProcEffectMode        = ProcEffectModeCombo.SelectedIndex;
            GeneralSettings.Default.CombinationEffectMode = EffectCombinationsCalculationMode.SelectedIndex;
            OnDisplayBuffChanged();
            OnHideProfessionsChanged();
            SpecialEffect.UpdateCalculationMode();
            MainPage.Instance.Character.OnCalculationsInvalidated();
            this.DialogResult = true;
        }
Esempio n. 4
0
        public void Save()
        {
            string message = string.Empty;
            string title   = string.Empty;

            Rawr.Properties.GeneralSettings.Default.UseMultithreading    = CK_UseMultithreading.Checked;
            Rawr.Properties.GeneralSettings.Default.DisplayBuffSource    = CK_BuffSource.Checked;
            Rawr.Properties.GeneralSettings.Default.DisplayGemNames      = CK_GemNames.Checked;
            Rawr.Properties.GeneralSettings.Default.DisplayExtraItemInfo = CK_DisplayItemIds.Checked;
            Rawr.Properties.GeneralSettings.Default.HideProfEnchants     = CK_HideEnchantsBasedOnProfs.Checked;
            Rawr.Properties.GeneralSettings.Default.Locale                = _locale;
            Rawr.Properties.GeneralSettings.Default.ProcEffectMode        = CB_ProcEffectCalculationMode.SelectedIndex;
            Rawr.Properties.GeneralSettings.Default.CombinationEffectMode = CB_EffectCombinationsCalculationMode.SelectedIndex;
            Rawr.Properties.GeneralSettings.Default.ItemNameWidthSetting  = CB_ItemNameWidthSetting.SelectedIndex;
            Rawr.Properties.GeneralSettings.Default.Save();
            switch (_locale)
            {
            case "de":
                title   = "Profil Aktualisieren";
                message = "Um die deutsche Lokalisierung nachzuladen müssen sie auf 'Update Item Cache from Wowhead' drücken.";
                break;

            case "fr":
                title   = "Mise à jour du Profil";
                message = "Vous devez utiliser 'Update Item Cache from Wowhead' pour mettre à jour le nom des objets en français.";
                break;

            case "es":
                title   = "Actualiza tu Perfil";
                message = "Debe utilizar 'Update Item Cache from Wowhead' para volver a cargar los elementos de localización para el Español.";
                break;

            case "ru":
                title   = "Обновить профиль";
                message = "Вы должны использовать 'Update Item Cache from Wowhead' чтобы перезагрузить пунктов для Российских локаль.";
                break;

            case "zhTW":
                title   = "更新資料";
                message = "本地化檔案請選擇'Update Item Cache from Wowhead'";
                break;

            case "zhCN":
                title   = "更新资料";
                message = "本地化档案请选择'Update Item Cache from Wowhead'";
                break;

            case "kr":
                title   = "프로필 업데이트";
                message = "선택하세요'Update Item Cache from Wowhead'";
                break;
            }
            if (!_locale.Equals("en"))
            {
                System.Windows.Forms.MessageBox.Show(message, title, System.Windows.Forms.MessageBoxButtons.OK);
            }
            OnDisplayBuffChanged();
            OnHideProfessionsChanged();
            SpecialEffect.UpdateCalculationMode();
            //ItemCache.OnItemsChanged();
            FormMain.Instance.Character.OnCalculationsInvalidated();
        }