11 Commits
0.13 ... 0.15

Author SHA1 Message Date
Ben Wallis
8dc5864d2e Bumped version to 0.15 2016-12-03 12:14:23 +00:00
Ben Wallis
884651bce9 Added support for Identified (Issue #34) and Corrupted (Issue #42) block items
Changed block item output order (Issue #41)
2016-12-03 11:58:18 +00:00
Ben Wallis
e7a40c8c6d Updated FluentAssertions nuget package 2016-09-01 21:27:39 +01:00
Ben Wallis
dde9f65ea6 Bumped version number to 0.14, added icon to Update Available window 2016-09-01 21:19:22 +01:00
Ben Wallis
ae6e8c5211 Fixed #31 - Added context menu to sections 2016-09-01 21:11:15 +01:00
Ben Wallis
67685d9eac Fixed #30 - Updating a section title does not update the Section Browser 2016-09-01 21:02:38 +01:00
Ben Wallis
af08cdfed6 Fixed #32 - PlayAlertSound ignored on Paste Block Style 2016-09-01 20:56:58 +01:00
Ben Wallis
0b791f5747 Fixed #33 - Update check window buttons erroneously shut down application 2016-09-01 20:26:55 +01:00
Ben Wallis
43bc1410ae Merge branch 'master' of https://github.com/ben-wallis/Filtration.git 2016-08-31 00:10:40 +01:00
Ben Wallis
b3520246b9 Fixed bug causing removing a block item to not refresh the item preview 2016-08-31 00:10:36 +01:00
Ben Wallis
6d1c51361b Bumped to 0.13 2016-08-30 22:57:49 +01:00
50 changed files with 425 additions and 148 deletions

View File

@@ -4,7 +4,7 @@ using System.Windows.Data;
namespace Filtration.Common.Converters
{
internal class BoolInverterConverter : IValueConverter
public class BooleanInverterConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)

View File

@@ -38,7 +38,7 @@
<Setter Property="Margin" Value="0,0,5,5" />
</Style>
<converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
<converters:BoolInverterConverter x:Key="BoolInverterConverter" />
<converters:BooleanInverterConverter x:Key="BoolInverterConverter" />
<converters:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
<converters:InverseBooleanVisibilityConverter x:Key="InverseBooleanVisibilityConverter" />

View File

@@ -46,12 +46,12 @@
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">

View File

@@ -12,6 +12,7 @@ namespace Filtration.ItemFilterPreview.Tests.Services
{
class serializationtest
{
[Ignore("")]
[Test]
public void test_serialization()
{

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
<package id="Moq" version="4.5.21" targetFramework="net461" />
<package id="NUnit" version="3.4.1" targetFramework="net461" />
<package id="YamlDotNet" version="3.9.0" targetFramework="net461" />

View File

@@ -7,7 +7,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public sealed class ActionBlockItem : BlockItemBase
{
private BlockAction _action;
private bool _isDirty;
public ActionBlockItem(BlockAction action)
{
@@ -24,7 +23,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
OnPropertyChanged();
OnPropertyChanged(nameof(SummaryText));
OnPropertyChanged(nameof(SummaryBackgroundColor));
OnPropertyChanged(nameof(SummaryText));
OnPropertyChanged(nameof(SummaryTextColor));
}
}
@@ -44,16 +43,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public override int SortOrder => 0;
public override bool IsDirty
{
get { return _isDirty; }
protected set
{
_isDirty = value;
OnPropertyChanged();
}
}
public void ToggleAction()
{
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;

View File

@@ -7,6 +7,8 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class BlockItemBase : IItemFilterBlockItem
{
private bool _isDirty;
public abstract string PrefixText { get; }
public abstract string OutputText { get; }
public abstract int MaximumAllowed { get; }
@@ -15,7 +17,16 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public abstract Color SummaryBackgroundColor { get; }
public abstract Color SummaryTextColor { 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;

View File

@@ -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;
}
}
}

View File

@@ -24,8 +24,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public override string SummaryText => string.Empty;
public override bool IsDirty { get; protected set; }
public ThemeComponent ThemeComponent
{
get { return _themeComponent; }

View File

@@ -23,8 +23,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public override bool IsDirty { get; protected set; }
public int Value
{
get { return _value; }

View File

@@ -24,8 +24,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public abstract int Minimum { get; }
public abstract int Maximum { get; }
public override bool IsDirty { get; protected set; }
public int Value
{
get { return _value; }

View File

@@ -26,8 +26,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public abstract int Minimum { get; }
public abstract int Maximum { get; }
public override bool IsDirty { get; protected set; }
public NumericFilterPredicate FilterPredicate
{
get { return _filterPredicate; }

View File

@@ -30,8 +30,6 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public ObservableCollection<string> Items { get; protected set; }
public override bool IsDirty { get; protected set; }
private void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
IsDirty = true;

View File

@@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "SetBackgroundColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Background Color";
public override int SortOrder => 13;
public override int SortOrder => 15;
}
}

View File

@@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "SetBorderColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Border Color";
public override int SortOrder => 14;
public override int SortOrder => 16;
}
}

View File

@@ -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;
}
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Drop Level " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DodgerBlue;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 2;
public override int SortOrder => 9;
public override int Minimum => 0;
public override int Maximum => 100;
}

View File

@@ -16,7 +16,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "SetFontSize";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Font Size";
public override int SortOrder => 15;
public override int SortOrder => 17;
public override int Minimum => 11;
public override int Maximum => 45;
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Height " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.LightBlue;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 8;
public override int SortOrder => 7;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -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;
}
}

View File

@@ -20,7 +20,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Item Level " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 1;
public override int SortOrder => 13;
public override int Minimum => 0;
public override int Maximum => 100;
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Linked Sockets " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.Gold;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 6;
public override int SortOrder => 0;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -30,7 +30,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
((ItemRarity) FilterPredicate.PredicateOperand).GetAttributeDescription();
public override Color SummaryBackgroundColor => Colors.LightCoral;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 4;
public override int SortOrder => 12;
public override int Minimum => 0;
public override int Maximum => (int)ItemRarity.Unique;
}

