Compare commits
13 Commits
1.1.0-beta
...
1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
444f09751a | ||
|
|
9356f55209 | ||
|
|
fb7bd8b81e | ||
|
|
72ed517929 | ||
|
|
290547cbba | ||
|
|
065e56e0a6 | ||
|
|
cde2d692c9 | ||
|
|
c96aa472d9 | ||
|
|
d4e8a72d47 | ||
|
|
4c826f42fd | ||
|
|
4022cf12a0 | ||
|
|
8073948cfe | ||
|
|
f331bffee7 |
@@ -8,7 +8,7 @@ namespace Filtration.Interface
|
|||||||
{
|
{
|
||||||
bool IsScript { get; }
|
bool IsScript { get; }
|
||||||
bool IsTheme { get; }
|
bool IsTheme { get; }
|
||||||
Task Close();
|
Task<bool> Close();
|
||||||
RelayCommand CloseCommand { get; }
|
RelayCommand CloseCommand { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -567,12 +567,17 @@ namespace Filtration.Parser.Services
|
|||||||
var trimmedLine = line.Trim();
|
var trimmedLine = line.Trim();
|
||||||
if (trimmedLine.IndexOf('#') > 0)
|
if (trimmedLine.IndexOf('#') > 0)
|
||||||
{
|
{
|
||||||
blockComment = trimmedLine.Substring(trimmedLine.IndexOf('#') + 1);
|
blockComment = trimmedLine.Substring(trimmedLine.IndexOf('#') + 1).Trim();
|
||||||
trimmedLine = trimmedLine.Substring(0, trimmedLine.IndexOf('#')).Trim();
|
trimmedLine = trimmedLine.Substring(0, trimmedLine.IndexOf('#')).Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (matches.Value)
|
switch (matches.Value)
|
||||||
{
|
{
|
||||||
|
case "DisableDropSound":
|
||||||
|
{
|
||||||
|
blockItems.Add(new DisableDropSoundBlockItem());
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "PlayAlertSound":
|
case "PlayAlertSound":
|
||||||
{
|
{
|
||||||
var match = Regex.Match(trimmedLine, @"\s+(\S+) (\d+)");
|
var match = Regex.Match(trimmedLine, @"\s+(\S+) (\d+)");
|
||||||
@@ -587,6 +592,20 @@ namespace Filtration.Parser.Services
|
|||||||
blockItems.Add(blockItem);
|
blockItems.Add(blockItem);
|
||||||
break;
|
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":
|
case "SetTextColor":
|
||||||
{
|
{
|
||||||
var result = Regex.Matches(trimmedLine, @"([\w\s]*)");
|
var result = Regex.Matches(trimmedLine, @"([\w\s]*)");
|
||||||
@@ -643,6 +662,56 @@ namespace Filtration.Parser.Services
|
|||||||
blockItems.Add(blockItem);
|
blockItems.Add(blockItem);
|
||||||
break;
|
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
|
#pragma warning disable 1998
|
||||||
public async Task Close()
|
public async Task<bool> Close()
|
||||||
#pragma warning restore 1998
|
#pragma warning restore 1998
|
||||||
{
|
{
|
||||||
Messenger.Default.Send(new ThemeClosedMessage {ClosedViewModel = this});
|
Messenger.Default.Send(new ThemeClosedMessage {ClosedViewModel = this});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAddThemeComponentCommand(ThemeComponentType themeComponentType)
|
private void OnAddThemeComponentCommand(ThemeComponentType themeComponentType)
|
||||||
|
|||||||
@@ -250,6 +250,7 @@
|
|||||||
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
|
<DependentUpon>ThemeComponentSelectionControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
|
<Compile Include="ViewModels\DesignTime\DesignTimeItemFilterBlockViewModel.cs" />
|
||||||
|
<Compile Include="Utility\SplatNLogAdapter.cs" />
|
||||||
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
|
<Compile Include="ViewModels\DesignTime\DesignTimeSettingsPageViewModel.cs" />
|
||||||
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
|
<Compile Include="Views\AttachedProperties\SelectedItemsAttachedProperty.cs" />
|
||||||
<Compile Include="Utility\RoutedCommandHandler.cs" />
|
<Compile Include="Utility\RoutedCommandHandler.cs" />
|
||||||
|
|||||||
@@ -10,15 +10,21 @@
|
|||||||
layout="${longdate} ${uppercase:${level}} ${message}" />
|
layout="${longdate} ${uppercase:${level}} ${message}" />
|
||||||
<target xsi:type="File" name="fDebug" fileName="${basedir}/Filtration_debug_${shortdate}.log"
|
<target xsi:type="File" name="fDebug" fileName="${basedir}/Filtration_debug_${shortdate}.log"
|
||||||
layout="${longdate} ${uppercase:${level}} ${message}" />
|
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}"/>
|
<target xsi:type="Debugger" name="cDebug" layout="${longdate} ${uppercase:${level}} ${message}"/>
|
||||||
</targets>
|
</targets>
|
||||||
|
|
||||||
<rules>
|
<rules>
|
||||||
|
|
||||||
|
<!-- Squirrel Updater Log-->
|
||||||
|
<logger name="SquirrelLogger" minlevel="Trace" writeTo="fUpdater" />
|
||||||
|
|
||||||
<!-- Uncomment the Debug line to enable Debug logging -->
|
<!-- Uncomment the Debug line to enable Debug logging -->
|
||||||
<!--<logger name="*" minlevel="Debug" writeTo="fDebug" final="true" />-->
|
<!--<logger name="*" minlevel="Debug" writeTo="fDebug" final="true" />-->
|
||||||
<logger name="*" minlevel="Error" writeTo="fErrors" />
|
<logger name="*" minlevel="Error" writeTo="fErrors" />
|
||||||
<logger name="*" minlevel="Trace" writeTo="cDebug" />
|
<logger name="*" minlevel="Trace" writeTo="cDebug" />
|
||||||
|
|
||||||
|
|
||||||
</rules>
|
</rules>
|
||||||
</nlog>
|
</nlog>
|
||||||
@@ -11,7 +11,7 @@ using System.Runtime.CompilerServices;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.1.0")]
|
[assembly: AssemblyVersion("1.1.0")]
|
||||||
[assembly: AssemblyInformationalVersion("1.1.0-beta8")]
|
[assembly: AssemblyInformationalVersion("1.1.0")]
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.Tests")]
|
||||||
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
[assembly: InternalsVisibleTo("Filtration.ItemFilterPreview.Tests")]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Filtration.Enums;
|
using Filtration.Enums;
|
||||||
using Filtration.Properties;
|
using Filtration.Properties;
|
||||||
|
using Filtration.Utility;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Squirrel;
|
using Squirrel;
|
||||||
|
|
||||||
@@ -78,11 +79,14 @@ namespace Filtration.Services
|
|||||||
private bool _downloadPrereleaseUpdates;
|
private bool _downloadPrereleaseUpdates;
|
||||||
private UpdateStatus _updateStatus;
|
private UpdateStatus _updateStatus;
|
||||||
|
|
||||||
public UpdateService(ISettingsService settingsService)
|
public UpdateService(ISettingsService settingsService,
|
||||||
|
ISplatNLogAdapter splatNLogAdapter)
|
||||||
{
|
{
|
||||||
_settingsService = settingsService;
|
_settingsService = settingsService;
|
||||||
|
|
||||||
UpdateStatus = UpdateStatus.NoUpdateAvailable;
|
UpdateStatus = UpdateStatus.NoUpdateAvailable;
|
||||||
|
|
||||||
|
Splat.Locator.CurrentMutable.Register(() => splatNLogAdapter, typeof(Splat.ILogger));
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler<UpdateStatusChangedEventArgs> UpdateStatusChanged;
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,7 +39,7 @@ namespace Filtration.ViewModels.DesignTime
|
|||||||
|
|
||||||
public bool IsScript { get; }
|
public bool IsScript { get; }
|
||||||
public bool IsTheme { get; }
|
public bool IsTheme { get; }
|
||||||
public Task Close()
|
public Task<bool> Close()
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
for (var i = 0; i < SelectedBlockViewModels.Count; i++)
|
for (var i = 0; i < SelectedBlockViewModels.Count; i++)
|
||||||
{
|
{
|
||||||
if (!ViewItemFilterBlockViewModels.Contains(SelectedBlockViewModels[i]))
|
if (SelectedBlockViewModels[i] == null || !ViewItemFilterBlockViewModels.Contains(SelectedBlockViewModels[i]))
|
||||||
{
|
{
|
||||||
SelectedBlockViewModels.RemoveAt(i--);
|
SelectedBlockViewModels.RemoveAt(i--);
|
||||||
}
|
}
|
||||||
@@ -562,6 +562,8 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public bool CanModifySelectedBlocks()
|
public bool CanModifySelectedBlocks()
|
||||||
{
|
{
|
||||||
|
ValidateSelectedBlocks();
|
||||||
|
|
||||||
if (SelectedBlockViewModels.Count < 1)
|
if (SelectedBlockViewModels.Count < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -799,14 +801,14 @@ namespace Filtration.ViewModels
|
|||||||
await Close();
|
await Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Close()
|
public async Task<bool> Close()
|
||||||
{
|
{
|
||||||
if (!IsDirty)
|
if (!IsDirty)
|
||||||
{
|
{
|
||||||
CloseScript();
|
CloseScript();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
var result = _messageBoxService.Show("Filtration",
|
var result = _messageBoxService.Show("Filtration",
|
||||||
"Save script \"" + Filename + "\"?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
|
"Save script \"" + Filename + "\"?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
|
||||||
|
|
||||||
@@ -816,17 +818,20 @@ namespace Filtration.ViewModels
|
|||||||
{
|
{
|
||||||
await SaveAsync();
|
await SaveAsync();
|
||||||
CloseScript();
|
CloseScript();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.No:
|
case MessageBoxResult.No:
|
||||||
{
|
{
|
||||||
CloseScript();
|
CloseScript();
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.Cancel:
|
case MessageBoxResult.Cancel:
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -768,7 +768,10 @@ namespace Filtration.ViewModels
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
await document.Close();
|
if (!await document.Close())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Filtration.ViewModels
|
|||||||
public bool IsScript => false;
|
public bool IsScript => false;
|
||||||
public bool IsTheme => false;
|
public bool IsTheme => false;
|
||||||
|
|
||||||
public Task Close()
|
public Task<bool> Close()
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,9 +65,10 @@ namespace Filtration.ViewModels
|
|||||||
|
|
||||||
public bool IsInErrorState => UpdateStatus == UpdateStatus.Error;
|
public bool IsInErrorState => UpdateStatus == UpdateStatus.Error;
|
||||||
|
|
||||||
public async Task Close()
|
public async Task<bool> Close()
|
||||||
{
|
{
|
||||||
await Task.FromResult(true);
|
await Task.FromResult(true);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelayCommand CloseCommand { get; }
|
public RelayCommand CloseCommand { get; }
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ namespace Filtration.Views
|
|||||||
if (!allDocumentsClosed)
|
if (!allDocumentsClosed)
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Castle.MicroKernel.SubSystems.Configuration;
|
using Castle.MicroKernel.SubSystems.Configuration;
|
||||||
using Castle.Windsor;
|
using Castle.Windsor;
|
||||||
using Filtration.Services;
|
using Filtration.Services;
|
||||||
|
using Filtration.Utility;
|
||||||
|
|
||||||
namespace Filtration.WindsorInstallers
|
namespace Filtration.WindsorInstallers
|
||||||
{
|
{
|
||||||
@@ -58,6 +59,11 @@ namespace Filtration.WindsorInstallers
|
|||||||
Component.For<IDialogService>()
|
Component.For<IDialogService>()
|
||||||
.ImplementedBy<DialogService>()
|
.ImplementedBy<DialogService>()
|
||||||
.LifeStyle.Singleton);
|
.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)
|
## Current Release (Released 2018-09-30)
|
||||||
<b>Installer</b><br>
|
<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
|
## System Requirements
|
||||||
Filtration requires .NET Framework 4.6.1 installed.
|
Filtration requires .NET Framework 4.6.1 installed.
|
||||||
|
|||||||
Reference in New Issue
Block a user