52 Commits

Author SHA1 Message Date
Ben Wallis
85c215382b bumped version to 1.2.0 2019-04-10 17:39:15 +01:00
Ben Wallis
c44d7b6095 Changed version to 1.2.0-beta1 2019-03-18 17:49:21 +00:00
Ben Wallis
717a0a83a9 * Bumped version to 1.2.0
* Added enchantments to Enchantments.txt
* Updated nuspec
2019-03-18 17:48:16 +00:00
azakhi
1f9a1c5196 Support for Path of Exile 3.6 and Synthesis League (#131)
* Add new block types

* Add new base types
2019-03-18 17:27:21 +00:00
azakhi
dea0378a16 Fix Show/Hide parsing (#133)
* Fix Show/Hide parsing

* Improve disabled block test
2019-03-18 17:27:08 +00:00
azakhi
4862452188 Fix copied visuals not affecting preview (#129) 2019-03-11 16:44:40 +00:00
azakhi
db258de11e Change default border color to transparent (#128) 2019-03-11 16:43:28 +00:00
Ben Wallis
444f09751a Merge from master (missed 1.0.3 merge) 2018-12-06 21:45:46 +00:00
Ben Wallis
9356f55209 Merge branch 'develop' of https://github.com/ben-wallis/Filtration into develop 2018-12-06 21:44:24 +00:00
Ben Wallis
fb7bd8b81e Bumped version to 1.1.0 2018-12-06 21:38:57 +00:00
azakhi
72ed517929 Fix pasting theme (#124) 2018-12-06 21:26:40 +00:00
Ben Wallis
290547cbba Fixed cancel on exit not working 2018-12-06 21:20:42 +00:00
azakhi
065e56e0a6 Fix block style pasting (#123) 2018-12-06 20:18:05 +00:00
Ben Wallis
d686e6da39 * Added DisableDropSound icon for blocks with no other sound blocks
* Bumped version to 1.1.0-beta8
2018-12-06 18:01:42 +00:00
Ben Wallis
79398667b4 Fixed DisabledDefaultSound indicator not updating 2018-12-06 17:04:02 +00:00
Glen M
2424ab9195 Fix missing audio icons within block item controls. (#121) 2018-12-06 16:23:22 +00:00
azakhi
491f448f94 Fix theme editor scrolling (#120) 2018-12-06 15:35:21 +00:00
Glen M
2f49e85227 Add a DisableDropSound indicator. (#118)
* Add a DisableDropSound indicator.

* Improve the DisableDropSound indicator tooltip.
2018-12-06 15:15:46 +00:00
azakhi
dce0af7fd6 Fix null reference error on section search (#117) 2018-12-05 21:56:39 +00:00
Ben Wallis
208aeb39f6 Changed QualityBlockItem Maximum value to 99 2018-12-05 20:42:40 +00:00
Ben Wallis
79274df0fb Removed NotSet from ItemRarity enum 2018-12-05 20:39:20 +00:00
Ben Wallis
4052d6e020 Fixed ScrollViewer event handling special casing 2018-12-05 20:26:01 +00:00
Ben Wallis
7c0da57570 Fixed combobox scrolling in ItemFilterBlockView 2018-12-05 20:09:30 +00:00
Ben Wallis
557767f4dc Fixed MinimapIcon messagebox bug #116 2018-12-05 19:25:45 +00:00
Ben Wallis
ad1b46f975 Bumped version to 1.1.0-beta7 2018-12-05 17:42:42 +00:00
Ben Wallis
9f17d84a7f * Moved VisualTreeHelper and PathOfExileColors to Filtration.Common
* Replaced bindings of PathOfExileColors with x:Static
* Fixed Advanced tab of ColorPicker control in theme editor not being clickable
2018-12-05 17:40:59 +00:00
Ben Wallis
0fe21336e6 * Fixed duplicated tooltips for sound preview buttons
* If Filtration is not running in its expected installation directory it will not check for updates - this enables us to release a zip file release that won't fail an update check every time it's run
2018-12-05 17:06:27 +00:00
Ben Wallis
2ba1b8adac Added regression test for DisableDropSound block item parsing 2018-12-05 16:49:36 +00:00
Glen M
2415be089b Create a nil value type for DisableDropSound. (#114) 2018-12-05 16:42:59 +00:00
Ben Wallis
892b2f15f2 * Removed old unused user settings
* Fixed prompt for filter directory selection appearing incorrectly on startup
* Bumped version to 1.1.0-beta6
2018-12-05 13:03:51 +00:00
Ben Wallis
042e5b41f9 Removed test projects from SquirrelReleasify build config 2018-12-05 12:42:47 +00:00
Ben Wallis
5fc260dbb2 Bumped version to 1.1.0-beta5 2018-12-05 12:42:01 +00:00
Ben Wallis
3de33e9447 Added .log as excluded filetype for installer 2018-12-05 12:33:34 +00:00
Ben Wallis
37ad9ac42e Fixed AlertSounds not being included in installer 2018-12-05 12:32:28 +00:00
Glen M
fbd02702b0 Add enable/disable DropSound buttons. (#112)
* Add enable/disable DropSound buttons.

* Add undo/redo support for the DisableSound commands.
2018-12-05 12:31:47 +00:00
Ben Wallis
a20c988380 Bumped version to 1.1.0-beta4 2018-12-05 07:04:35 +00:00
Glen M
7ce5aaa861 Support for Path of Exile 3.5 and Betrayal league. (#108)
* Fix #107 by pulling SortOrder form an enum.
* Add initial support for the Prophecy block item.
* Update the static data.
* Hook Prophecy data into the static data service.
* Fill out the initial prophecy data.
2018-12-05 06:59:10 +00:00
Glen M
4b6cee9d94 Add a few missing item classes. (#106) 2018-12-04 19:30:25 +00:00
Ben Wallis
6fb0ec8084 Fixed EditableListBoxControl mouse wheel scrolling 2018-12-03 17:41:44 +00:00
Ben Wallis
a13dc44a7d Added comments 2018-12-03 16:31:19 +00:00
Ben Wallis
05b729edf8 Fixed ScrollViewer in ItemFilterBlockView handling mouse wheel events (#105) 2018-12-03 16:28:22 +00:00
Ben Wallis
876e98437e Shortened/fixed SummaryText for several block items 2018-12-02 21:51:19 +00:00
Ben Wallis
30e76e333c * Bumped version to 1.1.0-beta3
* Fixed Switch to Appearance/Regular Block Items text overlapping block item controls
* Added Enable/Disable toggle button to Appearance block items control
* Added horizontal scrollbar to block items view
* Moved Enable/Disable toggle button to separate user control(previously it was only visible when viewing Regular block items)
* Added DesignTimeItemFilterBlockViewModel
2018-12-02 21:36:01 +00:00
Glen M
f840fb69ad Throttle selections to improve Select All performance. (#104)
Throttle selections to improve Select All performance in ItemFilterScriptViewModel.
2018-12-02 16:30:50 +00:00
Ben Wallis
ae98c2d5de Bumped version to 1.1.0-beta2 2018-11-28 22:29:52 +00:00
Ben Wallis
cde2d692c9 Update README.md 2018-10-01 17:29:00 +01:00
Ben Wallis
c96aa472d9 Bumped version to 1.0.3 2018-10-01 17:23:38 +01:00
Ben Wallis
d4e8a72d47 Implemented Splat logging integration to enable Squirrel to write log files 2018-10-01 17:00:55 +01:00
Ben Wallis
4c826f42fd Bumped version to 1.0.3-beta2 2018-10-01 13:31:57 +01:00
azakhi
4022cf12a0 Fix crash caused by null selected blocks (#92)
* Fixed a crash caused by null selected blocks
2018-10-01 13:29:35 +01:00
Ben Wallis
8073948cfe Added missing AlertSound mp3 files to installer 2018-10-01 12:26:27 +01:00
Ben Wallis
f331bffee7 Update README.md 2018-09-30 14:04:44 +01:00
115 changed files with 3753 additions and 1193 deletions

View File

@@ -66,6 +66,24 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.3.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Converters\BooleanInverterConverter.cs" />
@@ -80,6 +98,8 @@
<Compile Include="Services\FileSystemService.cs" />
<Compile Include="Services\MessageBoxService.cs" />
<Compile Include="Utilities\LineReader.cs" />
<Compile Include="Utilities\PathOfExileColors.cs" />
<Compile Include="Utilities\VisualTreeUtility.cs" />
<Compile Include="ViewModels\PaneViewModel.cs" />
<Compile Include="WindsorInstallers\ServicesInstaller.cs" />
</ItemGroup>

View File

@@ -2,9 +2,9 @@
using System.Windows.Media;
using Xceed.Wpf.Toolkit;
namespace Filtration.Views
namespace Filtration.Common.Utilities
{
internal static class PathOfExileColors
public static class PathOfExileColors
{
static PathOfExileColors()
{

View File

@@ -0,0 +1,26 @@
using System.Windows;
using System.Windows.Media;
namespace Filtration.Common.Utilities
{
public class VisualTreeUtility
{
public static T FindParent<T>(DependencyObject child)
where T : DependencyObject
{
//get parent item
var parentObject = VisualTreeHelper.GetParent(child);
//we've reached the end of the tree
if (parentObject == null) return null;
//check if the parent matches the type we're looking for
if (parentObject is T parent)
{
return parent;
}
return FindParent<T>(parentObject);
}
}
}

View File

@@ -3,5 +3,6 @@
<package id="Castle.Core" version="4.3.1" targetFramework="net461" />
<package id="Castle.Windsor" version="4.1.1" targetFramework="net461" />
<package id="CommonServiceLocator" version="2.0.4" targetFramework="net461" />
<package id="Extended.Wpf.Toolkit" version="3.4.0" targetFramework="net461" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net461" />
</packages>

View File

@@ -8,7 +8,7 @@ namespace Filtration.Interface
{
bool IsScript { get; }
bool IsTheme { get; }
Task Close();
Task<bool> Close();
RelayCommand CloseCommand { get; }
}
}

View File

@@ -41,7 +41,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public override Color SummaryTextColor => Action == BlockAction.Show ? Colors.Black : Colors.White;
public override int SortOrder => 0;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Action;
public void ToggleAction()
{

View File

@@ -2,6 +2,7 @@
using System.Runtime.CompilerServices;
using System.Windows.Media;
using Filtration.ObjectModel.Annotations;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
@@ -16,7 +17,7 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
public abstract string SummaryText { get; }
public abstract Color SummaryBackgroundColor { get; }
public abstract Color SummaryTextColor { get; }
public abstract int SortOrder { get; }
public abstract BlockItemOrdering SortOrder { get; }
public string Comment { get; set; }
public bool IsDirty

View File

@@ -27,7 +27,7 @@
}
public override string OutputText => PrefixText + " " + BooleanValue;
public override string SummaryText => PrefixText + " = " + BooleanValue;
public override string SummaryText => DisplayHeading + " = " + BooleanValue;
public override int MaximumAllowed => 1;
public void ToggleValue()

View File

@@ -0,0 +1,16 @@
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class NilBlockItem : BlockItemBase
{
protected NilBlockItem()
{
}
public override string OutputText => PrefixText;
public override string SummaryText => DisplayHeading;
public override int MaximumAllowed => 1;
public abstract string Description { get; }
}
}

View File

@@ -0,0 +1,23 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public sealed class AnyEnchantmentBlockItem : BooleanBlockItem
{
public AnyEnchantmentBlockItem()
{
}
public AnyEnchantmentBlockItem(bool booleanValue) : base(booleanValue)
{
}
public override string PrefixText => "AnyEnchantment";
public override string DisplayHeading => "Any Enchantment";
public override Color SummaryBackgroundColor => Colors.YellowGreen;
public override Color SummaryTextColor => Colors.Black;
public override BlockItemOrdering SortOrder => BlockItemOrdering.AnyEnchantment;
}
}

View File

@@ -1,4 +1,5 @@
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.BlockItemBaseTypes;
namespace Filtration.ObjectModel.BlockItemTypes
@@ -17,6 +18,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 => 23;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SetBackgroundColor;
}
}

View File

@@ -1,6 +1,7 @@
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -16,23 +17,23 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Item Base Types: " +
return "Base Types: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Item Base Types: " + Items.Take(3)
return "Base Types: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Item Base Types: (none)";
return "Base Types: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.MediumTurquoise;
public override Color SummaryTextColor => Colors.Black;
public override int SortOrder => 20;
public override BlockItemOrdering SortOrder => BlockItemOrdering.BaseType;
}
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,6 +18,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 => 24;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SetBorderColor;
}
}

View File

@@ -1,6 +1,7 @@
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -16,23 +17,23 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Item Classes: " +
return "Classes: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Item Classes: " + Items.Take(3)
return "Classes: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Item Classes: (none)";
return "Classes: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.MediumSeaGreen;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 19;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Class;
}
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Corrupted";
public override Color SummaryBackgroundColor => Colors.DarkRed;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 5;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Corrupted;
}
}

View File

@@ -1,4 +1,5 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -16,6 +17,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "CustomAlertSound";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Custom Alert Sound";
public override int SortOrder => 31;
public override BlockItemOrdering SortOrder => BlockItemOrdering.CustomAlertSound;
}
}

View File

@@ -1,23 +1,20 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public sealed class DisableDropSoundBlockItem : BooleanBlockItem, IAudioVisualBlockItem
public sealed class DisableDropSoundBlockItem : NilBlockItem, IAudioVisualBlockItem
{
public DisableDropSoundBlockItem()
{
}
public DisableDropSoundBlockItem(bool booleanValue) : base(booleanValue)
public DisableDropSoundBlockItem() : base()
{
}
public override string PrefixText => "DisableDropSound";
public override string DisplayHeading => "Disable Drop Sound";
public override string Description => "Default drop sound disabled.";
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public override int SortOrder => 28;
public override BlockItemOrdering SortOrder => BlockItemOrdering.DisableDropSound;
}
}

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 => 15;
public override BlockItemOrdering SortOrder => BlockItemOrdering.DropLevel;
public override int Minimum => 0;
public override int Maximum => 100;
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Elder Item";
public override Color SummaryBackgroundColor => Colors.DarkGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 6;
public override BlockItemOrdering SortOrder => BlockItemOrdering.ElderItem;
}
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Elder Map";
public override Color SummaryBackgroundColor => Colors.DarkGoldenrod;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 10;
public override BlockItemOrdering SortOrder => BlockItemOrdering.ElderMap;
}
}

View File

@@ -1,4 +1,5 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -16,7 +17,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 => 25;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SetFontSize;
public override int Minimum => 11;
public override int Maximum => 45;
}

View File

@@ -0,0 +1,23 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public sealed class FracturedItemBlockItem : BooleanBlockItem
{
public FracturedItemBlockItem()
{
}
public FracturedItemBlockItem(bool booleanValue) : base(booleanValue)
{
}
public override string PrefixText => "FracturedItem";
public override string DisplayHeading => "Fractured Item";
public override Color SummaryBackgroundColor => Colors.Salmon;
public override Color SummaryTextColor => Colors.Black;
public override BlockItemOrdering SortOrder => BlockItemOrdering.FracturedItem;
}
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Gem Level " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 16;
public override BlockItemOrdering SortOrder => BlockItemOrdering.GemLevel;
public override int Minimum => 0;
public override int Maximum => 21;
}

View File

@@ -0,0 +1,39 @@
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class HasEnchantmentBlockItem : StringListBlockItem
{
public override string PrefixText => "HasEnchantment";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Has Enchantment";
public override string SummaryText
{
get
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Enchantments: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Enchantments: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Enchantments: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.PaleGreen;
public override Color SummaryTextColor => Colors.Black;
public override BlockItemOrdering SortOrder => BlockItemOrdering.HasEnchantment;
}
}

View File

@@ -1,6 +1,7 @@
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -16,23 +17,23 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Item Explicit Mods: " +
return "Explicit Mods: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Item Explicit Mods: " + Items.Take(3)
return "Explicit Mods: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Item Explicit Mods: (none)";
return "Explicit Mods: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.MidnightBlue;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 21;
public override BlockItemOrdering SortOrder => BlockItemOrdering.HasExplicitMod;
}
}

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 => 12;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Height;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Identified";
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 4;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Identified;
}
}

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 => 14;
public override BlockItemOrdering SortOrder => BlockItemOrdering.ItemLevel;
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 => 1;
public override BlockItemOrdering SortOrder => BlockItemOrdering.LinkedSockets;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -19,6 +19,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "MinimapIcon";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Minimap Icon";
public override int SortOrder => 29;
public override BlockItemOrdering SortOrder => BlockItemOrdering.MinimapIcon;
}
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Map Tier " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 8;
public override BlockItemOrdering SortOrder => BlockItemOrdering.MapTier;
public override int Minimum => 1;
public override int Maximum => 16;
}

