private void UpdateBase() { if (SelectedBase == null) { return; } using (Monitor.Enter()) { var ibase = SelectedBase; Item = new Item(ibase); MsImplicits.ForEach(ms => ms.PropertyChanged -= MsOnPropertyChanged); var modSelectors = new List <ModSelectorViewModel>(); foreach (var implicitMod in ibase.ImplicitMods) { var modSelector = new ModSelectorViewModel(EquipmentData.StatTranslator, false) { Affixes = new[] { new Affix(implicitMod) } }; modSelector.PropertyChanged += MsOnPropertyChanged; modSelectors.Add(modSelector); } MsImplicits = modSelectors; ShowQualitySlider = ibase.CanHaveQuality; UpdateBaseSpecific(); } }
protected void RecalculateItem() { if (Monitor.IsBusy) { return; } Item.NameLine = ""; Item.TypeLine = Item.BaseType.Name; Item.FlavourText = "Created with PoESkillTree"; var allmods = RecalculateItemSpecific().ToList(); Item.ExplicitMods = allmods.Where(m => m.ParentTier == null || !m.ParentTier.IsMasterCrafted).ToList(); Item.CraftedMods = allmods.Where(m => m.ParentTier != null && m.ParentTier.IsMasterCrafted).ToList(); Item.ImplicitMods = MsImplicits.GetExactMods().ToList(); var quality = SelectedBase.CanHaveQuality ? (int)MsQuality.SelectedValues.First().First() : 0; Item.Properties = new ObservableCollection <ItemMod>(Item.BaseType.GetRawProperties(quality)); ApplyLocals(); if (Item.IsWeapon) { ApplyElementalMods(allmods); } Item.UpdateRequirements(); }
protected void RecalculateItem() { if (Monitor.IsBusy) { return; } Item.NameLine = ""; Item.TypeLine = Item.BaseType.Name; var(explicitStats, craftedStats) = RecalculateItemSpecific(out var requiredLevel); Item.ExplicitMods = CreateItemMods(explicitStats).ToList(); Item.CraftedMods = CreateItemMods(craftedStats).ToList(); Item.ImplicitMods = CreateItemMods(MsImplicits.SelectMany(ms => ms.GetStatValues())).ToList(); var quality = SelectedBase.CanHaveQuality ? _qualitySlider.Value : 0; Item.Properties = new ObservableCollection <ItemMod>(Item.BaseType.GetRawProperties(quality)); ApplyLocals(); if (Item.IsWeapon) { ApplyElementalMods(Item.Mods); } if (MsImplicits.Any()) { var implicits = MsImplicits.Select(ms => ms.Query()); requiredLevel = Math.Max(requiredLevel, implicits.Max(m => m.RequiredLevel)); } Item.UpdateRequirements((80 * requiredLevel) / 100); }
protected void RecalculateItem() { if (Monitor.IsBusy) { return; } Item.NameLine = ""; Item.TypeLine = Item.BaseType.Name; Item.FlavourText = "Created with PoESkillTree"; int requiredLevel; var statLookup = RecalculateItemSpecific(out requiredLevel).ToList(); Item.ExplicitMods = CreateItemMods(ModLocation.Explicit, statLookup.SingleOrDefault(g => g.Key == ModLocation.Explicit)).ToList(); Item.CraftedMods = CreateItemMods(ModLocation.Crafted, statLookup.SingleOrDefault(g => g.Key == ModLocation.Crafted)).ToList(); Item.ImplicitMods = CreateItemMods(ModLocation.Implicit, MsImplicits.SelectMany(ms => ms.GetStatValues())).ToList(); var quality = SelectedBase.CanHaveQuality ? _qualitySlider.Value : 0; Item.Properties = new ObservableCollection <ItemMod>(Item.BaseType.GetRawProperties(quality)); ApplyLocals(); if (Item.IsWeapon) { ApplyElementalMods(Item.Mods); } if (MsImplicits.Any()) { var implicits = MsImplicits.Select(ms => ms.Query()); requiredLevel = Math.Max(requiredLevel, implicits.Max(m => m.RequiredLevel)); } Item.UpdateRequirements((80 * requiredLevel) / 100); }