36 Commits

Author SHA1 Message Date
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
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
65 changed files with 1867 additions and 330 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

@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Media;
namespace Filtration.Utility
namespace Filtration.Common.Utilities
{
public class VisualTreeUtility
{

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

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

@@ -4,18 +4,15 @@ 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 BlockItemOrdering SortOrder => BlockItemOrdering.DisableDropSound;

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

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

@@ -23,6 +23,6 @@ namespace Filtration.ObjectModel.BlockItemTypes
public override Color SummaryTextColor => Colors.White;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Quality;
public override int Minimum => 0;
public override int Maximum => 30;
public override int Maximum => 99;
}
}

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

@@ -12,6 +12,9 @@ namespace Filtration.ObjectModel.Enums
Corrupted,
ElderItem,
ShaperItem,
SynthesisedItem,
FracturedItem,
AnyEnchantment,
MapTier,
ShapedMap,
ElderMap,
@@ -27,6 +30,7 @@ namespace Filtration.ObjectModel.Enums
BaseType,
Prophecy,
HasExplicitMod,
HasEnchantment,
SetTextColor,
SetBackgroundColor,
SetBorderColor,

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" />
@@ -94,6 +98,7 @@
<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" />

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

@@ -919,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);
@@ -928,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]
@@ -965,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;
@@ -1075,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);
@@ -2065,7 +2080,7 @@ namespace Filtration.Parser.Tests.Services
" 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\"";
@@ -2120,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

@@ -184,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);
@@ -317,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);
@@ -327,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":
@@ -349,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;
}
@@ -512,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>();
@@ -566,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+)");
@@ -586,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]*)");
@@ -642,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

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

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

@@ -210,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" />
@@ -247,8 +249,8 @@
<Compile Include="UserControls\ThemeComponentSelectionControl.xaml.cs">
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\VisualTreeUtility.cs" />
<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" />
@@ -279,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>
@@ -462,6 +463,11 @@
<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" />
@@ -506,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,21 +8,12 @@
<authors>Ben Wallis</authors>
<description>A Path of Exile loot filter script editor</description>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright 2018</copyright>
<releaseNotes>* Added support for new Prophecies block item type
* 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)
* New buttons for adding/removing DisableDropSound from selected blocks have been added (#110)
* The Enable/Disable Block toggle button is now visible on both the Regular Block Items and Appearance Block Items views
* When there are too many block items to fit horizontally in a block a horizontal scrollbar will now appear
* Fixed the application freezing for a long period of time when Ctrl+A (Select All) is performed
* Fixed the Switch to Appearance/Regular Block Items text overlapping block items
* 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)</releaseNotes>
<dependencies />
</metadata>
<files>

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-beta5")]
[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyInformationalVersion("1.2.0-beta1")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]

View File

@@ -389,6 +389,17 @@ namespace Filtration.Properties {
}
}
/// <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

@@ -214,4 +214,7 @@
<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