View File

@@ -18,6 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "PlayEffect";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Play Effect";
public override int SortOrder => 30;
public override BlockItemOrdering SortOrder => BlockItemOrdering.PlayEffect;
}
}

View File

@@ -1,4 +1,5 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,6 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string PrefixText => "PlayAlertSoundPositional";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Play Positional Alert Sound";
public override int SortOrder => 27;
public override BlockItemOrdering SortOrder => BlockItemOrdering.PlayAlertSoundPositional;
}
}

View File

@@ -0,0 +1,39 @@
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class ProphecyBlockItem : StringListBlockItem
{
public override string PrefixText => "Prophecy";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Prophecy";
public override string SummaryText
{
get
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Prophecies: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Prophecies: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Prophecies: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.DarkMagenta;
public override Color SummaryTextColor => Colors.White;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Prophecy;
}
}

View File

@@ -21,8 +21,8 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Quality " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkOrange;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 3;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Quality;
public override int Minimum => 0;
public override int Maximum => 30;
public override int Maximum => 99;
}
}

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 => 18;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Rarity;
public override int Minimum => 0;
public override int Maximum => (int)ItemRarity.Unique;
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Shaped Map";
public override Color SummaryBackgroundColor => Colors.DarkGoldenrod;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 9;
public override BlockItemOrdering SortOrder => BlockItemOrdering.ShapedMap;
}
}

View File

@@ -1,5 +1,6 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,7 +18,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string DisplayHeading => "Shaper Item";
public override Color SummaryBackgroundColor => Colors.DimGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 7;
public override BlockItemOrdering SortOrder => BlockItemOrdering.ShaperItem;
}
}

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 => 11;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SocketGroup;
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 => 2;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Sockets;
public override int Minimum => 0;
public override int Maximum => 6;
}

View File

@@ -1,4 +1,5 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
@@ -17,6 +18,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 => 26;
public override BlockItemOrdering SortOrder => BlockItemOrdering.PlayAlertSound;
}
}

View File

@@ -21,7 +21,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override string SummaryText => "Stack Size " + FilterPredicate;
public override Color SummaryBackgroundColor => Colors.DarkSlateGray;
public override Color SummaryTextColor => Colors.White;
public override int SortOrder => 17;
public override BlockItemOrdering SortOrder => BlockItemOrdering.StackSize;
public override int Minimum => 0;
public override int Maximum => 1000;
}

View File

@@ -0,0 +1,23 @@
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public sealed class SynthesisedItemBlockItem : BooleanBlockItem
{
public SynthesisedItemBlockItem()
{
}
public SynthesisedItemBlockItem(bool booleanValue) : base(booleanValue)
{
}
public override string PrefixText => "SynthesisedItem";
public override string DisplayHeading => "Synthesised Item";
public override Color SummaryBackgroundColor => Colors.Salmon;
public override Color SummaryTextColor => Colors.Black;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SynthesisedItem;
}
}

View File

@@ -18,6 +18,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 => 22;
public override BlockItemOrdering SortOrder => BlockItemOrdering.SetTextColor;
}
}

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 => 13;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Width;
public override int Minimum => 0;
public override int Maximum => 2;
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
namespace Filtration.ObjectModel.Commands.ItemFilterScript
{
public class AddBlockItemToBlocksCommand : IUndoableCommand
{
private readonly List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>> _input;
public AddBlockItemToBlocksCommand(List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>> input)
{
_input = input;
}
public void Execute()
{
foreach (var v in _input)
{
var blockItems = v.Item1;
var item = v.Item2;
blockItems.Add(item);
}
}
public void Undo()
{
foreach (var v in _input)
{
var blockItems = v.Item1;
var item = v.Item2;
blockItems.Remove(item);
}
}
public void Redo() => Execute();
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
namespace Filtration.ObjectModel.Commands.ItemFilterScript
{
public class RemoveBlockItemFromBlocksCommand : IUndoableCommand
{
private readonly List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>> _input;
public RemoveBlockItemFromBlocksCommand(List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>> input)
{
_input = input;
}
public void Execute()
{
foreach (var pair in _input)
{
var blockItems = pair.Item1;
var blockItem = pair.Item2;
for (var i = 0; i < blockItems.Count; i++)
{
if (blockItems[i] == blockItem)
{
blockItems.RemoveAt(i--);
}
}
}
}
public void Undo()
{
foreach (var pair in _input)
{
var blockItems = pair.Item1;
var blockItem = pair.Item2;
blockItems.Add(blockItem);
}
}
public void Redo() => Execute();
}
}

View File

@@ -0,0 +1,45 @@
using System.ComponentModel;
namespace Filtration.ObjectModel.Enums
{
public enum BlockItemOrdering
{
Action,
LinkedSockets,
Sockets,
Quality,
Identified,
Corrupted,
ElderItem,
ShaperItem,
SynthesisedItem,
FracturedItem,
AnyEnchantment,
MapTier,
ShapedMap,
ElderMap,
SocketGroup,
Height,
Width,
ItemLevel,
DropLevel,
GemLevel,
StackSize,
Rarity,
Class,
BaseType,
Prophecy,
HasExplicitMod,
HasEnchantment,
SetTextColor,
SetBackgroundColor,
SetBorderColor,
SetFontSize,
PlayAlertSound,
PlayAlertSoundPositional,
DisableDropSound,
MinimapIcon,
PlayEffect,
CustomAlertSound
}
}

View File

@@ -8,6 +8,7 @@
Rarity,
Class,
BaseType,
Prophecy,
Sockets,
LinkedSockets,
SocketGroup,

View File

@@ -4,8 +4,6 @@ namespace Filtration.ObjectModel.Enums
{
public enum ItemRarity
{
[Description("Not Set")]
NotSet,
[Description("Normal")]
Normal,
[Description("Magic")]

View File

@@ -26,14 +26,11 @@ namespace Filtration.ObjectModel.Extensions
{
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.UniqueItem];
}
case ItemRarity.NotSet:
{
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.QuestItem];
}
default:
{
throw new ArgumentOutOfRangeException(nameof(itemRarity), itemRarity, null);
}
}
}
}
}

View File

@@ -75,13 +75,17 @@
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\EffectColorBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\IconBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\NilBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StrIntBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringListBlockItem.cs" />
<Compile Include="BlockItemTypes\AnyEnchantmentBlockItem.cs" />
<Compile Include="BlockItemTypes\BackgroundColorBlockItem.cs" />
<Compile Include="BlockItemTypes\BaseTypeBlockItem.cs" />
<Compile Include="BlockItemTypes\FracturedItemBlockItem.cs" />
<Compile Include="BlockItemTypes\HasEnchantmentBlockItem.cs" />
<Compile Include="BlockItemTypes\MapTierBlockItem.cs" />
<Compile Include="BlockItemTypes\PlayEffectBlockItem.cs" />
<Compile Include="BlockItemTypes\BorderColorBlockItem.cs" />
@@ -92,7 +96,9 @@
<Compile Include="BlockItemTypes\GemLevelBlockItem.cs" />
<Compile Include="BlockItemTypes\HasExplicitModBlockItem.cs" />
<Compile Include="BlockItemTypes\MapIconBlockItem.cs" />
<Compile Include="BlockItemTypes\ProphecyBlockItem.cs" />
<Compile Include="BlockItemTypes\ShapedMapBlockItem.cs" />
<Compile Include="BlockItemTypes\SynthesisedItemBlockItem.cs" />
<Compile Include="BlockItemTypes\ShaperItemBlockItem.cs" />
<Compile Include="BlockItemTypes\ElderItemBlockItem.cs" />
<Compile Include="BlockItemTypes\CorruptedBlockItem.cs" />
@@ -113,16 +119,19 @@
<Compile Include="BlockItemTypes\WidthBlockItem.cs" />
<Compile Include="Commands\CommandManager.cs" />
<Compile Include="Commands\ICommand.cs" />
<Compile Include="Commands\ItemFilterScript\AddBlockItemToBlocksCommand.cs" />
<Compile Include="Commands\ItemFilterScript\MoveBlocksToIndexCommand.cs" />
<Compile Include="Commands\ItemFilterScript\MoveBlocksToBottomCommand.cs" />
<Compile Include="Commands\ItemFilterScript\AddCommentBlockCommand.cs" />
<Compile Include="Commands\ItemFilterScript\MoveBlocksToTopCommand.cs" />
<Compile Include="Commands\ItemFilterScript\PasteBlocksCommand.cs" />
<Compile Include="Commands\ItemFilterScript\RemoveBlockItemFromBlocksCommand.cs" />
<Compile Include="Commands\ItemFilterScript\RemoveBlocksCommand.cs" />
<Compile Include="Commands\ItemFilterScript\SetScriptDescriptionCommand.cs" />
<Compile Include="Commands\ItemFilterScript\AddBlockCommand.cs" />
<Compile Include="Commands\IUndoableCommand.cs" />
<Compile Include="Enums\BlockAction.cs" />
<Compile Include="Enums\BlockItemOrdering.cs" />
<Compile Include="Enums\BlockItemType.cs" />
<Compile Include="Enums\EffectColor.cs" />
<Compile Include="Enums\FilterPredicateOperator.cs" />

View File

@@ -1,5 +1,6 @@
using System.ComponentModel;
using System.Windows.Media;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel
{
@@ -12,7 +13,7 @@ namespace Filtration.ObjectModel
Color SummaryBackgroundColor { get; }
Color SummaryTextColor { get; }
int MaximumAllowed { get; }
int SortOrder { get; }
BlockItemOrdering SortOrder { get; }
bool IsDirty { get; }
string Comment { get; set; }
}

View File

@@ -121,10 +121,8 @@ namespace Filtration.ObjectModel
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.QuestItem];
}
return ItemRarity != ItemRarity.NotSet ? ItemRarity.DefaultRarityTextColor() : PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
return ItemRarity.DefaultRarityTextColor();
}
}
}
}

View File

@@ -279,7 +279,7 @@ namespace Filtration.ObjectModel
get
{
var borderColorBlockItem = BlockItems.OfType<BorderColorBlockItem>().FirstOrDefault();
return borderColorBlockItem?.Color ?? new Color { A = 240, R = 0, G = 0, B = 0 };
return borderColorBlockItem?.Color ?? new Color { A = 0, R = 255, G = 255, B = 255 };
}
}

View File

