6 Commits

Author SHA1 Message Date
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
29 changed files with 142 additions and 184 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

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

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

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

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

@@ -327,7 +327,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":
@@ -512,6 +512,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>();

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

@@ -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">
@@ -63,8 +64,8 @@
<ContentControl Grid.Row="2" Content="{Binding Mode=OneWay}">
<ContentControl.Resources>
<!-- Color Theme Template -->
<DataTemplate DataType="{x:Type themeEditor:ColorThemeComponent}">
<xctk:ColorPicker SelectedColor="{Binding Color}" />
<DataTemplate DataType="{x:Type themeEditor:ColorThemeComponent}">
<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

@@ -4,11 +4,8 @@
<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>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<userSettings>
@@ -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

@@ -247,7 +247,6 @@
<Compile Include="UserControls\ThemeComponentSelectionControl.xaml.cs">
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\VisualTreeUtility.cs" />
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
@@ -279,7 +278,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>

View File

@@ -10,12 +10,15 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright 2018</copyright>
<releaseNotes>* Added support for new Prophecies block item type
* Added Betrayal League Item Base Types and Item Classes to static data
* 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 Advanced tab in the Color Picker in the Theme Editor not being clickable (#115)
* Fixed the previously incorrect handling of DisableDropSound as a true/false value when in fact it is enabled/disabled purely by its presence or lack thereof in a block (#111)
* 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)

View File

@@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyInformationalVersion("1.1.0-beta5")]
[assembly: AssemblyInformationalVersion("1.1.0-beta7")]
[assembly: InternalsVisibleTo("Filtration.Tests")]
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]

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>

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)
@@ -62,7 +65,7 @@ namespace Filtration.Services
{
loadedScript.FilePath = filePath;
}
return loadedScript;
}

View File

@@ -1,5 +1,7 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Filtration.Enums;
@@ -117,6 +119,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">
@@ -117,7 +118,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 +247,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,16 +1,13 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using Filtration.Annotations;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.ThemeEditor;
using Filtration.Views;
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.ThemeEditor;
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

@@ -139,7 +139,6 @@ namespace Filtration.ViewModels.DesignTime
typeof (HasExplicitModBlockItem)
};
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;

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; }
@@ -276,8 +275,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;

View File

@@ -1309,10 +1309,10 @@ namespace Filtration.ViewModels
}
}
if (input.Count > 0)
{
_scriptCommandManager.ExecuteCommand(new RemoveBlockItemFromBlocksCommand(input));
SetDirtyFlag();
if (input.Count > 0)
{
_scriptCommandManager.ExecuteCommand(new RemoveBlockItemFromBlocksCommand(input));
SetDirtyFlag();
}
}
@@ -1335,15 +1335,15 @@ namespace Filtration.ViewModels
}
if (!found) {
var item = new DisableDropSoundBlockItem(true);
var item = new DisableDropSoundBlockItem();
input.Add(new Tuple<ObservableCollection<IItemFilterBlockItem>, IItemFilterBlockItem>(blockItems, item));
}
}
if (input.Count > 0)
{
if (input.Count > 0)
{
_scriptCommandManager.ExecuteCommand(new AddBlockItemToBlocksCommand(input));
SetDirtyFlag();
SetDirtyFlag();
}
}

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

@@ -158,7 +158,7 @@
Visibility="{Binding HasPositionalSound, Converter={StaticResource BooleanVisibilityConverter}}"
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
ToolTip="Click to preview positional drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Button Command="{Binding PlayCustomSoundCommand}"
@@ -170,7 +170,7 @@
Visibility="{Binding HasCustomSound, Converter={StaticResource BooleanVisibilityConverter}}"
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
ToolTip="Click to preview custom drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"

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
{

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>