@@ -22,6 +22,7 @@ Alira's Amulet
Alleyways Map
Allflame
Alloyed Spiked Shield
Alone in the Darkness
Alteration Shard
Amber Amulet
Ambush Boots
@@ -76,6 +77,7 @@ Armageddon Brand
Arming Axe
Armourer's Scrap
Armoury Map
Arrogance of the Vaal
Arsenal Map
Ashen Wood Map
Ashscale Talisman
@@ -96,6 +98,7 @@ Avian Twins Talisman
Awl
Baleful Gem
Ball Lightning
Bane
Bane of the Loyal
Barbed Club
Barbute Helmet
@@ -172,6 +175,7 @@ Bone Offering
Bone Spirit Shield
Bonechill Support
Bonespire Talisman
Boon of Justice
Boon of the First Ones
Boot Blade
Boot Knife
@@ -389,6 +393,7 @@ Dagger Axe
Damage on Full Life Support
Dark Forest Map
Dark Pact
Dark Temptation
Darkwood Sceptre
Deadhand Talisman
Deadly Ailments Support
@@ -450,6 +455,7 @@ Diamond Ring
Dig Map
Discharge
Discipline
Divine Ire
Divine Life Flask
Divine Mana Flask
Divine Orb
@@ -510,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
@@ -820,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
@@ -949,6 +958,7 @@ Majestic Plate
Malachai's Entrails
Malachai's Heart
Malachai's Lungs
Malevolence
Malformation Map
Maligaro's Map
Maligaro's Spike
@@ -1009,6 +1019,7 @@ Molten Shell
Molten Strike
Monkey Paw Talisman
Monkey Twins Talisman
Monochrome
Moon Orb
Moon Staff
Moon Temple Map
@@ -1183,6 +1194,7 @@ Prophet Crown
Prosperity
Puncture
Punishment
Purifying Flame
Purity of Elements
Purity of Fire
Purity of Ice
@@ -1295,6 +1307,7 @@ Saint's Hauberk
Saintly Chainmail
Sallet
Sambar Sceptre
Sambodhi's Vow
Samite Gloves
Samite Helmet
Samite Slippers
@@ -1357,6 +1370,7 @@ Serpentscale Gauntlets
Serrated Arrow Quiver
Serrated Foil
Serrated Fossil
Seven Years Bad Luck
Shabby Jerkin
Shackled Boots
Shadow Axe
@@ -1457,6 +1471,7 @@ Soldier Helmet
Soldier's Brigandine
Sorcerer Boots
Sorcerer Gloves
Soulrend
Sovereign Spiked Shield
Spark
Sparkling Claw
@@ -1628,6 +1643,7 @@ The Garish Power
The Gemcutter
The Gentleman
The Gladiator
The Golden Era
The Hale Heart
The Harvester
The Hermit
@@ -1642,19 +1658,24 @@ 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
@@ -1684,6 +1705,7 @@ The Samurai's Eye
The Scarred Meadow
The Scavenger
The Scholar
The Seeker
The Sephirot
The Shaper's Key
The Shaper's Realm
@@ -1800,6 +1822,7 @@ Underground River Map
Underground Sea Map
Undying Flesh Talisman
Unearth
Unleash Support
Unset Ring
Unshaping Orb
Ursine Pelt
@@ -1924,6 +1947,7 @@ Warlord's Mark
Waste Pool Map
Wasteland Map
Waterways Map
Wave of Conviction
Waxed Garb
Wealth and Power
Weeping Essence
@@ -1978,4 +2002,5 @@ Yriel's Key
Zealot Boots
Zealot Gloves
Zealot Helmet
Zealotry
Zodiac Leather

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

@@ -12,6 +12,7 @@ namespace Filtration.Services
IEnumerable<string> ItemClasses { get; }
IEnumerable<string> ItemMods { get; }
IEnumerable<string> Prophecies { get; }
IEnumerable<string> Enchantments { get; }
}
internal class StaticDataService : IStaticDataService
@@ -29,12 +30,15 @@ namespace Filtration.Services
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">
@@ -86,6 +87,11 @@
<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}" />
@@ -117,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">
@@ -246,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,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