@@ -567,6 +567,25 @@ namespace Filtration.Parser.Tests.Services
Assert.Contains("Test BaseType 2", blockItem.Items);
}
[Test]
public void TranslateStringToItemFilterBlock_Prophecy_ReturnsCorrectObject()
{
// Arrange
var inputString = "Show" + Environment.NewLine +
@" Prophecy ""Test Prophecy 1"" ""TestOneWordProphecyInQuotes"" TestOneWordProphecyNotInQuotes ""Test Prophecy 2""";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is ProphecyBlockItem));
var blockItem = result.BlockItems.OfType<ProphecyBlockItem>().First();
Assert.Contains("Test Prophecy 1", blockItem.Items);
Assert.Contains("TestOneWordProphecyInQuotes", blockItem.Items);
Assert.Contains("TestOneWordProphecyNotInQuotes", blockItem.Items);
Assert.Contains("Test Prophecy 2", blockItem.Items);
}
[Test]
public void TranslateStringToItemFilterBlock_HasExplicitMod_ReturnsCorrectObject()
{
@@ -900,7 +919,7 @@ namespace Filtration.Parser.Tests.Services
{
// Arrange
var inputString = "Show" + Environment.NewLine +
" DisableDropSound True";
" DisableDropSound # Test";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
@@ -909,7 +928,22 @@ namespace Filtration.Parser.Tests.Services
Assert.AreEqual(1, result.BlockItems.Count(b => b is DisableDropSoundBlockItem));
var blockItem = result.BlockItems.OfType<DisableDropSoundBlockItem>().First();
Assert.IsTrue(blockItem.BooleanValue);
Assert.AreEqual(blockItem.Comment, " Test");
}
[Test]
public void TranslateStringToItemFilterBlock_DisableDropSound_IncorrectBooleanValue_ReturnsCorrectObject()
{
// Arrange
var inputString = "Show" + Environment.NewLine +
" DisableDropSound True";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is DisableDropSoundBlockItem));
}
[Test]
@@ -934,6 +968,7 @@ namespace Filtration.Parser.Tests.Services
" ElderMap False" + Environment.NewLine +
@" Class ""My Item Class"" AnotherClass ""AndAnotherClass""" + Environment.NewLine +
@" BaseType MyBaseType ""Another BaseType""" + Environment.NewLine +
@" Prophecy MyProphecy ""Another Prophecy""" + Environment.NewLine +
@" HasExplicitMod MyMod ""Another Mod""" + Environment.NewLine +
" JunkLine Let's ignore this one!" + Environment.NewLine +
" #Quality Commented out quality line" + Environment.NewLine +
@@ -945,7 +980,7 @@ namespace Filtration.Parser.Tests.Services
" SetBorderColor 0 0 0" + Environment.NewLine +
" SetFontSize 50" + Environment.NewLine +
" PlayAlertSound 3" + Environment.NewLine +
" DisableDropSound False" + Environment.NewLine +
" DisableDropSound # False" + Environment.NewLine +
" CustomAlertSound \"test.mp3\" # customSoundTheme" + Environment.NewLine +
" MinimapIcon 2 Green Triangle # iconTheme" + Environment.NewLine +
" PlayEffect Green Temp # effectTheme" + Environment.NewLine;
@@ -1008,6 +1043,11 @@ namespace Filtration.Parser.Tests.Services
Assert.Contains("MyBaseType", baseTypeblockItem.Items);
Assert.Contains("Another BaseType", baseTypeblockItem.Items);
var prophecyblockItem = result.BlockItems.OfType<ProphecyBlockItem>().First();
Assert.AreEqual(2, prophecyblockItem.Items.Count);
Assert.Contains("MyProphecy", prophecyblockItem.Items);
Assert.Contains("Another Prophecy", prophecyblockItem.Items);
var hasExplicitModBlockItem = result.BlockItems.OfType<HasExplicitModBlockItem>().First();
Assert.AreEqual(2, hasExplicitModBlockItem.Items.Count);
Assert.Contains("MyMod", hasExplicitModBlockItem.Items);
@@ -1050,7 +1090,7 @@ namespace Filtration.Parser.Tests.Services
Assert.AreEqual(0, result.BlockItems.OfType<SoundBlockItem>().Count());
var disableDropSoundBlockItem = result.BlockItems.OfType<DisableDropSoundBlockItem>().First();
Assert.IsFalse(disableDropSoundBlockItem.BooleanValue);
Assert.AreEqual(disableDropSoundBlockItem.Comment, " False");
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("test.mp3", customSoundBlockItem.Value);
@@ -1707,6 +1747,26 @@ namespace Filtration.Parser.Tests.Services
Assert.AreEqual(expectedResult, result);
}
[Test]
public void TranslateItemFilterBlockToString_Prophecies_ReturnsCorrectString()
{
// Arrange
var expectedResult = "Show" + Environment.NewLine +
" Prophecy \"Test Prophecy\" \"Another Prophecy\" \"Yet Another Prophecy\"";
var prophecyBlockItem = new ProphecyBlockItem();
prophecyBlockItem.Items.Add("Test Prophecy");
prophecyBlockItem.Items.Add("Another Prophecy");
prophecyBlockItem.Items.Add("Yet Another Prophecy");
_testUtility.TestBlock.BlockItems.Add(prophecyBlockItem);
// Act
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
// Assert
Assert.AreEqual(expectedResult, result);
}
[Test]
public void TranslateItemFilterBlockToString_HasExplicitMod_ReturnsCorrectString()
{
@@ -2013,13 +2073,14 @@ namespace Filtration.Parser.Tests.Services
" Rarity = Unique" + Environment.NewLine +
" Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine +
" BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" + Environment.NewLine +
" Prophecy \"The Cursed Choir\" \"A Valuable Combination\" \"The Beautiful Guide\"" + Environment.NewLine +
" HasExplicitMod \"Guatelitzi's\" \"of Tacati\" \"Tyrannical\"" + 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" + Environment.NewLine +
" DisableDropSound True" + Environment.NewLine +
" DisableDropSound" + Environment.NewLine +
" MinimapIcon 1 Blue Circle" + Environment.NewLine +
" PlayEffect Red Temp" + Environment.NewLine +
" CustomAlertSound \"test.mp3\"";
@@ -2046,6 +2107,11 @@ namespace Filtration.Parser.Tests.Services
baseTypeItemblockItem.Items.Add("Simple Robe");
baseTypeItemblockItem.Items.Add("Full Wyrmscale");
_testUtility.TestBlock.BlockItems.Add(baseTypeItemblockItem);
var prophecyItemblockItem = new ProphecyBlockItem();
prophecyItemblockItem.Items.Add("The Cursed Choir");
prophecyItemblockItem.Items.Add("A Valuable Combination");
prophecyItemblockItem.Items.Add("The Beautiful Guide");
_testUtility.TestBlock.BlockItems.Add(prophecyItemblockItem);
var hasExplicitModBlockItem = new HasExplicitModBlockItem();
hasExplicitModBlockItem.Items.Add("Guatelitzi's");
hasExplicitModBlockItem.Items.Add("of Tacati");
@@ -2069,7 +2135,7 @@ namespace Filtration.Parser.Tests.Services
_testUtility.TestBlock.BlockItems.Add(new MapTierBlockItem(FilterPredicateOperator.LessThan, 10));
_testUtility.TestBlock.BlockItems.Add(new MapIconBlockItem(IconSize.Medium, IconColor.Blue, IconShape.Circle));
_testUtility.TestBlock.BlockItems.Add(new PlayEffectBlockItem(EffectColor.Red, true));
_testUtility.TestBlock.BlockItems.Add(new DisableDropSoundBlockItem(true));
_testUtility.TestBlock.BlockItems.Add(new DisableDropSoundBlockItem());
// Act
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);

View File

@@ -322,7 +322,13 @@ namespace Filtration.Parser.Tests.Services
Environment.NewLine +
"Show" + Environment.NewLine +
" ItemLevel > 20" + Environment.NewLine +
" SetTextColor 255 255 0";
" SetTextColor 255 255 0" + Environment.NewLine +
Environment.NewLine +
"#Show $Recipes->Glassblower->15% %D1" + Environment.NewLine +
"# SetTextColor 255 255 0" + Environment.NewLine +
Environment.NewLine +
"#Hide simple text without any special character" + Environment.NewLine +
"# SetTextColor 255 255 0";
var blockTranslator = new ItemFilterBlockTranslator(Mock.Of<IBlockGroupHierarchyBuilder>());
@@ -332,15 +338,21 @@ namespace Filtration.Parser.Tests.Services
var result = translator.TranslateStringToItemFilterScript(testInputScript);
// Assert
Assert.AreEqual(3, result.ItemFilterBlocks.Count);
Assert.AreEqual(5, result.ItemFilterBlocks.Count);
var firstBlock = result.ItemFilterBlocks.OfType<ItemFilterBlock>().First();
var secondBlock = result.ItemFilterBlocks.OfType<ItemFilterBlock>().Skip(1).First();
var thirdBlock = result.ItemFilterBlocks.OfType<ItemFilterBlock>().Skip(2).First();
var fourthBlock = result.ItemFilterBlocks.OfType<ItemFilterBlock>().Skip(3).First();
var fifthBlock = result.ItemFilterBlocks.OfType<ItemFilterBlock>().Skip(4).First();
Assert.AreEqual(3, firstBlock.BlockItems.Count);
Assert.AreEqual(5, secondBlock.BlockItems.Count);
Assert.AreEqual(3, thirdBlock.BlockItems.Count);
Assert.AreEqual(2, fourthBlock.BlockItems.Count);
Assert.AreEqual(2, fifthBlock.BlockItems.Count);
Assert.AreEqual(false, fourthBlock.Enabled);
Assert.AreEqual(false, fifthBlock.Enabled);
}
[Test]

View File

@@ -159,6 +159,11 @@ namespace Filtration.Parser.Services
AddStringListItemToBlockItems<BaseTypeBlockItem>(block, trimmedLine);
break;
}
case "Prophecy":
{
AddStringListItemToBlockItems<ProphecyBlockItem>(block, trimmedLine);
break;
}
case "Corrupted":
{
AddBooleanItemToBlockItems<CorruptedBlockItem>(block, trimmedLine);
@@ -179,6 +184,21 @@ namespace Filtration.Parser.Services
AddBooleanItemToBlockItems<ShaperItemBlockItem>(block, trimmedLine);
break;
}
case "SynthesisedItem":
{
AddBooleanItemToBlockItems<SynthesisedItemBlockItem>(block, trimmedLine);
break;
}
case "FracturedItem":
{
AddBooleanItemToBlockItems<FracturedItemBlockItem>(block, trimmedLine);
break;
}
case "AnyEnchantment":
{
AddBooleanItemToBlockItems<AnyEnchantmentBlockItem>(block, trimmedLine);
break;
}
case "ShapedMap":
{
AddBooleanItemToBlockItems<ShapedMapBlockItem>(block, trimmedLine);
@@ -312,6 +332,11 @@ namespace Filtration.Parser.Services
AddStringListItemToBlockItems<HasExplicitModBlockItem>(block, trimmedLine);
break;
}
case "HasEnchantment":
{
AddStringListItemToBlockItems<HasEnchantmentBlockItem>(block, trimmedLine);
break;
}
case "ElderMap":
{
AddBooleanItemToBlockItems<ElderMapBlockItem>(block, trimmedLine);
@@ -322,7 +347,7 @@ namespace Filtration.Parser.Services
// Only ever use the last DisableDropSound item encountered as multiples aren't valid.
RemoveExistingBlockItemsOfType<DisableDropSoundBlockItem>(block);
AddBooleanItemToBlockItems<DisableDropSoundBlockItem>(block, trimmedLine);
AddNilItemToBlockItems<DisableDropSoundBlockItem>(block, trimmedLine);
break;
}
case "MinimapIcon":
@@ -344,12 +369,6 @@ namespace Filtration.Parser.Services
Shape = EnumHelper.GetEnumValueFromDescription<IconShape>(match.Groups[3].Value)
};
var themeComponent = _masterComponentCollection.AddComponent(ThemeComponentType.Icon, match.Groups[5].Value.Trim(),
blockItemValue.Size, blockItemValue.Color, blockItemValue.Shape);
if(match.Groups[4].Value == "#" && !string.IsNullOrWhiteSpace(match.Groups[5].Value))
{
blockItemValue.ThemeComponent = themeComponent;
}
block.BlockItems.Add(blockItemValue);
themeComponentType = (int)ThemeComponentType.Icon;
}
@@ -507,6 +526,13 @@ namespace Filtration.Parser.Services
}
}
private static void AddNilItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NilBlockItem
{
var blockItem = Activator.CreateInstance<T>();
blockItem.Comment = GetTextAfterFirstComment(inputString);
block.BlockItems.Add(blockItem);
}
private static void AddNumericFilterPredicateItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NumericFilterPredicateBlockItem
{
var blockItem = Activator.CreateInstance<T>();
@@ -561,12 +587,17 @@ namespace Filtration.Parser.Services
var trimmedLine = line.Trim();
if (trimmedLine.IndexOf('#') > 0)
{
blockComment = trimmedLine.Substring(trimmedLine.IndexOf('#') + 1);
blockComment = trimmedLine.Substring(trimmedLine.IndexOf('#') + 1).Trim();
trimmedLine = trimmedLine.Substring(0, trimmedLine.IndexOf('#')).Trim();
}
switch (matches.Value)
{
case "DisableDropSound":
{
blockItems.Add(new DisableDropSoundBlockItem());
break;
}
case "PlayAlertSound":
{
var match = Regex.Match(trimmedLine, @"\s+(\S+) (\d+)");
@@ -581,6 +612,20 @@ namespace Filtration.Parser.Services
blockItems.Add(blockItem);
break;
}
case "PlayAlertSoundPositional":
{
var match = Regex.Match(trimmedLine, @"\s+(\S+) (\d+)");
if (!match.Success) break;
var blockItem = new PositionalSoundBlockItem(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value));
if(_masterComponentCollection != null && !string.IsNullOrWhiteSpace(blockComment))
{
ThemeComponent themeComponent = _masterComponentCollection.AddComponent(ThemeComponentType.AlertSound,
blockComment, blockItem.Value, blockItem.SecondValue);
blockItem.ThemeComponent = themeComponent;
}
blockItems.Add(blockItem);
break;
}
case "SetTextColor":
{
var result = Regex.Matches(trimmedLine, @"([\w\s]*)");
@@ -637,6 +682,56 @@ namespace Filtration.Parser.Services
blockItems.Add(blockItem);
break;
}
case "MinimapIcon":
{
// TODO: Get size, color, shape values programmatically
var match = Regex.Match(trimmedLine,
@"\S+\s+(0|1|2)\s+(Red|Green|Blue|Brown|White|Yellow)\s+(Circle|Diamond|Hexagon|Square|Star|Triangle)\s*([#]?)(.*)",
RegexOptions.IgnoreCase);
if (match.Success)
{
var blockItemValue = new MapIconBlockItem
{
Size = (IconSize)short.Parse(match.Groups[1].Value),
Color = EnumHelper.GetEnumValueFromDescription<IconColor>(match.Groups[2].Value),
Shape = EnumHelper.GetEnumValueFromDescription<IconShape>(match.Groups[3].Value)
};
blockItems.Add(blockItemValue);
}
break;
}
case "PlayEffect":
{
// TODO: Get colors programmatically
var match = Regex.Match(trimmedLine, @"\S+\s+(Red|Green|Blue|Brown|White|Yellow)\s*(Temp)?", RegexOptions.IgnoreCase);
if (match.Success)
{
var blockItemValue = new PlayEffectBlockItem
{
Color = EnumHelper.GetEnumValueFromDescription<EffectColor>(match.Groups[1].Value),
Temporary = match.Groups[2].Value.Trim().ToLower() == "temp"
};
blockItems.Add(blockItemValue);
}
break;
}
case "CustomAlertSound":
{
var match = Regex.Match(trimmedLine, @"\S+\s+""([^\*\<\>\?|]+)""");
if (match.Success)
{
var blockItemValue = new CustomSoundBlockItem
{
Value = match.Groups[1].Value
};
blockItems.Add(blockItemValue);
}
break;
}
}
}
}

