Changed block item output order (Issue #41)
This commit is contained in:
parent
e7a40c8c6d
commit
884651bce9
|
@ -4,7 +4,7 @@ using System.Windows.Data;
|
||||||
|
|
||||||
namespace Filtration.Common.Converters
|
namespace Filtration.Common.Converters
|
||||||
{
|
{
|
||||||
internal class BoolInverterConverter : IValueConverter
|
public class BooleanInverterConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter,
|
public object Convert(object value, Type targetType, object parameter,
|
||||||
CultureInfo culture)
|
CultureInfo culture)
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<Setter Property="Margin" Value="0,0,5,5" />
|
<Setter Property="Margin" Value="0,0,5,5" />
|
||||||
</Style>
|
</Style>
|
||||||
<converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
|
<converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
|
||||||
<converters:BoolInverterConverter x:Key="BoolInverterConverter" />
|
<converters:BooleanInverterConverter x:Key="BoolInverterConverter" />
|
||||||
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
|
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
|
||||||
<converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
|
<converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
|
||||||
<converters:InverseBooleanVisibilityConverter x:Key="InverseBooleanVisibilityConverter" />
|
<converters:InverseBooleanVisibilityConverter x:Key="InverseBooleanVisibilityConverter" />
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
public sealed class ActionBlockItem : BlockItemBase
|
public sealed class ActionBlockItem : BlockItemBase
|
||||||
{
|
{
|
||||||
private BlockAction _action;
|
private BlockAction _action;
|
||||||
private bool _isDirty;
|
|
||||||
|
|
||||||
public ActionBlockItem(BlockAction action)
|
public ActionBlockItem(BlockAction action)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +23,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
OnPropertyChanged(nameof(SummaryText));
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
OnPropertyChanged(nameof(SummaryBackgroundColor));
|
OnPropertyChanged(nameof(SummaryBackgroundColor));
|
||||||
OnPropertyChanged(nameof(SummaryText));
|
OnPropertyChanged(nameof(SummaryTextColor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,17 +42,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
|
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
|
||||||
|
|
||||||
public override int SortOrder => 0;
|
public override int SortOrder => 0;
|
||||||
|
|
||||||
public override bool IsDirty
|
|
||||||
{
|
|
||||||
get { return _isDirty; }
|
|
||||||
protected set
|
|
||||||
{
|
|
||||||
_isDirty = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleAction()
|
public void ToggleAction()
|
||||||
{
|
{
|
||||||
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
|
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
|
||||||
|
|
|
@ -7,6 +7,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
{
|
{
|
||||||
public abstract class BlockItemBase : IItemFilterBlockItem
|
public abstract class BlockItemBase : IItemFilterBlockItem
|
||||||
{
|
{
|
||||||
|
private bool _isDirty;
|
||||||
|
|
||||||
public abstract string PrefixText { get; }
|
public abstract string PrefixText { get; }
|
||||||
public abstract string OutputText { get; }
|
public abstract string OutputText { get; }
|
||||||
public abstract int MaximumAllowed { get; }
|
public abstract int MaximumAllowed { get; }
|
||||||
|
@ -15,7 +17,16 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
public abstract Color SummaryBackgroundColor { get; }
|
public abstract Color SummaryBackgroundColor { get; }
|
||||||
public abstract Color SummaryTextColor { get; }
|
public abstract Color SummaryTextColor { get; }
|
||||||
public abstract int SortOrder { get; }
|
public abstract int SortOrder { get; }
|
||||||
public abstract bool IsDirty { get; protected set; }
|
|
||||||
|
public bool IsDirty
|
||||||
|
{
|
||||||
|
get { return _isDirty; }
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
_isDirty = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
|
{
|
||||||
|
public abstract class BooleanBlockItem : BlockItemBase
|
||||||
|
{
|
||||||
|
private bool _booleanValue;
|
||||||
|
|
||||||
|
protected BooleanBlockItem()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BooleanBlockItem(bool booleanValue)
|
||||||
|
{
|
||||||
|
BooleanValue = booleanValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool BooleanValue
|
||||||
|
{
|
||||||
|
get { return _booleanValue; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_booleanValue = value;
|
||||||
|
IsDirty = true;
|
||||||
|
OnPropertyChanged();
|
||||||
|
OnPropertyChanged(nameof(SummaryText));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string OutputText => PrefixText + " " + BooleanValue;
|
||||||
|
public override string SummaryText => PrefixText + " = " + BooleanValue;
|
||||||
|
public override int MaximumAllowed => 1;
|
||||||
|
|
||||||
|
public void ToggleValue()
|
||||||
|
{
|
||||||
|
BooleanValue = !BooleanValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,8 +24,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
|
|
||||||
public override string SummaryText => string.Empty;
|
public override string SummaryText => string.Empty;
|
||||||
|
|
||||||
public override bool IsDirty { get; protected set; }
|
|
||||||
|
|
||||||
public ThemeComponent ThemeComponent
|
public ThemeComponent ThemeComponent
|
||||||
{
|
{
|
||||||
get { return _themeComponent; }
|
get { return _themeComponent; }
|
||||||
|
|
|
@ -23,8 +23,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
public override Color SummaryBackgroundColor => Colors.Transparent;
|
public override Color SummaryBackgroundColor => Colors.Transparent;
|
||||||
public override Color SummaryTextColor => Colors.Transparent;
|
public override Color SummaryTextColor => Colors.Transparent;
|
||||||
|
|
||||||
public override bool IsDirty { get; protected set; }
|
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get { return _value; }
|
||||||
|
|
|
@ -24,8 +24,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
public abstract int Minimum { get; }
|
public abstract int Minimum { get; }
|
||||||
public abstract int Maximum { get; }
|
public abstract int Maximum { get; }
|
||||||
|
|
||||||
public override bool IsDirty { get; protected set; }
|
|
||||||
|
|
||||||
public int Value
|
public int Value
|
||||||
{
|
{
|
||||||
get { return _value; }
|
get { return _value; }
|
||||||
|
|
|
@ -25,9 +25,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
|
|
||||||
public abstract int Minimum { get; }
|
public abstract int Minimum { get; }
|
||||||
public abstract int Maximum { get; }
|
public abstract int Maximum { get; }
|
||||||
|
|
||||||
public override bool IsDirty { get; protected set; }
|
|
||||||
|
|
||||||
public NumericFilterPredicate FilterPredicate
|
public NumericFilterPredicate FilterPredicate
|
||||||
{
|
{
|
||||||
get { return _filterPredicate; }
|
get { return _filterPredicate; }
|
||||||
|
|
|
@ -30,8 +30,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
|
||||||
|
|
||||||
public ObservableCollection<string> Items { get; protected set; }
|
public ObservableCollection<string> Items { get; protected set; }
|
||||||
|
|
||||||
public override bool IsDirty { get; protected set; }
|
|
||||||
|
|
||||||
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
IsDirty = true;
|
IsDirty = true;
|
||||||
|
|
|
@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string PrefixText => "SetBackgroundColor";
|
public override string PrefixText => "SetBackgroundColor";
|
||||||
public override int MaximumAllowed => 1;
|
public override int MaximumAllowed => 1;
|
||||||
public override string DisplayHeading => "Background Color";
|
public override string DisplayHeading => "Background Color";
|
||||||
public override int SortOrder => 13;
|
public override int SortOrder => 15;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string PrefixText => "SetBorderColor";
|
public override string PrefixText => "SetBorderColor";
|
||||||
public override int MaximumAllowed => 1;
|
public override int MaximumAllowed => 1;
|
||||||
public override string DisplayHeading => "Border Color";
|
public override string DisplayHeading => "Border Color";
|
||||||
public override int SortOrder => 14;
|
public override int SortOrder => 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||||
|
|
||||||
|
namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
|
{
|
||||||
|
public sealed class CorruptedBlockItem : BooleanBlockItem
|
||||||
|
{
|
||||||
|
public CorruptedBlockItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public CorruptedBlockItem(bool booleanValue) : base(booleanValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string PrefixText => "Corrupted";
|
||||||
|
public override string DisplayHeading => "Corrupted";
|
||||||
|
public override Color SummaryBackgroundColor => Colors.DarkRed;
|
||||||
|
public override Color SummaryTextColor => Colors.White;
|
||||||
|
public override int SortOrder => 5;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Drop Level " + FilterPredicate;
|
public override string SummaryText => "Drop Level " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
|
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
|
||||||
public override Color SummaryTextColor => Colors.White;
|
public override Color SummaryTextColor => Colors.White;
|
||||||
public override int SortOrder => 2;
|
public override int SortOrder => 9;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 100;
|
public override int Maximum => 100;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string PrefixText => "SetFontSize";
|
public override string PrefixText => "SetFontSize";
|
||||||
public override int MaximumAllowed => 1;
|
public override int MaximumAllowed => 1;
|
||||||
public override string DisplayHeading => "Font Size";
|
public override string DisplayHeading => "Font Size";
|
||||||
public override int SortOrder => 15;
|
public override int SortOrder => 17;
|
||||||
public override int Minimum => 11;
|
public override int Minimum => 11;
|
||||||
public override int Maximum => 45;
|
public override int Maximum => 45;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Height " + FilterPredicate;
|
public override string SummaryText => "Height " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.LightBlue;
|
public override Color SummaryBackgroundColor => Colors.LightBlue;
|
||||||
public override Color SummaryTextColor => Colors.Black;
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
public override int SortOrder => 8;
|
public override int SortOrder => 7;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 6;
|
public override int Maximum => 6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||||
|
|
||||||
|
namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
|
{
|
||||||
|
public sealed class IdentifiedBlockItem : BooleanBlockItem
|
||||||
|
{
|
||||||
|
public IdentifiedBlockItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IdentifiedBlockItem(bool booleanValue) : base(booleanValue)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string PrefixText => "Identified";
|
||||||
|
public override string DisplayHeading => "Identified";
|
||||||
|
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||||
|
public override Color SummaryTextColor => Colors.White;
|
||||||
|
public override int SortOrder => 4;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Item Level " + FilterPredicate;
|
public override string SummaryText => "Item Level " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
|
||||||
public override Color SummaryTextColor => Colors.White;
|
public override Color SummaryTextColor => Colors.White;
|
||||||
public override int SortOrder => 1;
|
public override int SortOrder => 13;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 100;
|
public override int Maximum => 100;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Linked Sockets " + FilterPredicate;
|
public override string SummaryText => "Linked Sockets " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.Gold;
|
public override Color SummaryBackgroundColor => Colors.Gold;
|
||||||
public override Color SummaryTextColor => Colors.Black;
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
public override int SortOrder => 6;
|
public override int SortOrder => 0;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 6;
|
public override int Maximum => 6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
|
||||||
public override Color SummaryBackgroundColor => Colors.LightCoral;
|
public override Color SummaryBackgroundColor => Colors.LightCoral;
|
||||||
public override Color SummaryTextColor => Colors.White;
|
public override Color SummaryTextColor => Colors.White;
|
||||||
public override int SortOrder => 4;
|
public override int SortOrder => 12;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => (int)ItemRarity.Unique;
|
public override int Maximum => (int)ItemRarity.Unique;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
|
|
||||||
public override Color SummaryBackgroundColor => Colors.GhostWhite;
|
public override Color SummaryBackgroundColor => Colors.GhostWhite;
|
||||||
public override Color SummaryTextColor => Colors.Black;
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
public override int SortOrder => 9;
|
public override int SortOrder => 6;
|
||||||
|
|
||||||
private SocketColor StringToSocketColor(char socketColorString)
|
private SocketColor StringToSocketColor(char socketColorString)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Sockets " + FilterPredicate;
|
public override string SummaryText => "Sockets " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.LightGray;
|
public override Color SummaryBackgroundColor => Colors.LightGray;
|
||||||
public override Color SummaryTextColor => Colors.Black;
|
public override Color SummaryTextColor => Colors.Black;
|
||||||
public override int SortOrder => 5;
|
public override int SortOrder => 2;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 6;
|
public override int Maximum => 6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string PrefixText => "PlayAlertSound";
|
public override string PrefixText => "PlayAlertSound";
|
||||||
public override int MaximumAllowed => 1;
|
public override int MaximumAllowed => 1;
|
||||||
public override string DisplayHeading => "Play Alert Sound";
|
public override string DisplayHeading => "Play Alert Sound";
|
||||||
public override int SortOrder => 16;
|
public override int SortOrder => 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string PrefixText => "SetTextColor";
|
public override string PrefixText => "SetTextColor";
|
||||||
public override int MaximumAllowed => 1;
|
public override int MaximumAllowed => 1;
|
||||||
public override string DisplayHeading => "Text Color";
|
public override string DisplayHeading => "Text Color";
|
||||||
public override int SortOrder => 12;
|
public override int SortOrder => 14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
|
||||||
public override string SummaryText => "Width " + FilterPredicate;
|
public override string SummaryText => "Width " + FilterPredicate;
|
||||||
public override Color SummaryBackgroundColor => Colors.MediumPurple;
|
public override Color SummaryBackgroundColor => Colors.MediumPurple;
|
||||||
public override Color SummaryTextColor => Colors.White;
|
public override Color SummaryTextColor => Colors.White;
|
||||||
public override int SortOrder => 7;
|
public override int SortOrder => 8;
|
||||||
public override int Minimum => 0;
|
public override int Minimum => 0;
|
||||||
public override int Maximum => 2;
|
public override int Maximum => 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BlockItemBaseTypes\ActionBlockItem.cs" />
|
<Compile Include="BlockItemBaseTypes\ActionBlockItem.cs" />
|
||||||
<Compile Include="BlockItemBaseTypes\BlockItembase.cs" />
|
<Compile Include="BlockItemBaseTypes\BlockItemBase.cs" />
|
||||||
|
<Compile Include="BlockItemBaseTypes\BooleanBlockItem.cs" />
|
||||||
<Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" />
|
<Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" />
|
||||||
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
|
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
|
||||||
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
|
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
|
||||||
|
@ -53,9 +54,11 @@
|
||||||
<Compile Include="BlockItemTypes\BaseTypeBlockItem.cs" />
|
<Compile Include="BlockItemTypes\BaseTypeBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\BorderColorBlockItem.cs" />
|
<Compile Include="BlockItemTypes\BorderColorBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\ClassBlockItem.cs" />
|
<Compile Include="BlockItemTypes\ClassBlockItem.cs" />
|
||||||
|
<Compile Include="BlockItemTypes\CorruptedBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\DropLevelBlockItem.cs" />
|
<Compile Include="BlockItemTypes\DropLevelBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\FontSizeBlockItem.cs" />
|
<Compile Include="BlockItemTypes\FontSizeBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\HeightBlockItem.cs" />
|
<Compile Include="BlockItemTypes\HeightBlockItem.cs" />
|
||||||
|
<Compile Include="BlockItemTypes\IdentifiedBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\ItemLevelBlockItem.cs" />
|
<Compile Include="BlockItemTypes\ItemLevelBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\LinkedSocketsBlockItem.cs" />
|
<Compile Include="BlockItemTypes\LinkedSocketsBlockItem.cs" />
|
||||||
<Compile Include="BlockItemTypes\QualityBlockItem.cs" />
|
<Compile Include="BlockItemTypes\QualityBlockItem.cs" />
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
Hide # $flask, lvl
|
||||||
|
ItemLevel > 68
|
||||||
|
Quality < 15
|
||||||
|
Class "Life Flask" "Mana Flask" "Hybrid Flask"
|
||||||
|
BaseType "Flask"
|
||||||
|
SetFontSize 20
|
||||||
|
|
||||||
|
Show # $flask, lvl
|
||||||
|
ItemLevel >= 35
|
||||||
|
Class "Life Flask" "Mana Flask"
|
||||||
|
BaseType "Flask"
|
||||||
|
BaseType "Small" "Medium" "Large" "Greater" "Grand"
|
||||||
|
SetFontSize 20
|
|
@ -233,6 +233,40 @@ namespace Filtration.Parser.Tests.Services
|
||||||
Assert.AreEqual(FilterPredicateOperator.Equal, blockItem.FilterPredicate.PredicateOperator);
|
Assert.AreEqual(FilterPredicateOperator.Equal, blockItem.FilterPredicate.PredicateOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateStringToItemFilterBlock_Corrupted_ReturnsCorrectObject()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var inputString = "Show" + Environment.NewLine +
|
||||||
|
" Corrupted True";
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, null);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
|
||||||
|
Assert.AreEqual(1, result.BlockItems.Count(b => b is CorruptedBlockItem));
|
||||||
|
var blockItem = result.BlockItems.OfType<CorruptedBlockItem>().First();
|
||||||
|
Assert.IsTrue(blockItem.BooleanValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateStringToItemFilterBlock_Identified_ReturnsCorrectObject()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var inputString = "Show" + Environment.NewLine +
|
||||||
|
" Identified True";
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, null);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
|
||||||
|
Assert.AreEqual(1, result.BlockItems.Count(b => b is IdentifiedBlockItem));
|
||||||
|
var blockItem = result.BlockItems.OfType<IdentifiedBlockItem>().First();
|
||||||
|
Assert.IsTrue(blockItem.BooleanValue);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TranslateStringToItemFilterBlock_Quality_ReturnsCorrectObject()
|
public void TranslateStringToItemFilterBlock_Quality_ReturnsCorrectObject()
|
||||||
{
|
{
|
||||||
|
@ -624,6 +658,8 @@ namespace Filtration.Parser.Tests.Services
|
||||||
" DropLevel < 70" + Environment.NewLine +
|
" DropLevel < 70" + Environment.NewLine +
|
||||||
" Quality = 15" + Environment.NewLine +
|
" Quality = 15" + Environment.NewLine +
|
||||||
" Rarity <= Unique" + Environment.NewLine +
|
" Rarity <= Unique" + Environment.NewLine +
|
||||||
|
" Identified True" + Environment.NewLine +
|
||||||
|
" Corrupted false" + Environment.NewLine +
|
||||||
@" Class ""My Item Class"" AnotherClass ""AndAnotherClass""" + Environment.NewLine +
|
@" Class ""My Item Class"" AnotherClass ""AndAnotherClass""" + Environment.NewLine +
|
||||||
@" BaseType MyBaseType ""Another BaseType""" + Environment.NewLine +
|
@" BaseType MyBaseType ""Another BaseType""" + Environment.NewLine +
|
||||||
" JunkLine Let's ignore this one!" + Environment.NewLine +
|
" JunkLine Let's ignore this one!" + Environment.NewLine +
|
||||||
|
@ -646,6 +682,12 @@ namespace Filtration.Parser.Tests.Services
|
||||||
Assert.AreEqual(FilterPredicateOperator.GreaterThanOrEqual, itemLevelblockItem.FilterPredicate.PredicateOperator);
|
Assert.AreEqual(FilterPredicateOperator.GreaterThanOrEqual, itemLevelblockItem.FilterPredicate.PredicateOperator);
|
||||||
Assert.AreEqual(50, itemLevelblockItem.FilterPredicate.PredicateOperand);
|
Assert.AreEqual(50, itemLevelblockItem.FilterPredicate.PredicateOperand);
|
||||||
|
|
||||||
|
var corruptedBlockItem = result.BlockItems.OfType<CorruptedBlockItem>().First();
|
||||||
|
Assert.IsFalse(corruptedBlockItem.BooleanValue);
|
||||||
|
|
||||||
|
var identifiedBlockItem = result.BlockItems.OfType<IdentifiedBlockItem>().First();
|
||||||
|
Assert.IsTrue(identifiedBlockItem.BooleanValue);
|
||||||
|
|
||||||
var dropLevelblockItem = result.BlockItems.OfType<DropLevelBlockItem>().First();
|
var dropLevelblockItem = result.BlockItems.OfType<DropLevelBlockItem>().First();
|
||||||
Assert.AreEqual(FilterPredicateOperator.LessThan, dropLevelblockItem.FilterPredicate.PredicateOperator);
|
Assert.AreEqual(FilterPredicateOperator.LessThan, dropLevelblockItem.FilterPredicate.PredicateOperator);
|
||||||
Assert.AreEqual(70, dropLevelblockItem.FilterPredicate.PredicateOperand);
|
Assert.AreEqual(70, dropLevelblockItem.FilterPredicate.PredicateOperand);
|
||||||
|
@ -1027,6 +1069,70 @@ namespace Filtration.Parser.Tests.Services
|
||||||
Assert.AreEqual(expectedResult, result);
|
Assert.AreEqual(expectedResult, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateItemFilterBlockToString_IdentifiedTrue_ReturnsCorrectString()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var expectedResult = "Show" + Environment.NewLine +
|
||||||
|
" Identified True";
|
||||||
|
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new IdentifiedBlockItem(true));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateItemFilterBlockToString_IdentifiedFalse_ReturnsCorrectString()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var expectedResult = "Show" + Environment.NewLine +
|
||||||
|
" Identified False";
|
||||||
|
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new IdentifiedBlockItem(false));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateItemFilterBlockToString_CorruptedTrue_ReturnsCorrectString()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var expectedResult = "Show" + Environment.NewLine +
|
||||||
|
" Corrupted True";
|
||||||
|
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new CorruptedBlockItem(true));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TranslateItemFilterBlockToString_CorruptedFalse_ReturnsCorrectString()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var expectedResult = "Show" + Environment.NewLine +
|
||||||
|
" Corrupted False";
|
||||||
|
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new CorruptedBlockItem(false));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(expectedResult, result);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TranslateItemFilterBlockToString_DropLevel_ReturnsCorrectString()
|
public void TranslateItemFilterBlockToString_DropLevel_ReturnsCorrectString()
|
||||||
{
|
{
|
||||||
|
@ -1417,25 +1523,30 @@ namespace Filtration.Parser.Tests.Services
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var expectedResult = "Show" + Environment.NewLine +
|
var expectedResult = "Show" + Environment.NewLine +
|
||||||
" ItemLevel > 70" + Environment.NewLine +
|
|
||||||
" ItemLevel <= 85" + Environment.NewLine +
|
|
||||||
" DropLevel > 56" + Environment.NewLine +
|
|
||||||
" Quality > 2" + Environment.NewLine +
|
|
||||||
" Rarity = Unique" + Environment.NewLine +
|
|
||||||
" Sockets <= 6" + Environment.NewLine +
|
|
||||||
" LinkedSockets >= 4" + Environment.NewLine +
|
" LinkedSockets >= 4" + Environment.NewLine +
|
||||||
" Width = 3" + Environment.NewLine +
|
" Sockets <= 6" + Environment.NewLine +
|
||||||
|
" Quality > 2" + Environment.NewLine +
|
||||||
|
" Identified True" + Environment.NewLine +
|
||||||
|
" Corrupted False" + Environment.NewLine +
|
||||||
" Height <= 6" + Environment.NewLine +
|
" Height <= 6" + Environment.NewLine +
|
||||||
" Height >= 2" + Environment.NewLine +
|
" Height >= 2" + Environment.NewLine +
|
||||||
|
" Width = 3" + Environment.NewLine +
|
||||||
|
" DropLevel > 56" + Environment.NewLine +
|
||||||
" Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine +
|
" Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine +
|
||||||
" BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" +
|
" BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" + Environment.NewLine +
|
||||||
Environment.NewLine +
|
" Rarity = Unique" + Environment.NewLine +
|
||||||
|
" ItemLevel > 70" + Environment.NewLine +
|
||||||
|
" ItemLevel <= 85" + Environment.NewLine +
|
||||||
" SetTextColor 255 89 0 56" + Environment.NewLine +
|
" SetTextColor 255 89 0 56" + Environment.NewLine +
|
||||||
" SetBackgroundColor 0 0 0" + Environment.NewLine +
|
" SetBackgroundColor 0 0 0" + Environment.NewLine +
|
||||||
" SetBorderColor 255 1 254" + Environment.NewLine +
|
" SetBorderColor 255 1 254" + Environment.NewLine +
|
||||||
" SetFontSize 50" + Environment.NewLine +
|
" SetFontSize 50" + Environment.NewLine +
|
||||||
" PlayAlertSound 6 90";
|
" PlayAlertSound 6 90";
|
||||||
|
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new ActionBlockItem(BlockAction.Show));
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new IdentifiedBlockItem(true));
|
||||||
|
_testUtility.TestBlock.BlockItems.Add(new CorruptedBlockItem(false));
|
||||||
_testUtility.TestBlock.BlockItems.Add(new ActionBlockItem(BlockAction.Show));
|
_testUtility.TestBlock.BlockItems.Add(new ActionBlockItem(BlockAction.Show));
|
||||||
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 70));
|
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 70));
|
||||||
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.LessThanOrEqual, 85));
|
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.LessThanOrEqual, 85));
|
||||||
|
|
|
@ -129,6 +129,16 @@ namespace Filtration.Parser.Services
|
||||||
AddStringListItemToBlockItems<BaseTypeBlockItem>(block, trimmedLine);
|
AddStringListItemToBlockItems<BaseTypeBlockItem>(block, trimmedLine);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "Corrupted":
|
||||||
|
{
|
||||||
|
AddBooleanItemToBlockItems<CorruptedBlockItem>(block, trimmedLine);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "Identified":
|
||||||
|
{
|
||||||
|
AddBooleanItemToBlockItems<IdentifiedBlockItem>(block, trimmedLine);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "Sockets":
|
case "Sockets":
|
||||||
{
|
{
|
||||||
AddNumericFilterPredicateItemToBlockItems<SocketsBlockItem>(block, trimmedLine);
|
AddNumericFilterPredicateItemToBlockItems<SocketsBlockItem>(block, trimmedLine);
|
||||||
|
@ -240,6 +250,17 @@ namespace Filtration.Parser.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void AddBooleanItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : BooleanBlockItem
|
||||||
|
{
|
||||||
|
var blockItem = Activator.CreateInstance<T>();
|
||||||
|
var splitString = inputString.Split(' ');
|
||||||
|
if (splitString.Length == 2)
|
||||||
|
{
|
||||||
|
blockItem.BooleanValue = splitString[1].Trim().ToLowerInvariant() == "true";
|
||||||
|
block.BlockItems.Add(blockItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void AddNumericFilterPredicateItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NumericFilterPredicateBlockItem
|
private static void AddNumericFilterPredicateItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NumericFilterPredicateBlockItem
|
||||||
{
|
{
|
||||||
var blockItem = Activator.CreateInstance<T>();
|
var blockItem = Activator.CreateInstance<T>();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||||
|
xmlns:commonConverters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
|
||||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||||
xmlns:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
|
xmlns:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
|
||||||
xmlns:extensions="clr-namespace:Filtration.Extensions"
|
xmlns:extensions="clr-namespace:Filtration.Extensions"
|
||||||
|
@ -13,6 +14,9 @@
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}"
|
d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}"
|
||||||
d:DesignHeight="200" d:DesignWidth="160">
|
d:DesignHeight="200" d:DesignWidth="160">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<commonConverters:BooleanInverterConverter x:Key="BooleanInverterConverter"></commonConverters:BooleanInverterConverter>
|
||||||
|
</UserControl.Resources>
|
||||||
<Border Style="{StaticResource BlockItemBorder}" Width="150">
|
<Border Style="{StaticResource BlockItemBorder}" Width="150">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
@ -34,6 +38,14 @@
|
||||||
<RadioButton IsChecked="{Binding Action, Converter={StaticResource BooleanToBlockActionInverseConverter}}">Hide</RadioButton>
|
<RadioButton IsChecked="{Binding Action, Converter={StaticResource BooleanToBlockActionInverseConverter}}">Hide</RadioButton>
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
<!-- Boolean Template -->
|
||||||
|
<DataTemplate DataType="{x:Type blockItemBaseTypes:BooleanBlockItem}">
|
||||||
|
<WrapPanel VerticalAlignment="Center" Margin="5,5,5,5">
|
||||||
|
<RadioButton IsChecked="{Binding BooleanValue}" Margin="0,0,10,0">True</RadioButton>
|
||||||
|
<RadioButton IsChecked="{Binding BooleanValue, Converter={StaticResource BoolInverterConverter}}">False</RadioButton>
|
||||||
|
</WrapPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
<!-- NumericFilterPredicate Template -->
|
<!-- NumericFilterPredicate Template -->
|
||||||
<DataTemplate DataType="{x:Type blockItemBaseTypes:NumericFilterPredicateBlockItem}">
|
<DataTemplate DataType="{x:Type blockItemBaseTypes:NumericFilterPredicateBlockItem}">
|
||||||
|
|
|
@ -187,7 +187,9 @@ namespace Filtration.ViewModels
|
||||||
typeof (HeightBlockItem),
|
typeof (HeightBlockItem),
|
||||||
typeof (SocketGroupBlockItem),
|
typeof (SocketGroupBlockItem),
|
||||||
typeof (ClassBlockItem),
|
typeof (ClassBlockItem),
|
||||||
typeof (BaseTypeBlockItem)
|
typeof (BaseTypeBlockItem),
|
||||||
|
typeof (IdentifiedBlockItem),
|
||||||
|
typeof (CorruptedBlockItem)
|
||||||
};
|
};
|
||||||
|
|
||||||
public List<Type> AudioVisualBlockItemTypesAvailable => new List<Type>
|
public List<Type> AudioVisualBlockItemTypesAvailable => new List<Type>
|
||||||
|
|
Loading…
Reference in New Issue