@@ -131,15 +131,18 @@ namespace Filtration.ViewModels.DesignTime
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 { get; }
public ObservableCollection<ColorItem> AvailableColors { get; }
public Color DisplayTextColor => Colors.Red;
public Color DisplayBackgroundColor => Colors.White;
public Color DisplayBorderColor => Colors.GreenYellow;
@@ -151,6 +154,7 @@ namespace Filtration.ViewModels.DesignTime
public bool HasSound { get; }
public bool HasPositionalSound { get; }
public bool HasCustomSound { get; }
public bool HasDisabledDefaultSound { get; }
public bool HasAudioVisualBlockItems { get; }
public void RefreshBlockPreview()
{

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

@@ -54,7 +54,6 @@ namespace Filtration.ViewModels
IEnumerable<string> AutocompleteItemMods { get; }
List<Type> BlockItemTypesAvailable { get; }
List<Type> AudioVisualBlockItemTypesAvailable { get; }
ObservableCollection<ColorItem> AvailableColors { get; }
Color DisplayTextColor { get; }
Color DisplayBackgroundColor { get; }
Color DisplayBorderColor { get; }
@@ -66,6 +65,7 @@ namespace Filtration.ViewModels
bool HasSound { get; }
bool HasPositionalSound { get; }
bool HasCustomSound { get; }
bool HasDisabledDefaultSound { get; }
bool HasAudioVisualBlockItems { get; }
void RefreshBlockPreview();
}
@@ -208,6 +208,8 @@ namespace Filtration.ViewModels
public IEnumerable<string> AutocompleteItemMods => _staticDataService.ItemMods;
public IEnumerable<string> AutocompleteEnchantments => _staticDataService.Enchantments;
public List<Type> BlockItemTypesAvailable => new List<Type>
{
typeof (ItemLevelBlockItem),
@@ -226,12 +228,16 @@ namespace Filtration.ViewModels
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>
@@ -276,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;
@@ -290,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();
@@ -352,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()
@@ -529,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)
@@ -537,6 +547,7 @@ namespace Filtration.ViewModels
RaisePropertyChanged(nameof(SummaryBlockItems));
RaisePropertyChanged(nameof(AudioVisualBlockItems));
RaisePropertyChanged(nameof(HasAudioVisualBlockItems));
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
}
private void OnCustomSoundFileDialog()

View File

@@ -393,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--);
}
@@ -562,6 +562,8 @@ namespace Filtration.ViewModels
public bool CanModifySelectedBlocks()
{
ValidateSelectedBlocks();
if (SelectedBlockViewModels.Count < 1)
return false;
@@ -578,6 +580,9 @@ namespace Filtration.ViewModels
public bool CanModifyBlock(IItemFilterBlockViewModelBase itemFilterBlock)
{
if (itemFilterBlock == null)
return false;
if (itemFilterBlock is IItemFilterBlockViewModel)
return true;
@@ -796,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);
@@ -813,17 +818,20 @@ 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;
}
}
}
@@ -1335,7 +1343,7 @@ namespace Filtration.ViewModels
}
if (!found) {
var item = new DisableDropSoundBlockItem(true);
var item = new DisableDropSoundBlockItem();
input.Add(new Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>(blockItems, item));
}
}

View File

@@ -768,7 +768,10 @@ namespace Filtration.ViewModels
continue;
}
await document.Close();
if (!await document.Close())
{
return false;
}
}
return true;

View File

