Compare commits
16 Commits
1.1.0-beta
...
1.1.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d686e6da39 | ||
|
|
79398667b4 | ||
|
|
2424ab9195 | ||
|
|
491f448f94 | ||
|
|
2f49e85227 | ||
|
|
dce0af7fd6 | ||
|
|
208aeb39f6 | ||
|
|
79274df0fb | ||
|
|
4052d6e020 | ||
|
|
7c0da57570 | ||
|
|
557767f4dc | ||
|
|
ad1b46f975 | ||
|
|
9f17d84a7f | ||
|
|
0fe21336e6 | ||
|
|
2ba1b8adac | ||
|
|
2415be089b |
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Filtration.Utility
|
||||
namespace Filtration.Common.Utilities
|
||||
{
|
||||
public class VisualTreeUtility
|
||||
{
|
||||
@@ -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>
|
||||
16
Filtration.ObjectModel/BlockItemBaseTypes/NilBlockItem.cs
Normal file
16
Filtration.ObjectModel/BlockItemBaseTypes/NilBlockItem.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ namespace Filtration.ObjectModel.Enums
|
||||
{
|
||||
public enum ItemRarity
|
||||
{
|
||||
[Description("Not Set")]
|
||||
NotSet,
|
||||
[Description("Normal")]
|
||||
Normal,
|
||||
[Description("Magic")]
|
||||
|
||||
@@ -16,23 +16,20 @@ namespace Filtration.ObjectModel.Extensions
|
||||
}
|
||||
case ItemRarity.Normal:
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
|
||||
}
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
|
||||
}
|
||||
case ItemRarity.Rare:
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.RareItem];
|
||||
}
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.RareItem];
|
||||
}
|
||||
case ItemRarity.Unique:
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.UniqueItem];
|
||||
}
|
||||
case ItemRarity.NotSet:
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.QuestItem];
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.UniqueItem];
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(itemRarity), itemRarity, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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":
|
||||
@@ -349,12 +349,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 +506,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>();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,50 +29,48 @@
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="10">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
|
||||
<ListView ItemsSource="{Binding Source={StaticResource ComponentsViewSource}}"
|
||||
<ListView ItemsSource="{Binding Source={StaticResource ComponentsViewSource}}"
|
||||
SelectedItem="{Binding SelectedThemeComponent}"
|
||||
Margin="5"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<ListView.Resources>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<Border Name="Border" BorderBrush="Black" Background="White" BorderThickness="1" CornerRadius="3" Margin="2" SnapsToDevicePixels="true">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="#A9BDD8"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListView.Resources>
|
||||
<ListView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Margin="7,5,0,0" FontWeight="Bold" FontSize="15" Text="{Binding Path=Name, Converter={StaticResource ThemeComponentTypeToStringConverter}}"/>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</ListView.GroupStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<views:ThemeComponentControl DataContext="{Binding}" Margin="10,5,10,5" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
<ListView.Resources>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<Border Name="Border" BorderBrush="Black" Background="White" BorderThickness="1" CornerRadius="3" Margin="2" SnapsToDevicePixels="true">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="#A9BDD8"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListView.Resources>
|
||||
<ListView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Margin="7,5,0,0" FontWeight="Bold" FontSize="15" Text="{Binding Path=Name, Converter={StaticResource ThemeComponentTypeToStringConverter}}"/>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</ListView.GroupStyle>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<views:ThemeComponentControl DataContext="{Binding}" Margin="10,5,10,5" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
31
Filtration/Converters/DisabledDefaultSoundConverter.cs
Normal file
31
Filtration/Converters/DisabledDefaultSoundConverter.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,7 +249,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 +280,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 +462,10 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<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 +510,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" />
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
<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)
|
||||
* Added a new indicator for blocks with a DisableDropSound block present (#113)
|
||||
* 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 an issue with MinimapIcon block items causing an "Unused Theme Components" message box to erroneously be shown when saving (#116)
|
||||
* 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)
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: AssemblyVersion("1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.1.0-beta6")]
|
||||
[assembly: AssemblyInformationalVersion("1.1.0-beta8")]
|
||||
|
||||
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
||||
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||
|
||||
BIN
Filtration/Resources/Icons/no_sound_dds.png
Normal file
BIN
Filtration/Resources/Icons/no_sound_dds.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
Filtration/Resources/Icons/no_sound_dds_light.png
Normal file
BIN
Filtration/Resources/Icons/no_sound_dds_light.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Filtration/Resources/Icons/sound.png
Normal file
BIN
Filtration/Resources/Icons/sound.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Filtration/Resources/Icons/sound_dds.png
Normal file
BIN
Filtration/Resources/Icons/sound_dds.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -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)));
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
@@ -151,6 +150,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()
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -276,8 +276,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 +288,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();
|
||||
|
||||
@@ -529,6 +528,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 +537,7 @@ namespace Filtration.ViewModels
|
||||
RaisePropertyChanged(nameof(SummaryBlockItems));
|
||||
RaisePropertyChanged(nameof(AudioVisualBlockItems));
|
||||
RaisePropertyChanged(nameof(HasAudioVisualBlockItems));
|
||||
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
|
||||
}
|
||||
|
||||
private void OnCustomSoundFileDialog()
|
||||
|
||||
@@ -578,6 +578,9 @@ namespace Filtration.ViewModels
|
||||
|
||||
public bool CanModifyBlock(IItemFilterBlockViewModelBase itemFilterBlock)
|
||||
{
|
||||
if (itemFilterBlock == null)
|
||||
return false;
|
||||
|
||||
if (itemFilterBlock is IItemFilterBlockViewModel)
|
||||
return true;
|
||||
|
||||
@@ -1309,10 +1312,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 +1338,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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" />
|
||||
@@ -37,4 +36,4 @@
|
||||
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="StandbyDisabledIcon" x:Shared="False" />
|
||||
<Image Source="/Filtration;component/Resources/Icons/standby_enabled_icon.png" x:Key="EnableDropSoundsIcon" x:Shared="False" />
|
||||
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="DisableDropSoundsIcon" x:Shared="False" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<UserControl x:Class="Filtration.Views.ItemFilterBlockView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
|
||||
@@ -10,7 +10,7 @@
|
||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||
xmlns:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemFilterBlockViewModel, IsDesignTimeCreatable=True}"
|
||||
d:DesignHeight="400" d:DesignWidth="817">
|
||||
<UserControl.Resources>
|
||||
@@ -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>
|
||||
@@ -130,48 +132,90 @@
|
||||
<WrapPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">
|
||||
<Image Height="40" Width="40" Margin="0,0,10,0" Stretch="Fill">
|
||||
<Image.Source>
|
||||
<MultiBinding Converter="{StaticResource MinimapIconToCroppedBitmapConverter}">
|
||||
<Binding Path="DisplayIconSize"/>
|
||||
<Binding Path="DisplayIconColor"/>
|
||||
<Binding Path="DisplayIconShape"/>
|
||||
<MultiBinding Converter="{StaticResource MinimapIconToCroppedBitmapConverter}">
|
||||
<Binding Path="DisplayIconSize"/>
|
||||
<Binding Path="DisplayIconColor"/>
|
||||
<Binding Path="DisplayIconShape"/>
|
||||
</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}"
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user