View File

@@ -39,7 +39,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override Color SummaryBackgroundColor => Colors.GhostWhite;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 9;
public override int SortOrder => 6;
private SocketColor StringToSocketColor(char socketColorString)
{

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Sockets " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.LightGray;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 5;
public override int SortOrder => 2;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -17,6 +17,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "PlayAlertSound";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Play Alert Sound";
public override int SortOrder => 16;
public override int SortOrder => 18;
}
}

View File

@@ -16,6 +16,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "SetTextColor";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Text Color";
public override int SortOrder => 12;
public override int SortOrder => 14;
}
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Width " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.MediumPurple;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 7;
public override int SortOrder => 8;
public override int Minimum => 0;
public override int Maximum => 2;
}

View File

@@ -43,7 +43,8 @@
</ItemGroup>
<ItemGroup>
<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\DualIntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
@@ -53,9 +54,11 @@
<Compile Include="BlockItemTypes\BaseTypeBlockItem.cs" />
<Compile Include="BlockItemTypes\BorderColorBlockItem.cs" />
<Compile Include="BlockItemTypes\ClassBlockItem.cs" />
<Compile Include="BlockItemTypes\CorruptedBlockItem.cs" />
<Compile Include="BlockItemTypes\DropLevelBlockItem.cs" />
<Compile Include="BlockItemTypes\FontSizeBlockItem.cs" />
<Compile Include="BlockItemTypes\HeightBlockItem.cs" />
<Compile Include="BlockItemTypes\IdentifiedBlockItem.cs" />
<Compile Include="BlockItemTypes\ItemLevelBlockItem.cs" />
<Compile Include="BlockItemTypes\LinkedSocketsBlockItem.cs" />
<Compile Include="BlockItemTypes\QualityBlockItem.cs" />

View File

@@ -9,6 +9,6 @@ namespace Filtration.Parser.Interface.Services
IItemFilterBlock TranslateStringToItemFilterBlock(string inputString,
ThemeComponentCollection masterComponentCollection);
string TranslateItemFilterBlockToString(IItemFilterBlock block);
void ReplaceColorBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString);
void ReplaceAudioVisualBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString);
}
}