@@ -1,12 +1,9 @@
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemTypes;
using Filtration.Views;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using Xceed.Wpf.Toolkit;
namespace Filtration.ViewModels
{
@@ -62,8 +59,6 @@ namespace Filtration.ViewModels
_itemFilterScript = itemFilterScript;
}
public ObservableCollection<ColorItem> AvailableColors => PathOfExileColors.DefaultColors;
public Color NewTextColor
{
get => _replaceColorsParameterSet.NewTextColor;

View File

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

View File

@@ -65,9 +65,10 @@ namespace Filtration.ViewModels
public bool IsInErrorState => UpdateStatus == UpdateStatus.Error;
public async Task Close()
public async Task<bool> Close()
{
await Task.FromResult(true);
return true;
}
public RelayCommand CloseCommand { get; }

View File

@@ -11,7 +11,6 @@
<Image Source="/Filtration;component/Resources/Icons/arrow_up_large_icon.png" x:Key="MoveUpIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/arrow_bottom_icon.png" x:Key="MoveToBottomIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/arrow_down_large_icon.png" x:Key="MoveDownIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" x:Key="SpeakerIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/play_icon.png" x:Key="PlayIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/about_icon.png" x:Key="AboutIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/ReplaceColors.ico" x:Key="ReplaceColorsIcon" x:Shared="false" />

View File

@@ -18,6 +18,8 @@
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
<converters:DisabledDefaultSoundConverter x:Key="DisabledDefaultSoundConverter"/>
<converters:DisabledDefaultSoundTooltipConverter x:Key="DisabledDefaultSoundTooltipConverter"/>
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
<Setter Property="LayoutTransform">
<Setter.Value>
@@ -137,41 +139,83 @@
</MultiBinding>
</Image.Source>
</Image>
<Image Height="28" Width="28" Margin="0,0,5,0" Source="../Resources/Icons/no_sound_dds_light.png">
<Image.ToolTip>
<TextBlock>
The default drop sound is disabled for this block.
<LineBreak />
Drops matched by this block emit no sound whatsoever
</TextBlock>
</Image.ToolTip>
<Image.Style>
<Style TargetType="Image">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding HasCustomSound}" Value="False" />
<Condition Binding="{Binding HasSound}" Value="False" />
<Condition Binding="{Binding HasPositionalSound}" Value="False" />
<Condition Binding="{Binding HasDisabledDefaultSound}" Value="True" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Visibility" Value="Visible" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<Button Command="{Binding PlaySoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
Visibility="{Binding HasSound, Converter={StaticResource BooleanVisibilityConverter}}"
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
BorderBrush="Transparent">
<Button.ToolTip>
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
<Binding Source="Click to preview drop sound."/>
<Binding Path="HasDisabledDefaultSound"/>
</MultiBinding>
</Button.ToolTip>
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Button Command="{Binding PlayPositionalSoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
Visibility="{Binding HasPositionalSound, Converter={StaticResource BooleanVisibilityConverter}}"
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
BorderBrush="Transparent">
<Button.ToolTip>
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
<Binding Source="Click to preview positional drop sound."/>
<Binding Path="HasDisabledDefaultSound"/>
</MultiBinding>
</Button.ToolTip>
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Button Command="{Binding PlayCustomSoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
Visibility="{Binding HasCustomSound, Converter={StaticResource BooleanVisibilityConverter}}"
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
BorderBrush="Transparent">
<Button.ToolTip>
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
<Binding Source="Click to preview custom drop sound."/>
<Binding Path="HasDisabledDefaultSound"/>
</MultiBinding>
</Button.ToolTip>
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
Stroke="{Binding DisplayEffectColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}"

View File

@@ -2,8 +2,8 @@
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Filtration.Common.Utilities;
using Filtration.UserControls;
using Filtration.Utility;
namespace Filtration.Views
{
@@ -44,8 +44,9 @@ namespace Filtration.Views
if (sender is ScrollViewer viewer && !e.Handled)
{
// Don't handle events if they originated from a control within an EditableListBoxControl
// since we still want to allow scrolling within those with the mouse wheel
if (e.OriginalSource is DependencyObject dependencyObject && VisualTreeUtility.FindParent<EditableListBoxControl>(dependencyObject) != null)
// or a ComboBox since we still want to allow scrolling within those with the mouse wheel
if (e.OriginalSource is DependencyObject dependencyObject && (IsDropDownScrollViewer(dependencyObject) || ParentIsEditableListBoxControl(dependencyObject) ||
ParentIsDropDownScrollViewer(dependencyObject)))
{
e.Handled = false;
return;
@@ -60,5 +61,20 @@ namespace Filtration.Views
}
}
}
private static bool ParentIsEditableListBoxControl(DependencyObject dependencyObject)
{
return VisualTreeUtility.FindParent<EditableListBoxControl>(dependencyObject) != null;
}
private static bool ParentIsDropDownScrollViewer(DependencyObject dependencyObject)
{
var parent = VisualTreeUtility.FindParent<ScrollViewer>(dependencyObject);
return parent != null && parent.Name == "DropDownScrollViewer";
}
private static bool IsDropDownScrollViewer(DependencyObject dependencyObject)
{
return dependencyObject is ScrollViewer scrollViewer && scrollViewer.Name == "DropDownScrollViewer";
}
}
}

