Tidy up, updated ItemBaseTypes and ItemClasses files to Path of Exile 2.3.4
This commit is contained in:
@@ -44,29 +44,30 @@
|
||||
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.2.0.37222, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.2.0.37222, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.2.0.37226, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq">
|
||||
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
<Reference Include="Moq, Version=4.5.9.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.5.9\lib\net45\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MvvmLightLibs.5.2.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
<HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -87,8 +88,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Model\FilteredItem.cs" />
|
||||
<Compile Include="Model\Item.cs" />
|
||||
<Compile Include="Services\BlockItemMatcher.cs" />
|
||||
<Compile Include="Services\ItemFilterProcessor.cs" />
|
||||
<Compile Include="UserControls\DesignTime\DesignTimeItemControl.cs" />
|
||||
@@ -191,6 +190,9 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\muldini.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\" />
|
||||
</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.
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Model
|
||||
{
|
||||
public interface IFilteredItem
|
||||
{
|
||||
IItem Item { get; }
|
||||
IItemFilterBlock ItemFilterBlock { get; }
|
||||
BlockAction BlockAction { get; }
|
||||
Color BackgroundColor { get; }
|
||||
Color BorderColor { get; }
|
||||
Color TextColor { get; }
|
||||
double FontSize { get; }
|
||||
}
|
||||
|
||||
public class FilteredItem : IFilteredItem
|
||||
{
|
||||
public FilteredItem(IItem item, IItemFilterBlock itemFilterBlock)
|
||||
{
|
||||
Item = item;
|
||||
ItemFilterBlock = itemFilterBlock;
|
||||
|
||||
BlockAction = itemFilterBlock?.Action ?? BlockAction.Show;
|
||||
BackgroundColor = itemFilterBlock?.DisplayBackgroundColor ?? new Color { A = 255, R = 0, G = 0, B = 0 };
|
||||
BorderColor = itemFilterBlock?.DisplayBorderColor ?? new Color {A = 255, R = 0, G = 0, B = 0};
|
||||
FontSize = (itemFilterBlock?.DisplayFontSize ?? 34) / 1.8;
|
||||
|
||||
SetTextColor();
|
||||
}
|
||||
|
||||
private void SetTextColor()
|
||||
{
|
||||
if (ItemFilterBlock == null)
|
||||
{
|
||||
TextColor = Item.DefaultTextColor;
|
||||
return;
|
||||
}
|
||||
|
||||
var textColorBlockItem = ItemFilterBlock.BlockItems.OfType<TextColorBlockItem>().FirstOrDefault();
|
||||
TextColor = textColorBlockItem?.Color ?? Item.DefaultTextColor;
|
||||
}
|
||||
|
||||
|
||||
public IItem Item { get; private set; }
|
||||
public IItemFilterBlock ItemFilterBlock { get; private set; }
|
||||
|
||||
public BlockAction BlockAction { get; private set; }
|
||||
public Color BackgroundColor { get; private set; }
|
||||
public Color TextColor { get; private set; }
|
||||
public Color BorderColor { get; private set; }
|
||||
public double FontSize { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.Extensions;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Model
|
||||
{
|
||||
public interface IItem
|
||||
{
|
||||
string Description { get; set; }
|
||||
string ItemClass { get; set; }
|
||||
string BaseType { get; set; }
|
||||
int DropLevel { get; set; }
|
||||
int ItemLevel { get; set; }
|
||||
int Height { get; set; }
|
||||
int Width { get; set; }
|
||||
int Quality { get; set; }
|
||||
ItemRarity ItemRarity { get; set; }
|
||||
int Sockets { get; }
|
||||
int LinkedSockets { get; }
|
||||
IEnumerable<SocketGroup> LinkedSocketGroups { get; }
|
||||
List<SocketGroup> SocketGroups { get; set; }
|
||||
Color DefaultTextColor { get; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Item : IItem
|
||||
{
|
||||
private List<SocketGroup> _socketGroups;
|
||||
|
||||
public string Description { get; set; }
|
||||
public string ItemClass { get; set; }
|
||||
public string BaseType { get; set; }
|
||||
public int DropLevel { get; set; }
|
||||
public int ItemLevel { get; set; }
|
||||
public int Height { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Quality { get; set; }
|
||||
public ItemRarity ItemRarity { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public int Sockets { get; private set; }
|
||||
[XmlIgnore]
|
||||
public int LinkedSockets { get; private set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IEnumerable<SocketGroup> LinkedSocketGroups
|
||||
{
|
||||
get { return SocketGroups.Where(s => s.Linked); }
|
||||
}
|
||||
|
||||
public List<SocketGroup> SocketGroups
|
||||
{
|
||||
get { return _socketGroups; }
|
||||
set
|
||||
{
|
||||
var socketCount = value.Sum(s => s.Count);
|
||||
if (socketCount < 0 || socketCount > 6)
|
||||
{
|
||||
throw new InvalidOperationException("An item must have between 0 and 6 sockets");
|
||||
}
|
||||
|
||||
var evenSocketCount = socketCount % 2 == 0;
|
||||
var maxSocketGroups = Math.Max(1, evenSocketCount ? socketCount / 2 : socketCount - 1);
|
||||
var maxLinkedSocketGroups = Math.Max(1, evenSocketCount ? maxSocketGroups : maxSocketGroups - 1);
|
||||
|
||||
if (value.Count > maxSocketGroups)
|
||||
{
|
||||
throw new InvalidOperationException("Invalid number of socket groups for the socket count of this item");
|
||||
}
|
||||
|
||||
if (value.Count(s => s.Linked) > maxLinkedSocketGroups)
|
||||
{
|
||||
throw new InvalidOperationException("Invalid number of linked socket groups for the socket count of this item");
|
||||
}
|
||||
|
||||
_socketGroups = value;
|
||||
Sockets = socketCount;
|
||||
|
||||
var linkedSocketGroups = value.Where(s => s.Linked).ToList();
|
||||
LinkedSockets = linkedSocketGroups.Any() ? linkedSocketGroups.Max(s => s.Count) : 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Color DefaultTextColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ItemClass.Contains("Gems"))
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.GemItem];
|
||||
}
|
||||
if (ItemClass.Contains("Quest"))
|
||||
{
|
||||
return PathOfExileNamedColors.Colors[PathOfExileNamedColor.QuestItem];
|
||||
}
|
||||
|
||||
return ItemRarity != ItemRarity.NotSet ? ItemRarity.DefaultRarityTextColor() : PathOfExileNamedColors.Colors[PathOfExileNamedColor.WhiteItem];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Linq;
|
||||
using Filtration.ItemFilterPreview.Model;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemBaseTypes;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
@@ -106,7 +105,7 @@ namespace Filtration.ItemFilterPreview.Services
|
||||
|
||||
private static bool SocketsBlockItemMatch(SocketsBlockItem socketsBlockItem, IItem item)
|
||||
{
|
||||
return NumericFilterPredicateBlockItemMatch(socketsBlockItem, item.Sockets);
|
||||
return NumericFilterPredicateBlockItemMatch(socketsBlockItem, item.SocketCount);
|
||||
}
|
||||
|
||||
private static bool WidthBlockItemMatch(WidthBlockItem widthBlockItem, IItem item)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Filtration.ItemFilterPreview.Model;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Services
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ItemFilterPreview.Model;
|
||||
using Filtration.ObjectModel;
|
||||
using Moq;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.UserControls.DesignTime
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.UserControls
|
||||
{
|
||||
public partial class ItemControl
|
||||
{
|
||||
public ItemControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
// ReSharper disable once PossibleNullReferenceException
|
||||
(Content as FrameworkElement).DataContext = this;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FilteredItemProperty = DependencyProperty.Register(
|
||||
"FilteredItem",
|
||||
typeof (IFilteredItem),
|
||||
typeof (ItemControl),
|
||||
new FrameworkPropertyMetadata()
|
||||
);
|
||||
|
||||
public IFilteredItem FilteredItem
|
||||
{
|
||||
get { return (IFilteredItem)GetValue(FilteredItemProperty); }
|
||||
set { SetValue(FilteredItemProperty, value); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,30 +4,30 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||
mc:Ignorable="d" SizeChanged="ItemSocketsControl_OnSizeChanged" RenderOptions.EdgeMode="Aliased"
|
||||
Height="30" Width="20" >
|
||||
mc:Ignorable="d" SizeChanged="ItemSocketsControl_OnSizeChanged" RenderOptions.EdgeMode="Aliased" SnapsToDevicePixels="True"
|
||||
Height="29" Width="17" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="2"/>
|
||||
<RowDefinition Height="3"/>
|
||||
<RowDefinition Height="2"/>
|
||||
<RowDefinition Height="4"/>
|
||||
<RowDefinition Height="2"/>
|
||||
<RowDefinition Height="3"/>
|
||||
<RowDefinition Height="2"/>
|
||||
<RowDefinition Height="4"/>
|
||||
<RowDefinition Height="2"/>
|
||||
<RowDefinition Height="3"/>
|
||||
<RowDefinition Height="2"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="3" Background="Tomato" />
|
||||
|
||||
@@ -4,14 +4,19 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||
xmlns:model="clr-namespace:Filtration.ItemFilterPreview.Model"
|
||||
xmlns:model="clr-namespace:Filtration.ObjectModel;assembly=Filtration.ObjectModel"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:LootExplosionSceneUserControl}">
|
||||
<Grid Background="DimGray">
|
||||
<ItemsControl ItemsSource="{Binding FilteredItems}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Click="ButtonBase_OnClick">Test Canvas</Button>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding FilteredItems}" x:Name="FilteredItemsControl" Height="800">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
<Canvas />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Filtration.ItemFilterPreview.Model;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.UserControls
|
||||
{
|
||||
@@ -22,7 +26,57 @@ namespace Filtration.ItemFilterPreview.UserControls
|
||||
public IEnumerable<IFilteredItem> FilteredItems
|
||||
{
|
||||
get { return (IEnumerable<IFilteredItem>)GetValue(FilteredItemsProperty); }
|
||||
set { SetValue(FilteredItemsProperty, value); }
|
||||
set
|
||||
{
|
||||
SetValue(FilteredItemsProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void LootCanvas_OnSourceUpdated(object sender, DataTransferEventArgs e)
|
||||
{
|
||||
var canvas = sender as Canvas;
|
||||
|
||||
}
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var canvas = GetItemsPanel(FilteredItemsControl) as Canvas;
|
||||
if (canvas == null) return;
|
||||
var rand = new Random();
|
||||
|
||||
foreach (var child in canvas.Children.OfType<ContentPresenter>())
|
||||
{
|
||||
Canvas.SetLeft(child, rand.Next((int)(canvas.ActualWidth - child.ActualWidth)));
|
||||
Canvas.SetTop(child, rand.Next((int)(canvas.ActualHeight - child.ActualHeight)));
|
||||
}
|
||||
}
|
||||
|
||||
private static Panel GetItemsPanel(DependencyObject itemsControl)
|
||||
{
|
||||
var itemsPresenter = GetVisualChild<ItemsPresenter>(itemsControl);
|
||||
var itemsPanel = VisualTreeHelper.GetChild(itemsPresenter, 0) as Panel;
|
||||
return itemsPanel;
|
||||
}
|
||||
|
||||
private static T GetVisualChild<T>(DependencyObject parent) where T : Visual
|
||||
{
|
||||
var child = default(T);
|
||||
|
||||
var numVisuals = VisualTreeHelper.GetChildrenCount(parent);
|
||||
for (var i = 0; i < numVisuals; i++)
|
||||
{
|
||||
var v = (Visual)VisualTreeHelper.GetChild(parent, i);
|
||||
child = v as T;
|
||||
if (child == null)
|
||||
{
|
||||
child = GetVisualChild<T>(v);
|
||||
}
|
||||
if (child != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
189
Filtration.ItemFilterPreview/ViewModels/MainWindowViewModel.cs
Normal file
189
Filtration.ItemFilterPreview/ViewModels/MainWindowViewModel.cs
Normal file
@@ -0,0 +1,189 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using Filtration.ItemFilterPreview.Properties;
|
||||
using Filtration.ItemFilterPreview.Services;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.Parser.Interface.Services;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.ViewModels
|
||||
{
|
||||
internal interface IMainWindowViewModel
|
||||
{
|
||||
}
|
||||
|
||||
internal class MainWindowViewModel : ViewModelBase, IMainWindowViewModel
|
||||
{
|
||||
private readonly IItemFilterScriptTranslator _itemFilterScriptTranslator;
|
||||
private readonly IItemFilterProcessor _itemFilterProcessor;
|
||||
private IItemFilterScript _itemFilterScript;
|
||||
|
||||
|
||||
public MainWindowViewModel(IItemFilterScriptTranslator itemFilterScriptTranslator, IItemFilterProcessor itemFilterProcessor)
|
||||
{
|
||||
_itemFilterScriptTranslator = itemFilterScriptTranslator;
|
||||
_itemFilterProcessor = itemFilterProcessor;
|
||||
LoadScriptCommand = new RelayCommand(OnLoadScriptCommand);
|
||||
LoadAlternateScriptCommand = new RelayCommand(OnLoadAlternateScriptCommand);
|
||||
ProcessItemFilterCommand = new RelayCommand(OnProcessItemFilterCommand);
|
||||
}
|
||||
|
||||
public RelayCommand LoadScriptCommand { get; private set; }
|
||||
public RelayCommand LoadAlternateScriptCommand { get; private set; }
|
||||
public RelayCommand ProcessItemFilterCommand { get; private set; }
|
||||
|
||||
public IEnumerable<IFilteredItem> FilteredItems
|
||||
{
|
||||
get { return _filteredItems; }
|
||||
private set
|
||||
{
|
||||
_filteredItems = value;
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnLoadScriptCommand()
|
||||
{
|
||||
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.neversinkfilter);
|
||||
}
|
||||
|
||||
private void OnLoadAlternateScriptCommand()
|
||||
{
|
||||
_itemFilterScript = _itemFilterScriptTranslator.TranslateStringToItemFilterScript(Resources.muldini);
|
||||
}
|
||||
|
||||
private void OnProcessItemFilterCommand()
|
||||
{
|
||||
FilteredItems = _itemFilterProcessor.ProcessItemsAgainstItemFilterScript(_itemFilterScript, TestItems);
|
||||
}
|
||||
|
||||
private readonly List<IItem> TestItems = new List<IItem>
|
||||
{
|
||||
new Item
|
||||
{
|
||||
Description = "Full Plate",
|
||||
BaseType = "Full Plate",
|
||||
ItemClass = "Body Armors",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 66,
|
||||
DropLevel = 28,
|
||||
Height = 3,
|
||||
Width = 2,
|
||||
SocketGroups = new List<SocketGroup> {new SocketGroup(new List<Socket> { new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) , new Socket(SocketColor.Red) }, true)}
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Scroll of Wisdom",
|
||||
BaseType = "Scroll of Wisdom",
|
||||
ItemClass = "Currency",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 75,
|
||||
DropLevel = 1,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Unset Ring",
|
||||
BaseType = "Unset Ring",
|
||||
ItemClass = "Rings",
|
||||
ItemRarity = ItemRarity.Rare,
|
||||
ItemLevel = 53,
|
||||
DropLevel = 45,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Incinerate",
|
||||
BaseType = "Incinerate",
|
||||
ItemClass = "Active Skill Gems",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 9,
|
||||
DropLevel = 9,
|
||||
Quality = 10,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Mirror of Kalandra",
|
||||
BaseType = "Mirror of Kalandra",
|
||||
ItemClass = "Currency",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 77,
|
||||
DropLevel = 1,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "The Gemcutter",
|
||||
BaseType = "The Gemcutter",
|
||||
ItemClass = "Divination Card",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 1,
|
||||
DropLevel = 72,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Thaumetic Sulphite",
|
||||
BaseType = "Thaumetic Sulphite",
|
||||
ItemClass = "Quest Items",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 32,
|
||||
DropLevel = 1,
|
||||
Height = 2,
|
||||
Width = 2,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Fishing Rod",
|
||||
BaseType = "Fishing Rod",
|
||||
ItemClass = "Fishing Rods",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 1,
|
||||
DropLevel = 1,
|
||||
Height = 4,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Dry Peninsula Map",
|
||||
BaseType = "Dry Peninsula Map",
|
||||
ItemClass = "Maps",
|
||||
ItemRarity = ItemRarity.Magic,
|
||||
ItemLevel = 75,
|
||||
DropLevel = 75,
|
||||
Height = 1,
|
||||
Width = 1,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
},
|
||||
new Item
|
||||
{
|
||||
Description = "Stone Hammer",
|
||||
BaseType = "Stone Hammer",
|
||||
ItemClass = "One Hand Maces",
|
||||
ItemRarity = ItemRarity.Normal,
|
||||
ItemLevel = 1,
|
||||
DropLevel = 1,
|
||||
Height = 3,
|
||||
Width = 2,
|
||||
SocketGroups = new List<SocketGroup>()
|
||||
}
|
||||
};
|
||||
|
||||
private IEnumerable<IFilteredItem> _filteredItems;
|
||||
}
|
||||
}
|
||||
22
Filtration.ItemFilterPreview/Views/MainWindow.xaml
Normal file
22
Filtration.ItemFilterPreview/Views/MainWindow.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<Window x:Class="Filtration.ItemFilterPreview.Views.MainWindow"
|
||||
x:ClassModifier="internal"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:userControls="clr-namespace:Filtration.ItemFilterPreview.UserControls"
|
||||
xmlns:viewModels="clr-namespace:Filtration.ItemFilterPreview.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
|
||||
Title="MainWindow" Height="960" Width="1280" >
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Command="{Binding LoadScriptCommand}">Load Neversink Script</Button>
|
||||
<Button Command="{Binding LoadAlternateScriptCommand}">Load Muldini Script</Button>
|
||||
</StackPanel>
|
||||
<Button Command="{Binding ProcessItemFilterCommand}">Process Item Filter</Button>
|
||||
<userControls:LootExplosionSceneUserControl FilteredItems="{Binding FilteredItems}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
18
Filtration.ItemFilterPreview/Views/MainWindow.xaml.cs
Normal file
18
Filtration.ItemFilterPreview/Views/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Filtration.ItemFilterPreview.ViewModels;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Views
|
||||
{
|
||||
public interface IMainWindow
|
||||
{
|
||||
void Show();
|
||||
}
|
||||
|
||||
internal partial class MainWindow : IMainWindow
|
||||
{
|
||||
public MainWindow(IMainWindowViewModel mainWindowViewModel)
|
||||
{
|
||||
DataContext = mainWindowViewModel;
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,6 @@
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
|
||||
<package id="Castle.Windsor" version="3.3.0" targetFramework="net461" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net461" />
|
||||
<package id="MvvmLightLibs" version="5.2.0.0" targetFramework="net461" />
|
||||
<package id="Moq" version="4.5.9" targetFramework="net461" />
|
||||
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net461" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user