View File

@@ -40,12 +40,12 @@
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">

View File

@@ -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

View File

@@ -233,6 +233,40 @@ namespace Filtration.Parser.Tests.Services
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]
public void TranslateStringToItemFilterBlock_Quality_ReturnsCorrectObject()
{
@@ -624,6 +658,8 @@ namespace Filtration.Parser.Tests.Services
" DropLevel < 70" + Environment.NewLine +
" Quality = 15" + Environment.NewLine +
" Rarity <= Unique" + Environment.NewLine +
" Identified True" + Environment.NewLine +
" Corrupted false" + Environment.NewLine +
@" Class ""My Item Class"" AnotherClass ""AndAnotherClass""" + Environment.NewLine +
@" BaseType MyBaseType ""Another BaseType""" + 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(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();
Assert.AreEqual(FilterPredicateOperator.LessThan, dropLevelblockItem.FilterPredicate.PredicateOperator);
Assert.AreEqual(70, dropLevelblockItem.FilterPredicate.PredicateOperand);
@@ -1027,6 +1069,70 @@ namespace Filtration.Parser.Tests.Services
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]
public void TranslateItemFilterBlockToString_DropLevel_ReturnsCorrectString()
{
@@ -1417,25 +1523,30 @@ namespace Filtration.Parser.Tests.Services
{
// Arrange
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 +
" 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 >= 2" + Environment.NewLine +
" Width = 3" + Environment.NewLine +
" DropLevel > 56" + Environment.NewLine +
" Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine +
" BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" +
Environment.NewLine +
" BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" + Environment.NewLine +
" Rarity = Unique" + Environment.NewLine +
" ItemLevel > 70" + Environment.NewLine +
" ItemLevel <= 85" + Environment.NewLine +
" SetTextColor 255 89 0 56" + Environment.NewLine +
" SetBackgroundColor 0 0 0" + Environment.NewLine +
" SetBorderColor 255 1 254" + Environment.NewLine +
" SetFontSize 50" + Environment.NewLine +
" 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 ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 70));
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.LessThanOrEqual, 85));
@@ -1472,7 +1583,7 @@ namespace Filtration.Parser.Tests.Services
}
[Test]
public void ReplaceColorBlockItemsFromString_SingleLine_ReplacesColorBlock()
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesColorBlock()
{
// Arrange
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
@@ -1482,7 +1593,7 @@ namespace Filtration.Parser.Tests.Services
testInputBlockItems.Add(testInputBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
@@ -1492,7 +1603,28 @@ namespace Filtration.Parser.Tests.Services
}
[Test]
public void ReplaceColorBlockItemsFromString_SingleLine_ReplacesColorBlockBugTest()
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesSoundBlockItem()
{
// Arrange
var testInputString = "PlayAlertSound 7 280";
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
var testInputBlockItem = new SoundBlockItem(12,30);
testInputBlockItems.Add(testInputBlockItem);
// Act
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
Assert.IsNotNull(soundBlockItem);
Assert.AreNotSame(testInputBlockItem, soundBlockItem);
Assert.AreEqual(7, soundBlockItem.Value);
Assert.AreEqual(280, soundBlockItem.SecondValue);
}
[Test]
public void ReplaceAudioVisualBlockItemsFromString_SingleLine_ReplacesColorBlockBugTest()
{
// Arrange
var testInputString = "SetBackgroundColor 70 0 0 255";
@@ -1502,7 +1634,7 @@ namespace Filtration.Parser.Tests.Services
testInputBlockItems.Add(testInputBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var backgroundColorBlockItem = testInputBlockItems.First(b => b is BackgroundColorBlockItem) as BackgroundColorBlockItem;
@@ -1513,7 +1645,7 @@ namespace Filtration.Parser.Tests.Services
[Ignore("Not currently possible - will not be necessary once commanding (to enable undo history) is implemented anyway")]
[Test]
public void ReplaceColorBlockItemsFromString_MalformedLine_DoesNothing()
public void ReplaceAudioVisualBlockItemsFromString_MalformedLine_DoesNothing()
{
// Arrange
var testInputString = "SetTextCsaolor 240 200 150 # Rarest Currency";
@@ -1523,7 +1655,7 @@ namespace Filtration.Parser.Tests.Services
testInputBlockItems.Add(testInputBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
@@ -1532,23 +1664,27 @@ namespace Filtration.Parser.Tests.Services
}
[Test]
public void ReplaceColorBlockItemsFromString_MultipleLines_ExistingBlockItems()
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_ExistingBlockItems()
{
// Arrange
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
"SetBorderColor 255 255 255 # Rarest Currency Border";
"SetBorderColor 255 255 255 # Rarest Currency Border" + Environment.NewLine +
"PlayAlertSound 7 280";
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
var testInputTextColorBlockItem = new TextColorBlockItem(Colors.Red);
var testInputBackgroundColorBlockItem = new BackgroundColorBlockItem(Colors.Blue);
var testInpuBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow);
var testInputBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow);
var testInputSoundBlockItem = new SoundBlockItem(1, 1);
testInputBlockItems.Add(testInputTextColorBlockItem);
testInputBlockItems.Add(testInputBackgroundColorBlockItem);
testInputBlockItems.Add(testInpuBorderColorBlockItem);
testInputBlockItems.Add(testInputBorderColorBlockItem);
testInputBlockItems.Add(testInputSoundBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
@@ -1563,23 +1699,29 @@ namespace Filtration.Parser.Tests.Services
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
Assert.IsNotNull(borderColorBlockItem);
Assert.AreNotSame(testInpuBorderColorBlockItem, borderColorBlockItem);
Assert.AreNotSame(testInputBorderColorBlockItem, borderColorBlockItem);
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
Assert.IsNotNull(soundBlockItem);
Assert.AreNotSame(testInputSoundBlockItem, soundBlockItem);
Assert.AreEqual(7, soundBlockItem.Value);
Assert.AreEqual(280, soundBlockItem.SecondValue);
}
[Test]
public void ReplaceColorBlockItemsFromString_MultipleLines_NoExistingBlockItems()
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_NoExistingBlockItems()
{
// Arrange
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
"SetBackgroundColor 0 0 0 # Rarest Currency Background" + Environment.NewLine +
"SetBorderColor 255 255 255 # Rarest Currency Border";
"SetBorderColor 255 255 255 # Rarest Currency Border" + Environment.NewLine +
"PlayAlertSound 7 280";
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
@@ -1593,10 +1735,15 @@ namespace Filtration.Parser.Tests.Services
var borderColorBlockItem = testInputBlockItems.First(b => b is BorderColorBlockItem) as BorderColorBlockItem;
Assert.IsNotNull(borderColorBlockItem);
Assert.AreEqual(new Color { A = 255, R = 255, G = 255, B = 255 }, borderColorBlockItem.Color);
var soundBlockItem = testInputBlockItems.First(b => b is SoundBlockItem) as SoundBlockItem;
Assert.IsNotNull(soundBlockItem);
Assert.AreEqual(7, soundBlockItem.Value);
Assert.AreEqual(280, soundBlockItem.SecondValue);
}
[Test]
public void ReplaceColorBlockItemsFromString_MultipleLines_SomeExistingBlockItems()
public void ReplaceAudioVisualBlockItemsFromString_MultipleLines_SomeExistingBlockItems()
{
// Arrange
var testInputString = "SetTextColor 240 200 150 # Rarest Currency" + Environment.NewLine +
@@ -1611,7 +1758,7 @@ namespace Filtration.Parser.Tests.Services
testInputBlockItems.Add(testInpuBorderColorBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert
var textColorBlockItem = testInputBlockItems.First(b => b is TextColorBlockItem) as TextColorBlockItem;
@@ -1627,7 +1774,7 @@ namespace Filtration.Parser.Tests.Services
[Ignore("ThemeComponentBuilder deprecated")]
[Test]
public void ReplaceColorBlockItemsFromString_ThemeComponentBuilderNotInitialised_DoesNotCallAddComponent()
public void ReplaceAudioVisualBlockItemsFromString_ThemeComponentBuilderNotInitialised_DoesNotCallAddComponent()
{
// Arrange
var testInputString = "SetTextColor 240 200 150 # Rarest Currency";
@@ -1637,7 +1784,7 @@ namespace Filtration.Parser.Tests.Services
testInputBlockItems.Add(testInputBlockItem);
// Act
_testUtility.Translator.ReplaceColorBlockItemsFromString(testInputBlockItems, testInputString);
_testUtility.Translator.ReplaceAudioVisualBlockItemsFromString(testInputBlockItems, testInputString);
// Assert

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
<package id="Moq" version="4.5.21" targetFramework="net461" />
<package id="NUnit" version="3.4.1" targetFramework="net461" />
</packages>

View File

@@ -129,6 +129,16 @@ namespace Filtration.Parser.Services
AddStringListItemToBlockItems<BaseTypeBlockItem>(block, trimmedLine);
break;
}
case "Corrupted":
{
AddBooleanItemToBlockItems<CorruptedBlockItem>(block, trimmedLine);
break;
}
case "Identified":
{
AddBooleanItemToBlockItems<IdentifiedBlockItem>(block, trimmedLine);
break;
}
case "Sockets":
{
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
{
var blockItem = Activator.CreateInstance<T>();
@@ -318,7 +339,7 @@ namespace Filtration.Parser.Services
return blockItem;
}
public void ReplaceColorBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
public void ReplaceAudioVisualBlockItemsFromString(ObservableCollection<IItemFilterBlockItem> blockItems, string inputString)
{
// Reverse iterate to remove existing IAudioVisualBlockItems
for (var idx = blockItems.Count - 1; idx >= 0; idx--)
@@ -335,6 +356,13 @@ namespace Filtration.Parser.Services
switch (matches.Value)
{
case "PlayAlertSound":
{
var match = Regex.Match(line, @"\s+(\d+) (\d+)");
if (!match.Success) break;
blockItems.Add(new SoundBlockItem(Convert.ToInt16(match.Groups[1].Value), Convert.ToInt16(match.Groups[2].Value)));
break;
}
case "SetTextColor":
{
blockItems.Add(GetColorBlockItemFromString<TextColorBlockItem>(line));

View File

@@ -35,12 +35,12 @@
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.13.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.0\lib\net45\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.13.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.13.1\lib\net45\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Moq, Version=4.5.21.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.0" targetFramework="net461" />
<package id="FluentAssertions" version="4.13.1" targetFramework="net461" />
<package id="Moq" version="4.5.21" targetFramework="net461" />
<package id="NUnit" version="3.4.1" targetFramework="net461" />
</packages>

Binary file not shown.

View File

@@ -1,18 +1,16 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Threading;
using AutoMapper;
using Castle.Facilities.TypedFactory;
using Castle.MicroKernel.ModelBuilder.Inspectors;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Castle.Windsor.Installer;
using Filtration.ObjectModel;
using Filtration.ObjectModel.ThemeEditor;
using Filtration.Properties;
using Filtration.Services;
using Filtration.ThemeEditor.ViewModels;
using Filtration.ViewModels;
using Filtration.Views;
@@ -71,6 +69,9 @@ namespace Filtration
var mainWindow = _container.Resolve<IMainWindow>();
mainWindow.Show();
var updateCheckService = _container.Resolve<IUpdateCheckService>();
updateCheckService.CheckForUpdates();
}
private static void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)

View File

@@ -11,7 +11,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("XVar Industries Inc.")]
[assembly: AssemblyProduct("Filtration")]
[assembly: AssemblyCopyright("Copyright © Ben Wallis 2015")]
[assembly: AssemblyCopyright("Copyright © Ben Wallis 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -50,7 +50,7 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.13")]
[assembly: AssemblyVersion("0.15")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]

View File

@@ -6,13 +6,15 @@ using System.Windows;
using System.Xml.Serialization;
using Filtration.Models;
using Filtration.Properties;
using Filtration.ViewModels;
using Filtration.Views;
using NLog;
namespace Filtration.Services
{
internal interface IUpdateCheckService
{
UpdateData CheckForUpdates();
void CheckForUpdates();
}
internal class UpdateCheckService : IUpdateCheckService
@@ -20,13 +22,16 @@ namespace Filtration.Services
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly IHTTPService _httpService;
private readonly IUpdateAvailableViewModel _updateAvailableViewModel;
public UpdateCheckService(IHTTPService httpService)
public UpdateCheckService(IHTTPService httpService,
IUpdateAvailableViewModel updateAvailableViewModel)
{
_httpService = httpService;
_updateAvailableViewModel = updateAvailableViewModel;
}
public UpdateData CheckForUpdates()
public void CheckForUpdates()
{
var assemblyVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
@@ -45,7 +50,6 @@ namespace Filtration.Services
Settings.Default.Save();
updateData.UpdateAvailable = true;
return updateData;
}
}
@@ -73,8 +77,13 @@ namespace Filtration.Services
}
}
updateData.UpdateAvailable = false;
return updateData;
if (updateData.UpdateAvailable)
{
var updateAvailableView = new UpdateAvailableView { DataContext = _updateAvailableViewModel };
_updateAvailableViewModel.Initialise(updateData);
_updateAvailableViewModel.OnRequestClose += (s, e) => updateAvailableView.Close();
updateAvailableView.ShowDialog();
}
}
catch (Exception e)
{
@@ -82,8 +91,6 @@ namespace Filtration.Services
// We don't care if the update check fails, because it could fail for multiple reasons
// including the user blocking Filtration in their firewall.
}
return null;
}
private static bool LatestVersionIsNewerThanSuppressedVersion(UpdateData updateData)

View File

@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
xmlns:extensions="clr-namespace:Filtration.Extensions"
@@ -13,6 +14,9 @@
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}"
d:DesignHeight="200" d:DesignWidth="160">
<UserControl.Resources>
<commonConverters:BooleanInverterConverter x:Key="BooleanInverterConverter"></commonConverters:BooleanInverterConverter>
</UserControl.Resources>
<Border Style="{StaticResource BlockItemBorder}" Width="150">
<Grid>
<Grid.RowDefinitions>
@@ -35,6 +39,14 @@
</WrapPanel>
</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 -->
<DataTemplate DataType="{x:Type blockItemBaseTypes:NumericFilterPredicateBlockItem}">
<userControls:NumericFilterPredicateControl Margin="5,5,5,5" NumericFilterPredicate="{Binding FilterPredicate}" Minimum="{Binding Minimum, Mode=OneTime}" Maximum="{Binding Maximum, Mode=OneTime}" />

View File

@@ -24,6 +24,7 @@ namespace Filtration.ViewModels
bool IsExpanded { get; set; }
IItemFilterBlock Block { get; }
bool BlockEnabled { get; set; }
string BlockDescription { get; set; }
void RefreshBlockPreview();
}
@@ -186,7 +187,9 @@ namespace Filtration.ViewModels
typeof (HeightBlockItem),
typeof (SocketGroupBlockItem),
typeof (ClassBlockItem),
typeof (BaseTypeBlockItem)
typeof (BaseTypeBlockItem),
typeof (IdentifiedBlockItem),
typeof (CorruptedBlockItem)
};
public List<Type> AudioVisualBlockItemTypesAvailable => new List<Type>
@@ -359,10 +362,10 @@ namespace Filtration.ViewModels
IsDirty = true;
}
if (sender is IAudioVisualBlockItem)
{
//if (sender is IAudioVisualBlockItem)
//{
RefreshBlockPreview();
}
//}
}
public void RefreshBlockPreview()

