private void AutoDetectStatsPresetChanged(object sender, RoutedEventArgs e) { Logger.Log("SETTING CHANGED"); AutoEquipSettings.CurrentSettings.SpecSelectedByUser = (ClassSpec)Enum.Parse(typeof(ClassSpec), StatsPreset.SelectedIndex.ToString()); SettingsPresets.ChangeStatsWeightSettings(AutoEquipSettings.CurrentSettings.SpecSelectedByUser); UpdateStats(); AutoEquipSettings.CurrentSettings.Save(); }
private void AutoDetectStatWeightsChanged(object sender, RoutedEventArgs e) { AutoEquipSettings.CurrentSettings.AutoDetectStatWeights = (bool)AutoDetectStatWeights.IsChecked; GroupStats.IsEnabled = !(bool)AutoDetectStatWeights.IsChecked; Main.AutoDetectMyClassSpec(); SettingsPresets.ChangeStatsWeightSettings(AutoEquipSettings.CurrentSettings.SpecSelectedByUser); UpdateStats(); AutoEquipSettings.CurrentSettings.Save(); }
public static void AutoDetectMyClassSpec() { ClassSpec currentSpec = WAECharacterSheet.ClassSpec; switch (ObjectManager.Me.WowClass) { case (WoWClass.Warlock): if (WTTalent.GetSpec() == 2) { WAECharacterSheet.ClassSpec = ClassSpec.WarlockDemonology; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.WarlockDestruction; } else { WAECharacterSheet.ClassSpec = ClassSpec.WarlockAffliction; } break; case (WoWClass.DeathKnight): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.DeathKnightBloodDPS; } else if (WTTalent.GetSpec() == 2) { WAECharacterSheet.ClassSpec = ClassSpec.DeathKnightFrostDPS; } else { WAECharacterSheet.ClassSpec = ClassSpec.DeathKnightUnholy; } break; case (WoWClass.Druid): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.DruidBalance; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.DruidRestoration; } else { // TBC FERAL if (ToolBox.GetWoWVersion() == ToolBox.WoWVersion.TBC) { if (WTTalent.GetTalentRank(2, 7) > 0) // Feral Charge { WAECharacterSheet.ClassSpec = ClassSpec.DruidFeralTank; } else { WAECharacterSheet.ClassSpec = ClassSpec.DruidFeralDPS; } } // WOTLK FERAL if (ToolBox.GetWoWVersion() == ToolBox.WoWVersion.WOTLK) { if (WTTalent.GetTalentRank(2, 5) > 2 || // Thick Hide WTTalent.GetTalentRank(2, 16) > 0 || // Natural Reaction WTTalent.GetTalentRank(2, 22) > 0) // Protector of the Pack { WAECharacterSheet.ClassSpec = ClassSpec.DruidFeralTank; } else { WAECharacterSheet.ClassSpec = ClassSpec.DruidFeralDPS; } } } break; case (WoWClass.Hunter): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.HunterBeastMastery; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.HunterSurvival; } else { WAECharacterSheet.ClassSpec = ClassSpec.HunterMarksman; } break; case (WoWClass.Mage): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.MageArcane; } else if (WTTalent.GetSpec() == 2) { WAECharacterSheet.ClassSpec = ClassSpec.MageFire; } else { WAECharacterSheet.ClassSpec = ClassSpec.MageFrost; } break; case (WoWClass.Paladin): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.PaladinHoly; } else if (WTTalent.GetSpec() == 2) { WAECharacterSheet.ClassSpec = ClassSpec.PaladinProtection; } else { WAECharacterSheet.ClassSpec = ClassSpec.PaladinRetribution; } break; case (WoWClass.Priest): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.PriestDiscipline; } else if (WTTalent.GetSpec() == 2) { WAECharacterSheet.ClassSpec = ClassSpec.PriestHoly; } else { WAECharacterSheet.ClassSpec = ClassSpec.PriestShadow; } break; case (WoWClass.Rogue): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.RogueAssassination; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.RogueSubtelty; } else { WAECharacterSheet.ClassSpec = ClassSpec.RogueCombat; } break; case (WoWClass.Shaman): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.ShamanElemental; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.ShamanRestoration; } else { WAECharacterSheet.ClassSpec = ClassSpec.ShamanEnhancement; } break; case (WoWClass.Warrior): if (WTTalent.GetSpec() == 1) { WAECharacterSheet.ClassSpec = ClassSpec.WarriorArms; } else if (WTTalent.GetSpec() == 3) { WAECharacterSheet.ClassSpec = ClassSpec.WarriorTank; } else { WAECharacterSheet.ClassSpec = ClassSpec.WarriorFury; } break; default: WAECharacterSheet.ClassSpec = ClassSpec.None; break; } // Update stat weights in case of auto detect if (AutoEquipSettings.CurrentSettings.AutoDetectStatWeights && currentSpec != WAECharacterSheet.ClassSpec) { WAEItemDB.ItemDb.Clear(); // to Rescan all items SettingsPresets.ChangeStatsWeightSettings(WAECharacterSheet.ClassSpec); } // Set other default plugin settings according to detected class for first launch if (AutoEquipSettings.CurrentSettings.FirstLaunch && currentSpec != WAECharacterSheet.ClassSpec) { Logger.Log("First Launch"); SettingsPresets.ChangeAutoEquipSetting(WAECharacterSheet.ClassSpec); AutoEquipSettings.CurrentSettings.FirstLaunch = false; AutoEquipSettings.CurrentSettings.Save(); } AutoEquipSettings.CurrentSettings.SpecSelectedByUser = WAECharacterSheet.ClassSpec; }