Compare commits
24 Commits
1.1.0-beta
...
1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
444f09751a | ||
|
|
9356f55209 | ||
|
|
fb7bd8b81e | ||
|
|
72ed517929 | ||
|
|
290547cbba | ||
|
|
065e56e0a6 | ||
|
|
d686e6da39 | ||
|
|
79398667b4 | ||
|
|
2424ab9195 | ||
|
|
491f448f94 | ||
|
|
2f49e85227 | ||
|
|
dce0af7fd6 | ||
|
|
208aeb39f6 | ||
|
|
79274df0fb | ||
|
|
4052d6e020 | ||
|
|
7c0da57570 | ||
|
|
557767f4dc | ||
|
|
cde2d692c9 | ||
|
|
c96aa472d9 | ||
|
|
d4e8a72d47 | ||
|
|
4c826f42fd | ||
|
|
4022cf12a0 | ||
|
|
8073948cfe | ||
|
|
f331bffee7 |
@@ -8,7 +8,7 @@ namespace Filtration.Interface
|
||||
{
|
||||
bool IsScript { get; }
|
||||
bool IsTheme { get; }
|
||||
Task Close();
|
||||
Task<bool> Close();
|
||||
RelayCommand CloseCommand { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -573,12 +567,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+)");
|
||||
@@ -593,6 +592,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]*)");
|
||||
@@ -649,6 +662,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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" />
|
||||
@@ -248,6 +250,7 @@
|
||||
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
|
||||
<Compile Include="Utility\SplatNLogAdapter.cs" />
|
||||
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
|
||||
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
|
||||
<Compile Include="Utility\RoutedCommandHandler.cs" />
|
||||
@@ -460,6 +463,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" />
|
||||
@@ -504,7 +511,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" />
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
* 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
|
||||
|
||||
@@ -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>
|
||||
@@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: AssemblyVersion("1.1.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.1.0-beta7")]
|
||||
[assembly: AssemblyInformationalVersion("1.1.0")]
|
||||
|
||||
[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 |
@@ -6,6 +6,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Filtration.Enums;
|
||||
using Filtration.Properties;
|
||||
using Filtration.Utility;
|
||||
using NLog;
|
||||
using Squirrel;
|
||||
|
||||
@@ -78,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;
|
||||
|
||||
52
Filtration/Utility/SplatNLogAdapter.cs
Normal file
52
Filtration/Utility/SplatNLogAdapter.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -150,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()
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace Filtration.ViewModels
|
||||
bool HasSound { get; }
|
||||
bool HasPositionalSound { get; }
|
||||
bool HasCustomSound { get; }
|
||||
bool HasDisabledDefaultSound { get; }
|
||||
bool HasAudioVisualBlockItems { get; }
|
||||
void RefreshBlockPreview();
|
||||
}
|
||||
@@ -287,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();
|
||||
|
||||
@@ -526,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)
|
||||
@@ -534,6 +537,7 @@ namespace Filtration.ViewModels
|
||||
RaisePropertyChanged(nameof(SummaryBlockItems));
|
||||
RaisePropertyChanged(nameof(AudioVisualBlockItems));
|
||||
RaisePropertyChanged(nameof(HasAudioVisualBlockItems));
|
||||
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
|
||||
}
|
||||
|
||||
private void OnCustomSoundFileDialog()
|
||||
|
||||
@@ -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,34 +801,37 @@ 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);
|
||||
|
||||
switch (result)
|
||||
var result = _messageBoxService.Show("Filtration",
|
||||
"Save script \"" + Filename + "\"?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case MessageBoxResult.Yes:
|
||||
{
|
||||
case MessageBoxResult.Yes:
|
||||
{
|
||||
await SaveAsync();
|
||||
CloseScript();
|
||||
break;
|
||||
}
|
||||
case MessageBoxResult.No:
|
||||
{
|
||||
CloseScript();
|
||||
break;
|
||||
}
|
||||
case MessageBoxResult.Cancel:
|
||||
{
|
||||
return;
|
||||
}
|
||||
await SaveAsync();
|
||||
CloseScript();
|
||||
return true;
|
||||
}
|
||||
case MessageBoxResult.No:
|
||||
{
|
||||
CloseScript();
|
||||
return true;
|
||||
}
|
||||
case MessageBoxResult.Cancel:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,7 +768,10 @@ namespace Filtration.ViewModels
|
||||
continue;
|
||||
}
|
||||
|
||||
await document.Close();
|
||||
if (!await document.Close())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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 positional 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 custom 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}"
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace Filtration.Views
|
||||
if (!allDocumentsClosed)
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user