View File

@@ -605,7 +605,7 @@ namespace Filtration.ViewModels
return;
}
_blockTranslator.ReplaceColorBlockItemsFromString(targetBlockViewModel.Block.BlockItems, clipboardText);
_blockTranslator.ReplaceAudioVisualBlockItemsFromString(targetBlockViewModel.Block.BlockItems, clipboardText);
targetBlockViewModel.RefreshBlockPreview();
}

View File

@@ -10,13 +10,10 @@ using System.Windows.Forms;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Filtration.Common.Services;
using Filtration.Common.ViewModels;
using Filtration.Interface;
using Filtration.Models;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.ThemeEditor;
using Filtration.Parser.Interface.Services;
using Filtration.Properties;
using Filtration.Repositories;
using Filtration.Services;
using Filtration.ThemeEditor.Messages;
@@ -50,8 +47,6 @@ namespace Filtration.ViewModels
private readonly IAvalonDockWorkspaceViewModel _avalonDockWorkspaceViewModel;
private readonly IThemeProvider _themeProvider;
private readonly IThemeService _themeService;
private readonly IUpdateCheckService _updateCheckService;
private readonly IUpdateAvailableViewModel _updateAvailableViewModel;
private readonly IMessageBoxService _messageBoxService;
private readonly IClipboardService _clipboardService;
private bool _showLoadingBanner;
@@ -63,8 +58,6 @@ namespace Filtration.ViewModels
ISettingsPageViewModel settingsPageViewModel,
IThemeProvider themeProvider,
IThemeService themeService,
IUpdateCheckService updateCheckService,
IUpdateAvailableViewModel updateAvailableViewModel,
IMessageBoxService messageBoxService,
IClipboardService clipboardService)
{
@@ -75,8 +68,6 @@ namespace Filtration.ViewModels
SettingsPageViewModel = settingsPageViewModel;
_themeProvider = themeProvider;
_themeService = themeService;
_updateCheckService = updateCheckService;
_updateAvailableViewModel = updateAvailableViewModel;
_messageBoxService = messageBoxService;
_clipboardService = clipboardService;
@@ -102,10 +93,8 @@ namespace Filtration.ViewModels
AddBlockCommand = new RelayCommand(OnAddBlockCommand, () => ActiveDocumentIsScript);
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => ActiveDocumentIsScript);
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedBlock);
DisableBlockCommand = new RelayCommand(OnDisableBlockCommand,
() => ActiveDocumentIsScript && ActiveScriptHasSelectedEnabledBlock);
EnableBlockCommand = new RelayCommand(OnEnableBlockCommand,
() => ActiveDocumentIsScript && ActiveScriptHasSelectedDisabledBlock);
DisableBlockCommand = new RelayCommand(OnDisableBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedEnabledBlock);
EnableBlockCommand = new RelayCommand(OnEnableBlockCommand, () => ActiveDocumentIsScript && ActiveScriptHasSelectedDisabledBlock);
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
ReplaceColorsCommand = new RelayCommand(OnReplaceColorsCommand, () => ActiveDocumentIsScript);
@@ -116,10 +105,7 @@ namespace Filtration.ViewModels
AddTextColorThemeComponentCommand = new RelayCommand(OnAddTextColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddBackgroundColorThemeComponentCommand = new RelayCommand(OnAddBackgroundColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddBorderColorThemeComponentCommand = new RelayCommand(OnAddBorderColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
DeleteThemeComponentCommand = new RelayCommand(OnDeleteThemeComponentCommand,
() =>
ActiveDocumentIsTheme && ActiveThemeIsEditable &&
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.SelectedThemeComponent != null);
DeleteThemeComponentCommand = new RelayCommand(OnDeleteThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable && _avalonDockWorkspaceViewModel.ActiveThemeViewModel.SelectedThemeComponent != null);
ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand, () => ActiveDocumentIsScript);
CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand, () => ActiveDocumentIsScript);
@@ -189,8 +175,6 @@ namespace Filtration.ViewModels
}
}
});
CheckForUpdates();
}
public RelayCommand OpenScriptCommand { get; }
@@ -233,19 +217,6 @@ namespace Filtration.ViewModels
public RelayCommand<bool> ToggleShowAdvancedCommand { get; }
public RelayCommand ClearFiltersCommand { get; }
private void CheckForUpdates()
{
var updateData = _updateCheckService.CheckForUpdates();
if (updateData != null && updateData.UpdateAvailable)
{
var updateAvailableView = new UpdateAvailableView { DataContext = _updateAvailableViewModel };
_updateAvailableViewModel.Initialise(updateData);
_updateAvailableViewModel.OnRequestClose += (s, e) => updateAvailableView.Close();
updateAvailableView.ShowDialog();
}
}
public ImageSource Icon { get; private set; }
public IAvalonDockWorkspaceViewModel AvalonDockWorkspaceViewModel => _avalonDockWorkspaceViewModel;

