From 5b74e456575cb6c23845ffb4a75b99db5c404303 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 4 Aug 2017 11:41:54 -0500 Subject: [PATCH] Minor changes Stats now disable when there is nothing to select instead of disappearing. Currency changed to standard from legacy league. --- .../PoeCrafting.Domain/CurrencyFactory.cs | 2 +- PoeCrafting/PoeCrafting.Test/App.config | 2 +- .../Subcontrols/SubconditionAffixControl.xaml | 16 +++++++------- .../SubconditionAffixControl.xaml.cs | 22 +++++++++---------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/PoeCrafting/PoeCrafting.Domain/CurrencyFactory.cs b/PoeCrafting/PoeCrafting.Domain/CurrencyFactory.cs index ac42bc7..84b70e7 100644 --- a/PoeCrafting/PoeCrafting.Domain/CurrencyFactory.cs +++ b/PoeCrafting/PoeCrafting.Domain/CurrencyFactory.cs @@ -48,7 +48,7 @@ public class CurrencyFactory vaal }; - currencyValueFetch.League = "Legacy"; + currencyValueFetch.League = "Standard"; var data = currencyValueFetch.Execute(); foreach (var currency in Currency) { diff --git a/PoeCrafting/PoeCrafting.Test/App.config b/PoeCrafting/PoeCrafting.Test/App.config index 3e2f0a6..089be70 100644 --- a/PoeCrafting/PoeCrafting.Test/App.config +++ b/PoeCrafting/PoeCrafting.Test/App.config @@ -4,6 +4,6 @@ - + \ No newline at end of file diff --git a/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml b/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml index 0e6fccd..6b78cc2 100644 --- a/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml +++ b/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml @@ -18,11 +18,11 @@ - - + + - - + + @@ -37,12 +37,12 @@ diff --git a/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml.cs b/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml.cs index bdb77b0..0d41e46 100644 --- a/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml.cs +++ b/PoeCrafting/PoeCrafting/Controls/Subcontrols/SubconditionAffixControl.xaml.cs @@ -1,21 +1,11 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; using PoeCrafting.Domain.Condition; using PoeCrafting.Entities; using PoeCrafting.UI.Annotations; @@ -55,8 +45,8 @@ public partial class SubconditionAffixControl : UserControl, INotifyPropertyChan // There are no relevant third stats. All of them have their min/max values as equal - public bool HasFirstStat => !string.IsNullOrEmpty(AffixName) && !string.IsNullOrEmpty(FirstStatName) && _statOneMin != _statOneMax; - public bool HasSecondStat => !string.IsNullOrEmpty(AffixName) && !IsTier && !string.IsNullOrEmpty(SecondStatName) && _statTwoMin != _statTwoMax; + public bool HasFirstStat => !string.IsNullOrEmpty(AffixName) && !string.IsNullOrEmpty(FirstStatName) && !(_statOneMin == _statOneMax && _statOneMin == 0); + public bool HasSecondStat => !string.IsNullOrEmpty(AffixName) && !IsTier && !string.IsNullOrEmpty(SecondStatName) && !(_statTwoMin == _statTwoMax && _statTwoMin == 0); public bool HasOneStat => (HasFirstStat && !HasSecondStat) || (!HasFirstStat && HasSecondStat); private bool IsMetaAffix => !string.IsNullOrEmpty(AffixName) && _affixType == AffixType.Meta; @@ -66,6 +56,9 @@ public partial class SubconditionAffixControl : UserControl, INotifyPropertyChan public Visibility FirstStatSelectionVisibility => BoolToVisibility(IsMetaAffix || (HasOneStat && HasFirstStat)); public Visibility SecondStatSelectionVisibility => BoolToVisibility(!IsMetaAffix && (HasOneStat && HasSecondStat)); + public bool IsFirstStatEnabled => HasFirstStat && _statOneMin != _statOneMax; + public bool IsSecondStatEnabled => HasSecondStat && _statTwoMin != _statTwoMax; + public List ValidAffixes => GetValidAffixes(); public StatValueType StatValueType { @@ -165,6 +158,8 @@ private void ClearStats() OnPropertyChanged(nameof(SecondStatMax)); OnPropertyChanged(nameof(ThirdStatMin)); OnPropertyChanged(nameof(ThirdStatMax)); + OnPropertyChanged(nameof(IsFirstStatEnabled)); + OnPropertyChanged(nameof(IsSecondStatEnabled)); } public SubconditionAffixControl(ConditionAffix condition, List affixes, StatValueType statValueType, AffixType affixType, ItemBase itemBase) @@ -303,6 +298,9 @@ private void UpdateModMinMax() OnPropertyChanged(nameof(FirstStatSelectionVisibility)); OnPropertyChanged(nameof(SecondStatSelectionVisibility)); OnPropertyChanged(nameof(DoubleStatSelectionVisibility)); + + OnPropertyChanged(nameof(IsFirstStatEnabled)); + OnPropertyChanged(nameof(IsSecondStatEnabled)); } public List GetValidAffixes()