View File

@@ -44,7 +44,6 @@ namespace Filtration.Views
if (!allDocumentsClosed)
{
e.Cancel = true;
}
}

View File

@@ -6,6 +6,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
xmlns:userControls="clr-namespace:Filtration.UserControls"
xmlns:utilities="clr-namespace:Filtration.Common.Utilities;assembly=Filtration.Common"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=viewModels:ReplaceColorsViewModel}"
Title="Replace Script Colors" Height="280" Width="540"
@@ -31,22 +32,22 @@
</Grid.ColumnDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Content="Replace Text Color" IsChecked="{Binding ReplaceTextColor}" />
<TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">Existing Text Color</TextBlock>
<xctk:ColorPicker Grid.Row="0" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldTextColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="0" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldTextColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">New Text Color</TextBlock>
<xctk:ColorPicker Grid.Row="1" Grid.Column="4" SelectedColor="{Binding NewTextColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="1" Grid.Column="4" SelectedColor="{Binding NewTextColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<CheckBox Grid.Row="2" Grid.Column="0" Content="Replace Background Color" IsChecked="{Binding ReplaceBackgroundColor}" />
<TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center">Existing Background Color</TextBlock>
<xctk:ColorPicker Grid.Row="2" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBackgroundColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="2" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBackgroundColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">New Background Color</TextBlock>
<xctk:ColorPicker Grid.Row="3" Grid.Column="4" SelectedColor="{Binding NewBackgroundColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="3" Grid.Column="4" SelectedColor="{Binding NewBackgroundColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<CheckBox Grid.Row="4" Grid.Column="0" Content="Replace Border Color" IsChecked="{Binding ReplaceBorderColor}" />
<TextBlock Grid.Row="4" Grid.Column="2" VerticalAlignment="Center">Existing Border Color</TextBlock>
<xctk:ColorPicker Grid.Row="4" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBorderColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="4" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBorderColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<TextBlock Grid.Row="5" Grid.Column="2" VerticalAlignment="Center">New Border Color</TextBlock>
<xctk:ColorPicker Grid.Row="5" Grid.Column="4" SelectedColor="{Binding NewBorderColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<xctk:ColorPicker Grid.Row="5" Grid.Column="4" SelectedColor="{Binding NewBorderColor}" AvailableColors="{x:Static utilities:PathOfExileColors.DefaultColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
<userControls:ItemPreviewControl Grid.Row="6" Grid.Column="4" TextColor="{Binding DisplayTextColor}" BackgroundColor="{Binding DisplayBackgroundColor}" BorderColor="{Binding DisplayBorderColor}" />
<TextBlock Grid.Row="6" Grid.Column="2" VerticalAlignment="Center">Preview</TextBlock>

View File

@@ -2,6 +2,7 @@
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Filtration.Services;
using Filtration.Utility;
namespace Filtration.WindsorInstallers
{
@@ -58,6 +59,11 @@ namespace Filtration.WindsorInstallers
Component.For<IDialogService>()
.ImplementedBy<DialogService>()
.LifeStyle.Singleton);
container.Register(
Component.For<ISplatNLogAdapter>()
.ImplementedBy<SplatNLogAdapter>()
.LifeStyle.Singleton);
}
}
}

View File

@@ -4,7 +4,7 @@ Filtration is an editor for Path of Exile item filter scripts.
## Current Release (Released 2018-09-30)
<b>Installer</b><br>
<a href="https://github.com/ben-wallis/Filtration/releases/download/1.0.1/Setup.exe">Setup.exe</a>
<a href="https://github.com/ben-wallis/Filtration/releases/download/1.0.3/Setup.exe">Setup.exe</a>
## System Requirements
Filtration requires .NET Framework 4.6.1 installed.