View File

@@ -61,8 +61,7 @@ namespace Filtration.Parser.Services
lines[i] = lines[i].Trim();
if(!lines[i].StartsWith("#"))
{
string curLine = Regex.Replace(lines[i], @"\s+", "");
if ((curLine.StartsWith("Show") || curLine.StartsWith("Hide")) && (curLine.Length == 4 || curLine[4] == '#')) // found
if ((lines[i].StartsWith("Show") || lines[i].StartsWith("Hide")) && (lines[i].Length == 4 || lines[i][4] == ' ')) // found
{
inBlock[i] = true;
break;
@@ -98,8 +97,8 @@ namespace Filtration.Parser.Services
{
if (!inDisabledBlock && lines[i].StartsWith("#"))
{
string curLine = Regex.Replace(lines[i].Substring(1), @"\s+", "");
if ((curLine.StartsWith("Show") || curLine.StartsWith("Hide")) && (curLine.Length == 4 || curLine[4] == '#') && !inBlock[i])
string curLine = lines[i].Substring(1).Trim();
if ((curLine.StartsWith("Show") || curLine.StartsWith("Hide")) && (curLine.Length == 4 || curLine[4] == ' ') && !inBlock[i])
{
inDisabledBlock = true;
lines[i] = lines[i].Substring(1).TrimStart(' ');

View File

@@ -40,7 +40,12 @@
<Reference Include="FluentAssertions, Version=5.5.3.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.5.5.3\lib\net45\FluentAssertions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.10.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.10.0\lib\net45\Moq.dll</HintPath>
</Reference>

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Filtration.Common.Services;
using Filtration.Common.Services;
using Filtration.Services;
using Microsoft.WindowsAPICodePack.Dialogs;
using Moq;

View File

@@ -7,4 +7,6 @@
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net461" />
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net461" />
</packages>

View File

@@ -158,6 +158,9 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -186,10 +186,11 @@ namespace Filtration.ThemeEditor.ViewModels
}
#pragma warning disable 1998
public async Task Close()
public async Task<bool> Close()
#pragma warning restore 1998
{
Messenger.Default.Send(new ThemeClosedMessage {ClosedViewModel = this});
return true;
}
private void OnAddThemeComponentCommand(ThemeComponentType themeComponentType)

View File

@@ -9,6 +9,7 @@
xmlns:views="clr-namespace:Filtration.ThemeEditor.Views"
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
xmlns:utilities="clr-namespace:Filtration.Common.Utilities;assembly=Filtration.Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=themeEditor:ThemeComponent}"
d:DesignHeight="100" d:DesignWidth="200">
@@ -64,7 +65,7 @@
<ContentControl.Resources>
<!-- Color Theme Template -->
<DataTemplate DataType="{x:Type themeEditor:ColorThemeComponent}">
<xctk:ColorPicker SelectedColor="{Binding Color}" />
<xctk:ColorPicker SelectedColor="{Binding Color}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" MouseDown="ColorPicker_OnMouseDown" />
</DataTemplate>
<!-- Integer Theme Template -->

View File

@@ -1,4 +1,6 @@
namespace Filtration.ThemeEditor.Views
using System.Windows.Input;
namespace Filtration.ThemeEditor.Views
{
public partial class ThemeComponentControl
{
@@ -6,5 +8,13 @@
{
InitializeComponent();
}
private void ColorPicker_OnMouseDown(object sender, MouseButtonEventArgs e)
{
// For some reason if we don't mark OnMouseDown events as handled for this control
// it ignores them and they end up getting picked up by the parent ListBoxItem instead,
// resulting in the Advanced tab not being clickable.
e.Handled = true;
}
}
}

View File

@@ -29,7 +29,6 @@
</ResourceDictionary>
</UserControl.Resources>
<Grid Margin="10">
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
<ListView ItemsSource="{Binding Source={StaticResource ComponentsViewSource}}"
SelectedItem="{Binding SelectedThemeComponent}"
Margin="5"
@@ -73,6 +72,5 @@
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollViewer>
</Grid>
</UserControl>

View File

@@ -92,7 +92,6 @@ Global
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.Release|x86.ActiveCfg = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.Release|x86.Build.0 = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{E0693972-72C5-4E05-A9C5-A5943E4015C6}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -140,7 +139,6 @@ Global
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.Release|x86.ActiveCfg = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.Release|x86.Build.0 = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{537BE676-2FF6-4995-B05B-9CFACE852EC9}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -188,7 +186,6 @@ Global
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.Release|x86.ActiveCfg = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.Release|x86.Build.0 = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{450AC313-BF25-4BFD-A066-9F39F026FDCF}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -260,7 +257,6 @@ Global
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.Release|x86.ActiveCfg = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.Release|x86.Build.0 = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{1E42A658-45C4-4DD9-83C5-2A10728DBDFA}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -308,7 +304,6 @@ Global
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.Release|x86.ActiveCfg = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.Release|x86.Build.0 = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{58CD3B9C-EBBA-4527-A81C-78B7EA9CA298}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -380,7 +375,6 @@ Global
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.Release|x86.ActiveCfg = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.Release|x86.Build.0 = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU
@@ -428,7 +422,6 @@ Global
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.Release|x86.ActiveCfg = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.Release|x86.Build.0 = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.SquirrelReleasify|Any CPU.ActiveCfg = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.SquirrelReleasify|Any CPU.Build.0 = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.SquirrelReleasify|ARM.ActiveCfg = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.SquirrelReleasify|ARM.Build.0 = Release|Any CPU
{7A5720DE-A41B-47EA-AAAB-7C5608FF0C1F}.SquirrelReleasify|x64.ActiveCfg = Release|Any CPU

View File

@@ -4,9 +4,6 @@
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Filtration.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Filtration.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
@@ -19,18 +16,6 @@
<setting name="ExtraLineBetweenBlocks" serializeAs="String">
<value>True</value>
</setting>
<setting name="SuppressUpdatesUpToVersionMajorPart" serializeAs="String">
<value>0</value>
</setting>
<setting name="SuppressUpdates" serializeAs="String">
<value>False</value>
</setting>
<setting name="SuppressUpdatesUpToVersionMinorPart" serializeAs="String">
<value>0</value>
</setting>
<setting name="StaticDataLastUpdated" serializeAs="String">
<value>2016-01-01</value>
</setting>
<setting name="DownloadPrereleaseUpdates" serializeAs="String">
<value>False</value>
</setting>
@@ -79,17 +64,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<applicationSettings>
<Filtration.Properties.Settings>
<setting name="ItemBaseTypesStaticDataUrl" serializeAs="String">
<value>http://ben-wallis.github.io/Filtration/ItemBaseTypes.txt</value>
</setting>
<setting name="ItemClassesStaticDataUrl" serializeAs="String">
<value>http://ben-wallis.github.io/Filtration/ItemClasses.txt</value>
</setting>
<setting name="UpdateDataUrl" serializeAs="String">
<value>http://ben-wallis.github.io/Filtration/filtration_version.xml</value>
</setting>
</Filtration.Properties.Settings>
</applicationSettings>
</configuration>

View File

@@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media.Imaging;
namespace Filtration.Converters
{
public class DisabledDefaultSoundConverter : IValueConverter
{
private static readonly BitmapImage _soundIcon;
private static readonly BitmapImage _soundDDSIcon;
static DisabledDefaultSoundConverter()
{
var soundUri = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/sound.png", UriKind.Absolute);
var soundDDSUri = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/sound_dds.png", UriKind.Absolute);
_soundIcon = new BitmapImage(soundUri);
_soundDDSIcon = new BitmapImage(soundDDSUri);
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool)value ? _soundDDSIcon : _soundIcon;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return ReferenceEquals(value, _soundDDSIcon);
}
}
}

View File

@@ -0,0 +1,38 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Filtration.Converters
{
class DisabledDefaultSoundTooltipConverter : IMultiValueConverter
{
private static readonly string appendage = "\nNote: the default drop sound is disabled for this block.";
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values[0] == DependencyProperty.UnsetValue ||
values[1] == DependencyProperty.UnsetValue)
{
return string.Empty;
}
var baseText = (string)(values[0]);
var hasDisabledDefaultSound = (bool)(values[1]);
if (hasDisabledDefaultSound)
{
return $"{baseText}{appendage}";
}
else
{
return baseText;
}
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -76,6 +76,9 @@
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
</Reference>
<Reference Include="DynamicData, Version=6.7.0.2529, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DynamicData.6.7.0.2529\lib\net46\DynamicData.dll</HintPath>
</Reference>
<Reference Include="Fluent, Version=6.1.0.326, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Fluent.Ribbon.6.1.0.326\lib\net45\Fluent.dll</HintPath>
</Reference>
@@ -130,6 +133,9 @@
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Reactive, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.4.0.0\lib\net46\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
@@ -138,6 +144,7 @@
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WPFToolkit.3.5.50211.1\lib\System.Windows.Controls.Input.Toolkit.dll</HintPath>
@@ -203,6 +210,8 @@
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
<Compile Include="Converters\DisabledDefaultSoundConverter.cs" />
<Compile Include="Converters\DisabledDefaultSoundTooltipConverter.cs" />
<Compile Include="Converters\MinimapIconToCroppedBitmapConverter.cs" />
<Compile Include="Converters\HashSignRemovalConverter.cs" />
<Compile Include="Converters\ItemRarityConverter.cs" />
@@ -231,12 +240,17 @@
<Compile Include="UserControls\EditableListBoxControl.xaml.cs">
<DependentUpon>EditableListBoxControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\EnableDisableToggleButton.xaml.cs">
<DependentUpon>EnableDisableToggleButton.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\ItemPreviewControl.xaml.cs">
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\ThemeComponentSelectionControl.xaml.cs">
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
<Compile Include="Utility\SplatNLogAdapter.cs" />
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
<Compile Include="Utility\RoutedCommandHandler.cs" />
@@ -267,7 +281,6 @@
</Compile>
<Compile Include="Views\Behaviors\BindableSelectedItemBehavior.cs" />
<Compile Include="Views\BindingProxy.cs" />
<Compile Include="Views\PathOfExileColors.cs" />
<Compile Include="Views\SettingsPageView.xaml.cs">
<DependentUpon>SettingsPageView.xaml</DependentUpon>
</Compile>
@@ -275,6 +288,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\EnableDisableToggleButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\ThemeComponentSelectionControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -446,6 +463,12 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Resources\Enchantments.txt" />
<Resource Include="Resources\Icons\no_sound_dds_light.png" />
<Resource Include="Resources\Icons\no_sound_dds.png" />
<Resource Include="Resources\Icons\speaker_icon.png" />
<Resource Include="Resources\Icons\sound_dds.png" />
<EmbeddedResource Include="Resources\Prophecies.txt" />
<EmbeddedResource Include="Resources\ItemMods.txt" />
<Resource Include="Resources\loading_spinner.gif" />
<EmbeddedResource Include="Properties\Resources.resx">
@@ -489,7 +512,7 @@
<Resource Include="Resources\Icons\open_icon.png" />
<Resource Include="Resources\Icons\arrow_down_large_icon.png" />
<Resource Include="Resources\Icons\arrow_up_large_icon.png" />
<Resource Include="Resources\Icons\speaker_icon.png" />
<Resource Include="Resources\Icons\sound.png" />
<Resource Include="Resources\Icons\play_icon.png" />
<Resource Include="Resources\Icons\arrow_top_icon.png" />
<Resource Include="Resources\Icons\arrow_bottom_icon.png" />

View File

@@ -8,18 +8,17 @@
<authors>Ben Wallis</authors>
<description>A Path of Exile loot filter script editor</description>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright 2018</copyright>
<releaseNotes>* All open filter scripts are now remembered on exit and reopened when the application is started rather than just the last opened one (#95)
* Filter sections are once again now expanded by default when scripts are opened, unless the new "Auto-expand all sections when opening scripts" setting is disabled
* A new Clear Styles button has been added which removes all styles from the selected block (#96)
* Fixed theme saving (blank theme files were being saved) (#83)
* Fixed checkboxes in Block Group Browser (#97)
* Fixed the Select Path of Exile data directory dialog appearing after every upgrade (#94)
* Fixed an issue where custom sounds were only populated from the default Path of Exile data directory rather than the configured directory
* Clean installs no longer prompt to select the Path of Exile data directory if the default directory exists</releaseNotes>
<copyright>Copyright 2019</copyright>
<releaseNotes>* Added support for AnyEnchantment block item type
* Added support for HasEnchantment block item type
* Added support for FracturedItem block item type
* Added support for SynthesisedItem block item type
* Fixed parsing of disabled Show/Hide blocks with extra information following the Show/Hide keyword (#133)
* Fixed copy/pasted block styles not affecting the preview (#126) </releaseNotes>
<dependencies />
</metadata>
<files>
<file src="*.*" target="lib\net45\" exclude="*.pdb;*.nupkg;*.vshost.*;*.xml"/>
<file src="*.*" target="lib\net45\" exclude="*.pdb;*.nupkg;*.vshost.*;*.xml;*.log"/>
<file src="Resources\AlertSounds\*.mp3" target="lib\net45\Resources\AlertSounds\" />
</files>
</package>

View File

@@ -10,15 +10,21 @@
layout="${longdate} ${uppercase:${level}} ${message}" />
<target xsi:type="File" name="fDebug" fileName="${basedir}/Filtration_debug_${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
<target xsi:type="File" name="fUpdater" fileName="${basedir}/Filtration_updater_${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
<target xsi:type="Debugger" name="cDebug" layout="${longdate} ${uppercase:${level}} ${message}"/>
</targets>
<rules>
<!-- Squirrel Updater Log-->
<logger name="SquirrelLogger" minlevel="Trace" writeTo="fUpdater" />
<!-- Uncomment the Debug line to enable Debug logging -->
<!--<logger name="*" minlevel="Debug" writeTo="fDebug" final="true" />-->
<logger name="*" minlevel="Error" writeTo="fErrors" />
<logger name="*" minlevel="Trace" writeTo="cDebug" />
</rules>
</nlog>

View File

@@ -10,8 +10,8 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.0-beta1")]
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyInformationalVersion("1.2.0")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]

View File

@@ -225,19 +225,21 @@ namespace Filtration.Properties {
}
/// <summary>
/// Looks up a localized string similar to A Mother&apos;s Parting Gift
/// Looks up a localized string similar to A Dab of Ink
///A Mother&apos;s Parting Gift
///Abandoned Wealth
///Aberrant Fossil
///Abyssal Axe
///Abyssal Cry
///Abyssal Sceptre
///Academy Map
///Acid Lakes Map
///Acid Caverns Map
///Added Chaos Damage Support
///Added Cold Damage Support
///Added Fire Damage Support
///Added Lightning Damage Support
///Additional Accuracy Support
///Advanced Traps Support
///Aetheric Fossil
///Agate Amulet
///Albino Rhoa Feather
@@ -251,10 +253,7 @@ namespace Filtration.Properties {
///Amber Amulet
///Ambush Boots
///Ambush Leaguestone
///Ambush Mitts
///Ambusher
///Amethyst Flask
///Amethyst [rest of string was truncated]&quot;;.
///Ambush [rest of string was truncated]&quot;;.
/// </summary>
internal static string ItemBaseTypes {
get {
@@ -266,7 +265,7 @@ namespace Filtration.Properties {
/// Looks up a localized string similar to Abyss Jewel
///Active Skill Gems
///Amulets
///Axe
///Axes
///Belts
///Body Armours
///Boots
@@ -288,12 +287,13 @@ namespace Filtration.Properties {
///Labyrinth Map Item
///Labyrinth Trinket
///Large Relics
///Leaguestone
///Leaguestones
///Life Flasks
///Mace
///Maces
///Mana Flasks
///Map Fragments
///Maps
///Medium Relics
///Misc Map Items
///One Hand Axes
///One Hand Maces
@@ -302,14 +302,12 @@ namespace Filtration.Properties {
///Piece
///Quest Items
///Quivers
///Relics
///Rings
///Sceptres
///Shields
///Stackable Currency
///Staves
///Support Skill Gems
///Sword
///T [rest of string was truncated]&quot;;.
///Small Relics
///Stackable Curre [rest of string was truncated]&quot;;.
/// </summary>
internal static string ItemClasses {
get {
@@ -382,6 +380,26 @@ namespace Filtration.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to A Gracious Master.
/// </summary>
internal static string Prophecies {
get {
return ResourceManager.GetString("Prophecies", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enchantment Decree of Force.
/// </summary>
internal static string Enchantments
{
get
{
return ResourceManager.GetString("Enchantments", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>

View File

@@ -211,4 +211,10 @@
<data name="ItemMods" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ItemMods.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="Prophecies" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Prophecies.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="Enchantments" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Enchantments.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View File

@@ -47,81 +47,6 @@ namespace Filtration.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int SuppressUpdatesUpToVersionMajorPart {
get {
return ((int)(this["SuppressUpdatesUpToVersionMajorPart"]));
}
set {
this["SuppressUpdatesUpToVersionMajorPart"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool SuppressUpdates {
get {
return ((bool)(this["SuppressUpdates"]));
}
set {
this["SuppressUpdates"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int SuppressUpdatesUpToVersionMinorPart {
get {
return ((int)(this["SuppressUpdatesUpToVersionMinorPart"]));
}
set {
this["SuppressUpdatesUpToVersionMinorPart"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2016-01-01")]
public global::System.DateTime StaticDataLastUpdated {
get {
return ((global::System.DateTime)(this["StaticDataLastUpdated"]));
}
set {
this["StaticDataLastUpdated"] = value;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://ben-wallis.github.io/Filtration/ItemBaseTypes.txt")]
public string ItemBaseTypesStaticDataUrl {
get {
return ((string)(this["ItemBaseTypesStaticDataUrl"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://ben-wallis.github.io/Filtration/ItemClasses.txt")]
public string ItemClassesStaticDataUrl {
get {
return ((string)(this["ItemClassesStaticDataUrl"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://ben-wallis.github.io/Filtration/filtration_version.xml")]
public string UpdateDataUrl {
get {
return ((string)(this["UpdateDataUrl"]));
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]

View File

@@ -8,27 +8,6 @@
<Setting Name="ExtraLineBetweenBlocks" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="SuppressUpdatesUpToVersionMajorPart" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="SuppressUpdates" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SuppressUpdatesUpToVersionMinorPart" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="StaticDataLastUpdated" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">2016-01-01</Value>
</Setting>
<Setting Name="ItemBaseTypesStaticDataUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://ben-wallis.github.io/Filtration/ItemBaseTypes.txt</Value>
</Setting>
<Setting Name="ItemClassesStaticDataUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://ben-wallis.github.io/Filtration/ItemClasses.txt</Value>
</Setting>
<Setting Name="UpdateDataUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://ben-wallis.github.io/Filtration/filtration_version.xml</Value>
</Setting>
<Setting Name="DownloadPrereleaseUpdates" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -1,11 +1,12 @@
A Mother's Parting Gift
A Dab of Ink
A Mother's Parting Gift
Abandoned Wealth
Aberrant Fossil
Abyssal Axe
Abyssal Cry
Abyssal Sceptre
Academy Map
Acid Lakes Map
Acid Caverns Map
Added Chaos Damage Support
Added Cold Damage Support
Added Fire Damage Support
@@ -21,6 +22,7 @@ Alira's Amulet
Alleyways Map
Allflame
Alloyed Spiked Shield
Alone in the Darkness
Alteration Shard
Amber Amulet
Ambush Boots
@@ -71,9 +73,11 @@ Arctic Breath
Arena Map
Arena Plate
Arid Lake Map
Armageddon Brand
Arming Axe
Armourer's Scrap
Armoury Map
Arrogance of the Vaal
Arsenal Map
Ashen Wood Map
Ashscale Talisman
@@ -94,6 +98,7 @@ Avian Twins Talisman
Awl
Baleful Gem
Ball Lightning
Bane
Bane of the Loyal
Barbed Club
Barbute Helmet
@@ -168,7 +173,9 @@ Bone Crypt Map
Bone Helmet
Bone Offering
Bone Spirit Shield
Bonechill Support
Bonespire Talisman
Boon of Justice
Boon of the First Ones
Boot Blade
Boot Knife
@@ -176,6 +183,7 @@ Bottled Storm
Bound Fossil
Boundless Realms
Bowyer's Dream
Brand Recall
Branded Kite Shield
Brass Maul
Brass Spirit Shield
@@ -352,6 +360,7 @@ Courthouse Map
Courtyard Map
Coves Map
Coveted Possession
Crater Map
Cremation
Crescent Staff
Crested Tower Shield
@@ -384,6 +393,7 @@ Dagger Axe
Damage on Full Life Support
Dark Forest Map
Dark Pact
Dark Temptation
Darkwood Sceptre
Deadhand Talisman
Deadly Ailments Support
@@ -445,6 +455,7 @@ Diamond Ring
Dig Map
Discharge
Discipline
Divine Ire
Divine Life Flask
Divine Mana Flask
Divine Orb
@@ -461,6 +472,7 @@ Dragonscale Boots
Dragonscale Doublet
Dragonscale Gauntlets
Dragoon Sword
Dread Banner
Dread Maul
Dream Mace
Driftwood Club
@@ -504,6 +516,7 @@ Enchanted Fossil
Encrusted Fossil
Endurance Charge on Melee Stun Support
Enduring Cry
Energy Leech Support
Enfeeble
Engineer's Orb
Engineer's Shard
@@ -636,6 +649,7 @@ Full Plate
Full Ringmail
Full Scale Armour
Full Wyrmscale
Fungal Hollow Map
Gardens Map
Gavel
Gemcutter's Prism
@@ -650,13 +664,26 @@ Ghetto Map
Giant Life Flask
Giant Mana Flask
Gift of the Gemling Queen
Gilded Ambush Scarab
Gilded Axe
Gilded Bestiary Scarab
Gilded Breach Scarab
Gilded Buckler
Gilded Cartography Scarab
Gilded Divination Scarab
Gilded Elder Scarab
Gilded Fossil
Gilded Harbinger Scarab
Gilded Perandus Scarab
Gilded Reliquary Scarab
Gilded Sallet
Gilded Shaper Scarab
Gilded Sulphite Scarab
Gilded Torment Scarab
Girded Tower Shield
Glacial Cascade
Glacial Hammer
Glacier Map
Gladiator Helmet
Gladiator Plate
Gladius
@@ -689,7 +716,6 @@ Golden Plate
Golden Wreath
Goliath Gauntlets
Goliath Greaves
Gorge Map
Gouger
Grace
Graceful Sword
@@ -801,7 +827,9 @@ Infernal Axe
Infernal Blow
Infernal Sword
Infested Valley Map
Infused Channelling Support
Innervate Support
Intensify Support
Invasion Leaguestone
Inya's Key
Iron Circlet
@@ -859,6 +887,7 @@ Lacquered Helmet
Lair Map
Lair of the Hydra Map
Laminated Kite Shield
Lancing Steel
Lantador's Lost Love
Lapis Amulet
Large Hybrid Flask
@@ -867,7 +896,7 @@ Large Mana Flask
Last Hope
Lathi
Latticed Ringmail
Lava Chamber Map
Lava Chambers Map
Lava Lake Map
Layered Kite Shield
Lead Sceptre
@@ -888,9 +917,9 @@ Lesser Poison Support
Leyline Map
Life Gain on Hit Support
Life Leech Support
Light and Truth
Light Brigandine
Light Quiver
Light and Truth
Lighthouse Map
Lightning Arrow
Lightning Penetration Support
@@ -929,6 +958,7 @@ Majestic Plate
Malachai's Entrails
Malachai's Heart
Malachai's Lungs
Malevolence
Malformation Map
Maligaro's Map
Maligaro's Spike
@@ -975,20 +1005,21 @@ Military Staff
Mind Cage
Minefield Support
Mineral Pools Map
Minion and Totem Elemental Resistance Support
Minion Damage Support
Minion Life Support
Minion Speed Support
Minion and Totem Elemental Resistance Support
Mirage Archer Support
Mirror Arrow
Mirror Shard
Mirror of Kalandra
Mirror Shard
Mirrored Spiked Shield
Mitts
Molten Shell
Molten Strike
Monkey Paw Talisman
Monkey Twins Talisman
Monochrome
Moon Orb
Moon Staff
Moon Temple Map
@@ -1000,6 +1031,7 @@ Mortal Ignorance
Mortal Rage
Mosaic Kite Shield
Mud Geyser Map
Multiple Totems Support
Multiple Traps Support
Multistrike Support
Murder Boots
@@ -1110,7 +1142,19 @@ Poignard
Point Blank Support
Poison Support
Poleaxe
Polished Ambush Scarab
Polished Bestiary Scarab
Polished Breach Scarab
Polished Cartography Scarab
Polished Divination Scarab
Polished Elder Scarab
Polished Harbinger Scarab
Polished Perandus Scarab
Polished Reliquary Scarab
Polished Shaper Scarab
Polished Spiked Shield
Polished Sulphite Scarab
Polished Torment Scarab
Port Map
Portal
Portal Scroll
@@ -1132,6 +1176,7 @@ Primeval Rapier
Primitive Alchemical Resonator
Primitive Chaotic Resonator
Primitive Staff
Primordial Blocks Map
Primordial Pool Map
Primordial Staff
Prismatic Fossil
@@ -1149,6 +1194,7 @@ Prophet Crown
Prosperity
Puncture
Punishment
Purifying Flame
Purity of Elements
Purity of Fire
Purity of Ice
@@ -1160,9 +1206,9 @@ Quartz Wand
Quicksilver Flask
Quilted Jacket
Racecourse Map
Rain Tempter
Rain of Arrows
Rain of Chaos
Rain Tempter
Raise Spectre
Raise Zombie
Rallying Cry
@@ -1226,10 +1272,22 @@ Ruby Flask
Ruby Ring
Rugged Quiver
Runic Hatchet
Rusted Ambush Scarab
Rusted Bestiary Scarab
Rusted Breach Scarab
Rusted Cartography Scarab
Rusted Coif
Rusted Divination Scarab
Rusted Elder Scarab
Rusted Harbinger Scarab
Rusted Hatchet
Rusted Perandus Scarab
Rusted Reliquary Scarab
Rusted Shaper Scarab
Rusted Spike
Rusted Sulphite Scarab
Rusted Sword
Rusted Torment Scarab
Rustic Sash
Ruthless Support
Sabre
@@ -1249,6 +1307,7 @@ Saint's Hauberk
Saintly Chainmail
Sallet
Sambar Sceptre
Sambodhi's Vow
Samite Gloves
Samite Helmet
Samite Slippers
@@ -1311,6 +1370,7 @@ Serpentscale Gauntlets
Serrated Arrow Quiver
Serrated Foil
Serrated Fossil
Seven Years Bad Luck
Shabby Jerkin
Shackled Boots
Shadow Axe
@@ -1335,6 +1395,7 @@ Sharkskin Gloves
Sharkskin Tunic
Sharktooth Arrow Quiver
Sharktooth Claw
Shattering Steel
Shield Charge
Shipyard Map
Shock Nova
@@ -1410,6 +1471,7 @@ Soldier Helmet
Soldier's Brigandine
Sorcerer Boots
Sorcerer Gloves
Soulrend
Sovereign Spiked Shield
Spark
Sparkling Claw
@@ -1445,7 +1507,6 @@ Splinter of Xoph
Splintered Tower Shield
Split Arrow
Splitnewt Talisman
Springs Map
Stacked Deck
Stag Sceptre
Static Strike
@@ -1467,6 +1528,7 @@ Stone Hammer
Stone of Passage
Storm Barrier Support
Storm Blade
Storm Brand
Storm Burst
Storm Call
Strand Map
@@ -1581,6 +1643,7 @@ The Garish Power
The Gemcutter
The Gentleman
The Gladiator
The Golden Era
The Hale Heart
The Harvester
The Hermit
@@ -1595,18 +1658,26 @@ The Inventor
The Iron Bard
The Jester
The Jeweller's Boon
The Journey
The King's Blade
The King's Heart
The Landing
The Last One Standing
The Lich
The Life Thief
The Lion
The Lord in Black
The Lord of Celebration
The Lover
The Lunaris Priestess
The Mad King
The Master
The Master Artisan
The Mayor
The Mercenary
The Messenger
The Metalsmith's Gift
The Nurse
The Oath
The Obscured
The Offering
@@ -1628,11 +1699,13 @@ The Risk
The Rite of Elements
The Road to Power
The Ruthless Ceinture
The Sacrifice
The Saint's Treasure
The Samurai's Eye
The Scarred Meadow
The Scavenger
The Scholar
The Seeker
The Sephirot
The Shaper's Key
The Shaper's Realm
@@ -1711,7 +1784,6 @@ Torment Leaguestone
Tornado Shot
Tornado Wand
Torture Cage
Torture Chamber Map
Totemic Maul
Tower Key
Tower Map
@@ -1719,8 +1791,8 @@ Toxic Rain
Toxic Sewer Map
Tranquillity
Transmutation Shard
Trap Support
Trap and Mine Damage Support
Trap Support
Trapper Boots
Trapper Mitts
Trarthan Powder
@@ -1729,7 +1801,6 @@ Treasure Key
Tribal Circlet
Tribal Club
Tribal Maul
Tribunal Map
Tricorne
Trisula
Triumphant Lamellar
@@ -1751,6 +1822,7 @@ Underground River Map
Underground Sea Map
Undying Flesh Talisman
Unearth
Unleash Support
Unset Ring
Unshaping Orb
Ursine Pelt
@@ -1815,16 +1887,16 @@ Vault Map
Velvet Gloves
Velvet Slippers
Vengeance
Vial Of Power
Vial of Awakening
Vial of Consequence
Vial of Dominance
Vial of Fate
Vial Of Power
Vial of Sacrifice
Vial of Summoning
Vial of Transcendence
Vial of the Ghost
Vial of the Ritual
Vial of Transcendence
Vicious Projectiles Support
Vigilant Strike
Vile Staff
@@ -1865,6 +1937,7 @@ Wailing Essence of Wrath
Wailing Essence of Zeal
Walnut Spirit Shield
War Axe
War Banner
War Buckler
War Hammer
War Plate
@@ -1874,6 +1947,7 @@ Warlord's Mark
Waste Pool Map
Wasteland Map
Waterways Map
Wave of Conviction
Waxed Garb
Wealth and Power
Weeping Essence
@@ -1902,6 +1976,7 @@ Widowsilk Robe
Wild Leather
Wild Strike
Wings of Vastiri
Winter Orb
Wither
Withering Touch Support
Wolf Pelt
@@ -1927,4 +2002,5 @@ Yriel's Key
Zealot Boots
Zealot Gloves
Zealot Helmet
Zealotry
Zodiac Leather

View File

@@ -23,12 +23,13 @@ Labyrinth Item
Labyrinth Map Item
Labyrinth Trinket
Large Relics
Leaguestone
Leaguestones
Life Flasks
Maces
Mana Flasks
Map Fragments
Maps
Medium Relics
Misc Map Items
One Hand Axes
One Hand Maces
@@ -37,9 +38,11 @@ Pantheon Soul
Piece
Quest Items
Quivers
Relics
Rings
Sceptres
Shields
Small Relics
Stackable Currency
Staves
Support Skill Gems

View File

@@ -61,6 +61,7 @@ Carved
Caster's
Catalysed
Catalyzing
Catarina's Veiled
Caustic
Cauterising
Cautious
@@ -115,6 +116,7 @@ Duelist's
Eldritch
Electrocuting
Electromantic
Elreon's Veiled
Elephant's
Emanant
Emperor's
@@ -172,9 +174,12 @@ Glinting
Glittering
Glowing
Glyphic
Gravicius' Veiled
Gremlin's
Grounded
Guatelitzi's
Guff's Veiled
Haku's Veiled
Hailing
Hale
Halting
@@ -218,16 +223,19 @@ Instilled
Interpermeated
Interpolated
Ionising
It That Fled's Veiled
Jagged
Jinxing
Journeyman's
Judging
Korell's Veiled
Lacquered
Lamprey's
Lava Caller's
Layered
Leadership
Legend's
Leo's Veiled
Lethal
Lich's
Lively
@@ -306,6 +314,7 @@ Resonating
Resplendent
Rhino's
Ribbed
Rin's Veiled
Ripping
Robust
Rotund
@@ -384,6 +393,7 @@ Thundering
Thwarting
Titan's
Topotante's
Tora's Veiled
Trapping
Tul's
Turncoat's
@@ -399,8 +409,10 @@ Unwavering
Unworldly
Urchin's
Vaal
Vagan's Veiled
Vampire's
Vaporous
Veiled
Vicious
Victor's
Vigorous
@@ -410,6 +422,7 @@ Vivacious
Vivid
Volcanic
Volleying
Vorici's Veiled
Wailing
Warding
Warlock's
@@ -436,6 +449,7 @@ of Accuracy
of Adamantite Skin
of Adaption
of Adrenaline
of Aisling's Veil
of Amassment
of Anger
of Animation
@@ -459,6 +473,7 @@ of Bloodlines
of Burning
of Calamity
of Calm
of Cameria's Veil
of Celebration
of Champions
of Chilling
@@ -547,6 +562,7 @@ of Havoc
of Haze
of Heat
of Hemomancy
of Hillock's Veil
of Hindering
of Hoarding
of Hordes
@@ -563,6 +579,8 @@ of Intelligence
of Intercepting
of Ire
of Iron Skin
of Janus' Veil
of Jorgin's Veil
of Joy
of Legerdemain
of Light
@@ -621,6 +639,7 @@ of Resistance
of Restoration
of Retaliation
of Righteousness
of Riker's Veil
of Rime
of Ruin
of Runes
@@ -774,6 +793,7 @@ of the Titan
of the Troll
of the Underground
of the Universe
of the Veil
of the Virtuoso
of the Volcano
of the Wall

View File

@@ -0,0 +1,241 @@
A Call into the Void
A Dishonourable Death
A Firm Foothold
A Forest of False Idols
A Gracious Master
A Master Seeks Help
A Prodigious Hand
A Regal Death
A Rift in Time
A Valuable Combination
A Vision of Ice and Fire
A Whispered Prayer
Abnormal Effulgence
Against the Tide
Agony at Dusk
An Unseen Peril
Anarchy's End
Anarchy's End I
Anarchy's End II
Anarchy's End III
Anarchy's End IV
Ancient Doom
Baptism by Death
Battle Hardened
Beyond Sight
Beyond Sight I
Beyond Sight II
Beyond Sight III
Beyond Sight IV
Black Devotion
Blind Faith
Blinding Light
Blood in the Eyes
Blood of the Betrayed
Bountiful Traps
Burning Dread
Cleanser of Sins
Cold Blooded Fury
Cold Greed
Crimson Hues
Crushing Squall
Custodians of Silence
Dance of Steel
Dark Instincts
Darktongue's Shriek
Day of Sacrifice
Day of Sacrifice I
Day of Sacrifice II
Day of Sacrifice III
Day of Sacrifice IV
Deadly Rivalry
Deadly Rivalry I
Deadly Rivalry II
Deadly Rivalry III
Deadly Rivalry IV
Deadly Rivalry V
Deadly Twins
Defiled in the Sceptre
Dying Cry
Echoes of Witchcraft
End of the Light
Ending the Torment
Erased from Memory
Erasmus' Gift
Faith Exhumed
Fallow At Last
Fated Connections
Fear's Wide Reach
Fire and Brimstone
Fire and Ice
Fire from the Sky
Fire, Wood and Stone
Flesh of the Beast
Forceful Exorcism
From Death Springs Life
From The Void
Gilded Within
Golden Touch
Graceful Flames
Greed's Folly
Heart of the Fire
Heavy Blows
Hidden Reinforcements
Hidden Vaal Pathways
Holding the Bridge
Hunter's Lesson
Ice from Above
In the Grasp of Corruption
Kalandra's Craft
Last of the Wildmen
Lasting Impressions
Lightning Falls
Living Fires
Lost in the Pages
Monstrous Treasure
Mouth of Horrors
Mysterious Invaders
Nature's Resilience
Nemesis of Greed
Notched Flesh
Overflowing Riches
Path of Betrayal
Plague of Frogs
Plague of Rats
Pleasure and Pain
Pools of Wealth
Possessed Foe
Power Magnified
Rebirth
Reforged Bonds
Resistant to Change
Risen Blood
Roth's Legacy
Severed Limbs
Smothering Tendrils
Soil, Worms and Blood
Song of the Sekhema
Storm on the Horizon
Storm on the Reef
Strong as a Bull
Sun's Punishment
Thaumaturgical History
Thaumaturgical History I
Thaumaturgical History II
Thaumaturgical History III
Thaumaturgical History IV
The Alchemist
The Ambitious Bandit
The Ambitious Bandit I
The Ambitious Bandit II
The Ambitious Bandit III
The Apex Predator
The Beautiful Guide
The Beginning and the End
The Bishop's Legacy
The Bloody Flowers Redux
The Bowstring's Music
The Brothers of Necromancy
The Brutal Enforcer
The Child of Lunaris
The Corrupt
The Cursed Choir
The Dreaded Rhoa
The Dream Trial
The Dreamer's Dream
The Eagle's Cry
The Fall of an Empire
The Feral Lord
The Feral Lord I
The Feral Lord II
The Feral Lord III
The Feral Lord IV
The Feral Lord V
The Flayed Man
The Flow of Energy
The Forgotten Garrison
The Forgotten Soldiers
The Fortune Teller's Collection
The Four Feral Exiles
The God of Misfortune
The Great Leader of the North
The Great Mind of the North
The Hardened Armour
The Hollow Pledge
The Hungering Swarm
The Invader
The Jeweller's Touch
The Karui Rebellion
The King and the Brambles
The King's Path
The Lady in Black
The Last Watch
The Lost Maps
The Lost Undying
The Malevolent Witch
The Misunderstood Queen
The Mysterious Gift
The Nest
The Nightmare Awakens
The Petrified
The Plaguemaw
The Plaguemaw I
The Plaguemaw II
The Plaguemaw III
The Plaguemaw IV
The Plaguemaw V
The Prison Guard
The Prison Key
The Queen's Sacrifice
The Queen's Vaults
The Scout
The Servant's Heart
The Sharpened Blade
The Silverwood
The Singular Spirit
The Sinner's Stone
The Snuffed Flame
The Soulless Beast
The Stockkeeper
The Storm Spire
The Sword King's Passion
The Trembling Earth
The Twins
The Unbreathing Queen
The Unbreathing Queen I
The Unbreathing Queen II
The Unbreathing Queen III
The Unbreathing Queen IV
The Unbreathing Queen V
The Undead Brutes
The Undead Storm
The Vanguard
The Walking Mountain
The Ward's Ward
The Warmongers
The Warmongers I
The Warmongers II
The Warmongers III
The Warmongers IV
The Watcher's Watcher
The Wealthy Exile
Touched by the Wind
Trapped in the Tower
Trash to Treasure
Twice Enchanted
Unbearable Whispers
Unbearable Whispers I
Unbearable Whispers II
Unbearable Whispers III
Unbearable Whispers IV
Unbearable Whispers V
Undead Uprising
Unnatural Energy
Vaal Invasion
Vaal Winds
Visions of the Drowned
Vital Transformation
Waiting in Ambush
Weeping Death
Wind and Thunder
Winter's Mournful Melodies

View File

@@ -25,6 +25,8 @@ namespace Filtration.Services
{
_fileSystemService = fileSystemService;
_itemFilterScriptTranslator = itemFilterScriptTranslator;
ItemFilterScriptDirectory = Settings.Default.DefaultFilterDirectory;
}
public string ItemFilterScriptDirectory { get; private set; }
@@ -47,6 +49,7 @@ namespace Filtration.Services
ItemFilterScriptDirectory = path;
Settings.Default.DefaultFilterDirectory = path;
Settings.Default.Save();
}
public async Task<IItemFilterScript> LoadItemFilterScriptAsync(string filePath)

View File

@@ -11,6 +11,8 @@ namespace Filtration.Services
IEnumerable<string> ItemBaseTypes { get; }
IEnumerable<string> ItemClasses { get; }
IEnumerable<string> ItemMods { get; }
IEnumerable<string> Prophecies { get; }
IEnumerable<string> Enchantments { get; }
}
internal class StaticDataService : IStaticDataService
@@ -26,11 +28,17 @@ namespace Filtration.Services
public IEnumerable<string> ItemMods { get; private set; }
public IEnumerable<string> Prophecies { get; private set; }
public IEnumerable<string> Enchantments { get; private set; }
private void PopulateStaticData()
{
ItemBaseTypes = new LineReader(() => new StringReader(Resources.ItemBaseTypes)).ToList();
ItemClasses = new LineReader(() => new StringReader(Resources.ItemClasses)).ToList();
ItemMods = new LineReader(() => new StringReader(Resources.ItemMods)).ToList();
Prophecies = new LineReader(() => new StringReader(Resources.Prophecies)).ToList();
Enchantments = new LineReader(() => new StringReader(Resources.Enchantments)).ToList();
}
}
}

View File

@@ -1,9 +1,12 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Filtration.Enums;
using Filtration.Properties;
using Filtration.Utility;
using NLog;
using Squirrel;
@@ -76,11 +79,14 @@ namespace Filtration.Services
private bool _downloadPrereleaseUpdates;
private UpdateStatus _updateStatus;
public UpdateService(ISettingsService settingsService)
public UpdateService(ISettingsService settingsService,
ISplatNLogAdapter splatNLogAdapter)
{
_settingsService = settingsService;
UpdateStatus = UpdateStatus.NoUpdateAvailable;
Splat.Locator.CurrentMutable.Register(() => splatNLogAdapter, typeof(Splat.ILogger));
}
public event EventHandler<UpdateStatusChangedEventArgs> UpdateStatusChanged;
@@ -117,6 +123,17 @@ namespace Filtration.Services
_downloadPrereleaseUpdates = true;
#endif
var expectedInstallationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Filtration");
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
var runningInstalled = baseDirectory.StartsWith(expectedInstallationPath);
if (!runningInstalled)
{
Logger.Debug($"Skipping update check since base directory of {baseDirectory} does not start with the expected installation path of {expectedInstallationPath}");
return;
}
async Task CheckForUpdatesAsync(IUpdateManager updateManager)
{
_updates = await updateManager.CheckForUpdate(progress: progress => UpdateProgressChanged?.Invoke(this, new UpdateProgressChangedEventArgs(progress)));

View File

@@ -11,6 +11,7 @@
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:views="clr-namespace:Filtration.Views"
xmlns:utilities="clr-namespace:Filtration.Common.Utilities;assembly=Filtration.Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}"
d:DesignHeight="200" d:DesignWidth="190">
@@ -76,11 +77,21 @@
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" AutoCompleteItemsSource="{Binding ElementName=TopLevelGrid, Path=DataContext.AutoCompleteItemBaseTypes}" />
</DataTemplate>
<!-- Prophecy Template -->
<DataTemplate DataType="{x:Type blockItemTypes:ProphecyBlockItem}">
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" AutoCompleteItemsSource="{Binding ElementName=TopLevelGrid, Path=DataContext.AutoCompleteProphecies}" />
</DataTemplate>
<!-- Explicit Mods Template -->
<DataTemplate DataType="{x:Type blockItemTypes:HasExplicitModBlockItem}">
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" AutoCompleteItemsSource="{Binding ElementName=TopLevelGrid, Path=DataContext.AutocompleteItemMods}" />
</DataTemplate>
<!-- Enchantments Template -->
<DataTemplate DataType="{x:Type blockItemTypes:HasEnchantmentBlockItem}">
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" AutoCompleteItemsSource="{Binding ElementName=TopLevelGrid, Path=DataContext.AutocompleteEnchantments}" />
</DataTemplate>
<!-- Socket Groups Template -->
<DataTemplate DataType="{x:Type blockItemTypes:SocketGroupBlockItem}">
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" />
@@ -112,7 +123,7 @@
<!-- Color Template -->
<DataTemplate DataType="{x:Type blockItemBaseTypes:ColorBlockItem}">
<StackPanel>
<xctk:ColorPicker SelectedColor="{Binding Color}" AvailableColors="{Binding ElementName=BlockItemContentControl, Path=DataContext.AvailableColors }" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors"/>
<xctk:ColorPicker SelectedColor="{Binding Color}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors"/>
<userControls:ThemeComponentSelectionControl ThemeComponent="{Binding ThemeComponent}"
Margin="0,2,0,2">
@@ -241,6 +252,13 @@
</userControls:ThemeComponentSelectionControl>
</Grid>
</DataTemplate>
<!-- Disable Drop Sound Template -->
<DataTemplate DataType="{x:Type blockItemBaseTypes:NilBlockItem}">
<Grid>
<TextBlock Text="{Binding Description}" VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
</Grid>

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
@@ -8,9 +7,7 @@ using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.ThemeEditor;
using Filtration.Views;
using GalaSoft.MvvmLight.CommandWpf;
using Xceed.Wpf.Toolkit;
namespace Filtration.UserControls
{
@@ -81,9 +78,6 @@ namespace Filtration.UserControls
}
}
public ObservableCollection<ColorItem> AvailableColors => PathOfExileColors.DefaultColors;
public List<string> SoundsAvailable => new List<string> {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
"ShGeneral", "ShBlessed", "ShChaos", "ShDivine", "ShExalted", "ShMirror", "ShAlchemy",

View File

@@ -0,0 +1,30 @@
<UserControl x:Class="Filtration.UserControls.EnableDisableToggleButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<ToggleButton Style="{StaticResource ChromelessToggleButton}"
IsChecked="{Binding BlockEnabled}"
Margin="0,0,5,0"
ToolTip="Enable/Disable Block"
Cursor="Hand"
Width="25"
Height="25">
<Image RenderOptions.BitmapScalingMode="HighQuality">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger Binding="{Binding BlockEnabled}" Value="true">
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_enabled_icon.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding BlockEnabled}" Value="false">
<Setter Property="Source" Value="/Filtration;component/Resources/Icons/standby_disabled_icon.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</ToggleButton>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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;
namespace Filtration.UserControls
{
/// <summary>
/// Interaction logic for EnableDisableToggleButton.xaml
/// </summary>
public partial class EnableDisableToggleButton : UserControl
{
public EnableDisableToggleButton()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,52 @@
using System;
using NLog;
using ILogger = Splat.ILogger;
using LogLevel = Splat.LogLevel;
namespace Filtration.Utility
{
public interface ISplatNLogAdapter
{
}
public class SplatNLogAdapter : ILogger, ISplatNLogAdapter
{
private static readonly Logger Logger = LogManager.GetLogger("SquirrelLogger");
public void Write(string message, LogLevel logLevel)
{
switch (logLevel)
{
case LogLevel.Debug:
{
Logger.Debug(message);
break;
}
case LogLevel.Info:
{
Logger.Info(message);
break;
}
case LogLevel.Error:
{
Logger.Error(message);
break;
}
case LogLevel.Fatal:
{
Logger.Fatal(message);
break;
}
case LogLevel.Warn:
{
Logger.Warn(message);
break;
}
default:
throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);
}
}
public LogLevel Level { get; set; }
}
}

View File

@@ -0,0 +1,164 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemTypes;
using Filtration.ObjectModel.Commands;
using Filtration.ObjectModel.Enums;
using GalaSoft.MvvmLight.CommandWpf;
using Xceed.Wpf.Toolkit;
namespace Filtration.ViewModels.DesignTime
{
internal class FakeCommandManager : ICommandManagerInternal {
public void ExecuteCommand(ICommand command)
{
throw new NotImplementedException();
}
public void Undo(int undoLevels = 1)
{
throw new NotImplementedException();
}
public void Redo(int redoLevels = 1)
{
throw new NotImplementedException();
}
public void SetScript(IItemFilterScriptInternal layout)
{
}
}
internal class DesignTimeItemFilterBlockViewModel : IItemFilterBlockViewModel
{
private ItemFilterBlock itemFilterBlock;
public DesignTimeItemFilterBlockViewModel()
{
itemFilterBlock = new ItemFilterBlock(new ItemFilterScript(new FakeCommandManager()))
{
Action = BlockAction.Show,
Enabled = true
};
itemFilterBlock.BlockItems.Add(new RarityBlockItem(FilterPredicateOperator.Equal, ItemRarity.Rare));
itemFilterBlock.BlockItems.Add(new DropLevelBlockItem(FilterPredicateOperator.GreaterThan, 23));
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
itemFilterBlock.BlockItems.Add(new BaseTypeBlockItem());
}
public void Initialise(IItemFilterBlockBase itemFilterBlock, IItemFilterScriptViewModel itemFilterScriptViewModel)
{
//throw new NotImplementedException();
}
public IItemFilterBlockBase BaseBlock { get; }
public bool IsDirty { get; set; }
public bool IsVisible { get; set; }
public event EventHandler BlockBecameDirty;
public bool IsExpanded
{
get => true;
set { }
}
public IItemFilterBlock Block => itemFilterBlock;
public bool BlockEnabled
{
get => true;
set { }
}
public string BlockDescription { get; set; }
public RelayCommand CopyBlockStyleCommand { get; }
public RelayCommand PasteBlockStyleCommand { get; }
public RelayCommand ToggleBlockActionCommand { get; }
public RelayCommand ReplaceColorsCommand { get; }
public RelayCommand<Type> AddFilterBlockItemCommand { get; }
public RelayCommand<IItemFilterBlockItem> RemoveFilterBlockItemCommand { get; }
public RelayCommand PlaySoundCommand { get; }
public RelayCommand PlayPositionalSoundCommand { get; }
public RelayCommand SwitchBlockItemsViewCommand { get; }
public RelayCommand CustomSoundFileDialogCommand { get; }
public RelayCommand PlayCustomSoundCommand { get; }
public RelayCommand AddBlockGroupCommand { get; }
public RelayCommand DeleteBlockGroupCommand { get; }
public ObservableCollection<ItemFilterBlockGroup> BlockGroups { get; }
public ObservableCollection<string> BlockGroupSuggestions { get; }
public string BlockGroupSearch { get; set; }
public ObservableCollection<IItemFilterBlockItem> BlockItems => Block.BlockItems;
public IEnumerable<IItemFilterBlockItem> SummaryBlockItems
{
get { return Block.BlockItems.Where(b => !(b is IAudioVisualBlockItem)); }
}
public IEnumerable<IItemFilterBlockItem> RegularBlockItems
{
get { return Block.BlockItems.Where(b => !(b is IAudioVisualBlockItem)); }
}
public IEnumerable<IItemFilterBlockItem> AudioVisualBlockItems { get; }
public bool AdvancedBlockGroup { get; }
public bool AudioVisualBlockItemsGridVisible { get; set; }
public bool DisplaySettingsPopupOpen { get; set; }
public IEnumerable<string> AutoCompleteItemClasses { get; }
public IEnumerable<string> AutoCompleteItemBaseTypes { get; }
public IEnumerable<string> AutoCompleteProphecies { get; }
public IEnumerable<string> AutocompleteItemMods { get; }
public List<Type> BlockItemTypesAvailable => new List<Type>
{
typeof (ItemLevelBlockItem),
typeof (DropLevelBlockItem),
typeof (QualityBlockItem),
typeof (RarityBlockItem),
typeof (SocketsBlockItem),
typeof (LinkedSocketsBlockItem),
typeof (WidthBlockItem),
typeof (HeightBlockItem),
typeof (SocketGroupBlockItem),
typeof (ClassBlockItem),
typeof (BaseTypeBlockItem),
typeof (ProphecyBlockItem),
typeof (IdentifiedBlockItem),
typeof (CorruptedBlockItem),
typeof (ElderItemBlockItem),
typeof (ShaperItemBlockItem),
typeof (SynthesisedItemBlockItem),
typeof (FracturedItemBlockItem),
typeof (AnyEnchantmentBlockItem),
typeof (MapTierBlockItem),
typeof (ShapedMapBlockItem),
typeof (ElderMapBlockItem),
typeof (GemLevelBlockItem),
typeof (StackSizeBlockItem),
typeof (HasExplicitModBlockItem),
typeof (HasEnchantmentBlockItem)
};
public List<Type> AudioVisualBlockItemTypesAvailable { get; }
public Color DisplayTextColor => Colors.Red;
public Color DisplayBackgroundColor => Colors.White;
public Color DisplayBorderColor => Colors.GreenYellow;
public double DisplayFontSize => 20;
public int DisplayIconSize { get; }
public int DisplayIconColor { get; }
public int DisplayIconShape { get; }
public Color DisplayEffectColor { get; }
public bool HasSound { get; }
public bool HasPositionalSound { get; }
public bool HasCustomSound { get; }
public bool HasDisabledDefaultSound { get; }
public bool HasAudioVisualBlockItems { get; }
public void RefreshBlockPreview()
{
throw new NotImplementedException();
}
}
}

View File

@@ -39,7 +39,7 @@ namespace Filtration.ViewModels.DesignTime
public bool IsScript { get; }
public bool IsTheme { get; }
public Task Close()
public Task<bool> Close()
{
throw new System.NotImplementedException();
}

View File

@@ -25,6 +25,48 @@ namespace Filtration.ViewModels
IItemFilterBlock Block { get; }
bool BlockEnabled { get; set; }
string BlockDescription { get; set; }
RelayCommand CopyBlockStyleCommand { get; }
RelayCommand PasteBlockStyleCommand { get; }
RelayCommand ToggleBlockActionCommand { get; }
RelayCommand ReplaceColorsCommand { get; }
RelayCommand<Type> AddFilterBlockItemCommand { get; }
RelayCommand<IItemFilterBlockItem> RemoveFilterBlockItemCommand { get; }
RelayCommand PlaySoundCommand { get; }
RelayCommand PlayPositionalSoundCommand { get; }
RelayCommand SwitchBlockItemsViewCommand { get; }
RelayCommand CustomSoundFileDialogCommand { get; }
RelayCommand PlayCustomSoundCommand { get; }
RelayCommand AddBlockGroupCommand { get; }
RelayCommand DeleteBlockGroupCommand { get; }
ObservableCollection<ItemFilterBlockGroup> BlockGroups { get; }
ObservableCollection<string> BlockGroupSuggestions { get; }
string BlockGroupSearch { get; set; }
ObservableCollection<IItemFilterBlockItem> BlockItems { get; }
IEnumerable<IItemFilterBlockItem> SummaryBlockItems { get; }
IEnumerable<IItemFilterBlockItem> RegularBlockItems { get; }
IEnumerable<IItemFilterBlockItem> AudioVisualBlockItems { get; }
bool AdvancedBlockGroup { get; }
bool AudioVisualBlockItemsGridVisible { get; set; }
bool DisplaySettingsPopupOpen { get; set; }
IEnumerable<string> AutoCompleteItemClasses { get; }
IEnumerable<string> AutoCompleteItemBaseTypes { get; }
IEnumerable<string> AutoCompleteProphecies { get; }
IEnumerable<string> AutocompleteItemMods { get; }
List<Type> BlockItemTypesAvailable { get; }
List<Type> AudioVisualBlockItemTypesAvailable { get; }
Color DisplayTextColor { get; }
Color DisplayBackgroundColor { get; }
Color DisplayBorderColor { get; }
double DisplayFontSize { get; }
int DisplayIconSize { get; }
int DisplayIconColor { get; }
int DisplayIconShape { get; }
Color DisplayEffectColor { get; }
bool HasSound { get; }
bool HasPositionalSound { get; }
bool HasCustomSound { get; }
bool HasDisabledDefaultSound { get; }
bool HasAudioVisualBlockItems { get; }
void RefreshBlockPreview();
}
@@ -162,8 +204,12 @@ namespace Filtration.ViewModels
public IEnumerable<string> AutoCompleteItemBaseTypes => _staticDataService.ItemBaseTypes;
public IEnumerable<string> AutoCompleteProphecies => _staticDataService.Prophecies;
public IEnumerable<string> AutocompleteItemMods => _staticDataService.ItemMods;
public IEnumerable<string> AutocompleteEnchantments => _staticDataService.Enchantments;
public List<Type> BlockItemTypesAvailable => new List<Type>
{
typeof (ItemLevelBlockItem),
@@ -177,16 +223,21 @@ namespace Filtration.ViewModels
typeof (SocketGroupBlockItem),
typeof (ClassBlockItem),
typeof (BaseTypeBlockItem),
typeof (ProphecyBlockItem),
typeof (IdentifiedBlockItem),
typeof (CorruptedBlockItem),
typeof (ElderItemBlockItem),
typeof (ShaperItemBlockItem),
typeof (SynthesisedItemBlockItem),
typeof (FracturedItemBlockItem),
typeof (AnyEnchantmentBlockItem),
typeof (MapTierBlockItem),
typeof (ShapedMapBlockItem),
typeof (ElderMapBlockItem),
typeof (GemLevelBlockItem),
typeof (StackSizeBlockItem),
typeof (HasExplicitModBlockItem)
typeof (HasExplicitModBlockItem),
typeof (HasEnchantmentBlockItem)
};
public List<Type> AudioVisualBlockItemTypesAvailable => new List<Type>
@@ -231,8 +282,6 @@ namespace Filtration.ViewModels
}
}
public ObservableCollection<ColorItem> AvailableColors => PathOfExileColors.DefaultColors;
public Color DisplayTextColor => Block.DisplayTextColor;
public Color DisplayBackgroundColor => Block.DisplayBackgroundColor;
public Color DisplayBorderColor => Block.DisplayBorderColor;
@@ -245,6 +294,7 @@ namespace Filtration.ViewModels
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
public bool HasCustomSound => Block.HasBlockItemOfType<CustomSoundBlockItem>();
public bool HasDisabledDefaultSound => Block.HasBlockItemOfType<DisableDropSoundBlockItem>();
public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any();
@@ -307,6 +357,10 @@ namespace Filtration.ViewModels
private void OnPasteBlockStyleCommand()
{
_parentScriptViewModel.PasteBlockStyle(this);
foreach (var blockItem in Block.BlockItems.OfType<IAudioVisualBlockItem>())
{
blockItem.PropertyChanged += OnBlockItemChanged;
}
}
private void OnAddBlockCommand()
@@ -484,6 +538,7 @@ namespace Filtration.ViewModels
RaisePropertyChanged(nameof(HasSound));
RaisePropertyChanged(nameof(HasPositionalSound));
RaisePropertyChanged(nameof(HasCustomSound));
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
}
private void OnBlockItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
@@ -492,6 +547,7 @@ namespace Filtration.ViewModels
RaisePropertyChanged(nameof(SummaryBlockItems));
RaisePropertyChanged(nameof(AudioVisualBlockItems));
RaisePropertyChanged(nameof(HasAudioVisualBlockItems));
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
}
private void OnCustomSoundFileDialog()

View File

@@ -6,11 +6,13 @@ using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using DynamicData.Binding;
using Filtration.Common.Services;
using Filtration.Common.ViewModels;
using Filtration.Interface;
@@ -75,6 +77,8 @@ namespace Filtration.ViewModels
RelayCommand<bool> ToggleShowAdvancedCommand { get; }
RelayCommand ClearFilterCommand { get; }
RelayCommand ClearStylesCommand { get; }
RelayCommand EnableDropSoundsCommand { get; }
RelayCommand DisableDropSoundsCommand { get; }
void AddCommentBlock(IItemFilterBlockViewModelBase targetBlockViewModelBase);
void AddBlock(IItemFilterBlockViewModelBase targetBlockViewModelBase);
@@ -111,6 +115,7 @@ namespace Filtration.ViewModels
private Predicate<IItemFilterBlockViewModel> _blockFilterPredicate;
private ICommandManager _scriptCommandManager;
private List<IDisposable> _subscriptions;
private ObservableCollection<string> _customSoundsAvailable;
private readonly List<IItemFilterBlockViewModelBase> _lastAddedBlocks;
@@ -130,14 +135,20 @@ namespace Filtration.ViewModels
_persistenceService = persistenceService;
_messageBoxService = messageBoxService;
_clipboardService = clipboardService;
_subscriptions = new List<IDisposable>();
ItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
SelectedBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
SelectedBlockViewModels.CollectionChanged += (s, e) =>
{
_subscriptions.Add(
SelectedBlockViewModels.ToObservableChangeSet()
.Throttle(TimeSpan.FromMilliseconds(30))
.Subscribe(x => {
RaisePropertyChanged(nameof(SelectedBlockViewModels));
RaisePropertyChanged(nameof(LastSelectedBlockViewModel));
Messenger.Default.Send(new NotificationMessage("LastSelectedBlockChanged"));
};
})
);
_lastAddedBlocks = new List<IItemFilterBlockViewModelBase>();
_showAdvanced = Settings.Default.ShowAdvanced;
@@ -171,6 +182,8 @@ namespace Filtration.ViewModels
CollapseAllBlocksCommand = new RelayCommand(OnCollapseAllBlocksCommand);
ExpandAllSectionsCommand = new RelayCommand(ExpandAllSections);
CollapseAllSectionsCommand = new RelayCommand(CollapseAllSections);
EnableDropSoundsCommand = new RelayCommand(OnEnableDropSoundsCommand, CanModifySelectedBlocks);
DisableDropSoundsCommand = new RelayCommand(OnDisableDropSoundsCommand, CanModifySelectedBlocks);
var icon = new BitmapImage();
icon.BeginInit();
@@ -380,7 +393,7 @@ namespace Filtration.ViewModels
{
for (var i = 0; i < SelectedBlockViewModels.Count; i++)
{
if (!ViewItemFilterBlockViewModels.Contains(SelectedBlockViewModels[i]))
if (SelectedBlockViewModels[i] == null || !ViewItemFilterBlockViewModels.Contains(SelectedBlockViewModels[i]))
{
SelectedBlockViewModels.RemoveAt(i--);
}
@@ -412,6 +425,8 @@ namespace Filtration.ViewModels
public RelayCommand CollapseAllBlocksCommand { get; }
public RelayCommand ExpandAllSectionsCommand { get; }
public RelayCommand CollapseAllSectionsCommand { get; }
public RelayCommand EnableDropSoundsCommand { get; }
public RelayCommand DisableDropSoundsCommand { get; }
public bool IsActiveDocument
{
@@ -547,6 +562,8 @@ namespace Filtration.ViewModels
public bool CanModifySelectedBlocks()
{
ValidateSelectedBlocks();
if (SelectedBlockViewModels.Count < 1)
return false;
@@ -563,6 +580,9 @@ namespace Filtration.ViewModels
public bool CanModifyBlock(IItemFilterBlockViewModelBase itemFilterBlock)
{
if (itemFilterBlock == null)
return false;
if (itemFilterBlock is IItemFilterBlockViewModel)
return true;
@@ -781,14 +801,14 @@ namespace Filtration.ViewModels
await Close();
}
public async Task Close()
public async Task<bool> Close()
{
if (!IsDirty)
{
CloseScript();
return true;
}
else
{
var result = _messageBoxService.Show("Filtration",
"Save script \"" + Filename + "\"?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
@@ -798,23 +818,33 @@ namespace Filtration.ViewModels
{
await SaveAsync();
CloseScript();
break;
return true;
}
case MessageBoxResult.No:
{
CloseScript();
break;
return true;
}
case MessageBoxResult.Cancel:
{
return;
return false;
}
default:
{
return false;
}
}
}
private void CloseScript()
{
foreach (var disposable in Enumerable.Reverse(_subscriptions))
{
disposable.Dispose();
}
_subscriptions.Clear();
var openMasterThemForScript =
_avalonDockWorkspaceViewModel.OpenMasterThemeForScript(this);
if (openMasterThemForScript != null)
@@ -1268,6 +1298,63 @@ namespace Filtration.ViewModels
SetDirtyFlag();
}
public void OnEnableDropSoundsCommand()
{
ValidateSelectedBlocks();
var input = new List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>>();
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterBlockViewModel>())
{
var blockItems = block.Block.BlockItems;
for (var i = 0; i < blockItems.Count; i++)
{
var blockItem = blockItems[i];
if (blockItem is DisableDropSoundBlockItem)
{
input.Add(new Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>(blockItems, blockItem));
}
}
}
if (input.Count > 0)
{
_scriptCommandManager.ExecuteCommand(new RemoveBlockItemFromBlocksCommand(input));
SetDirtyFlag();
}
}
public void OnDisableDropSoundsCommand()
{
ValidateSelectedBlocks();
var input = new List<Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>>();
foreach (var block in SelectedBlockViewModels.OfType<IItemFilterBlockViewModel>())
{
var blockItems = block.Block.BlockItems;
var found = false;
foreach (var item in blockItems)
{
if (item is DisableDropSoundBlockItem)
{
found = true;
}
}
if (!found) {
var item = new DisableDropSoundBlockItem();
input.Add(new Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>(blockItems, item));
}
}
if (input.Count > 0)
{
_scriptCommandManager.ExecuteCommand(new AddBlockItemToBlocksCommand(input));
SetDirtyFlag();
}
}
private void OnBlockBecameDirty(object sender, EventArgs e)
{
SetDirtyFlag();

Some files were not shown because too many files have changed in this diff Show More