View File

@@ -75,8 +75,7 @@
<MenuItem Header="Paste Block Style" Command="{Binding PasteBlockStyleCommand}" Icon="{StaticResource PasteIcon}" />
</MenuItem>
<MenuItem Header="Add Block" Command="{Binding Data.AddBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddBlockIcon}" />
<MenuItem Header="Add Section" Command="{Binding Data.AddSectionCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddSectionIcon}">
</MenuItem>
<MenuItem Header="Add Section" Command="{Binding Data.AddSectionCommand, Source={StaticResource Proxy}}" Icon="{StaticResource AddSectionIcon}" />
<Separator />
<MenuItem Header="Delete Block" Command="{Binding Data.DeleteBlockCommand, Source={StaticResource Proxy}}" Icon="{StaticResource DeleteIcon}" />
<Separator />

View File

@@ -16,6 +16,24 @@
</Style>
</UserControl.Resources>
<Grid>
<Grid.ContextMenu>
<ContextMenu>
<ContextMenu.Items>
<MenuItem Header="Copy Block" Command="{Binding CopyBlockCommand}" Icon="{StaticResource CopyIcon}" />
<MenuItem Header="Paste Block" Command="{Binding PasteBlockCommand}" Icon="{StaticResource PasteIcon}" />
<Separator />
<MenuItem Header="Add Block" Command="{Binding AddBlockCommand}" Icon="{StaticResource AddBlockIcon}" />
<MenuItem Header="Add Section" Command="{Binding AddSectionCommand}" Icon="{StaticResource AddSectionIcon}" />
<Separator />
<MenuItem Header="Delete Section" Command="{Binding DeleteBlockCommand}" Icon="{StaticResource DeleteIcon}" />
<Separator />
<MenuItem Header="Move Section To Top" Command="{Binding MoveBlockToTopCommand}" Icon="{StaticResource MoveToTopIcon}" />
<MenuItem Header="Move Section Up" Command="{Binding MoveBlockUpCommand}" Icon="{StaticResource MoveUpIcon}" />
<MenuItem Header="Move Section Down" Command="{Binding MoveBlockDownCommand}" Icon="{StaticResource MoveDownIcon}" />
<MenuItem Header="Move Section To Bottom" Command="{Binding MoveBlockToBottomCommand}" Icon="{StaticResource MoveToBottomIcon}" />
</ContextMenu.Items>
</ContextMenu>
</Grid.ContextMenu>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />

View File

@@ -21,7 +21,7 @@
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Block.Description, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Block.Description}" />
<TextBlock Text="{Binding BlockDescription, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding BlockDescription}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

View File

@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
Title="Filtration - New Version Available!" Height="300" Width="500"
Title="Filtration - New Version Available!" Height="300" Width="500" Icon="../Resources/filtration.ico"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=viewModels:UpdateAvailableViewModel}">
<Grid Margin="10">

View File

@@ -3,9 +3,9 @@
Filtration is an editor for Path of Exile item filter scripts.
## Current Release (Released 2016-08-30)
<b>Installer (7.44mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.12/filtration_0.12_setup.exe">filtration_0.12_setup.exe</a>
<b>Installer (7.44mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.13/filtration_0.13_setup.exe">filtration_0.13_setup.exe</a>
<b>Zip File (9.75mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.12/filtration_0.12.zip">filtration_0.12.zip</a>
<b>Zip File (9.75mb)</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.13/filtration_0.13.zip">filtration_0.13.zip</a>
## System Requirements
Filtration requires .NET Framework 4.6.1 installed.