Various bug fixes, added standard POE colours to ColorPickers
This commit is contained in:
parent
aa433ad685
commit
08a193dc6b
|
@ -112,6 +112,7 @@
|
||||||
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
|
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
|
||||||
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
||||||
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
||||||
|
<Compile Include="Converters\HashSignRemovalConverter.cs" />
|
||||||
<Compile Include="Converters\ItemRarityConverter.cs" />
|
<Compile Include="Converters\ItemRarityConverter.cs" />
|
||||||
<Compile Include="Converters\BooleanVisibilityConverter.cs" />
|
<Compile Include="Converters\BooleanVisibilityConverter.cs" />
|
||||||
<Compile Include="Converters\StringToVisibilityConverter.cs" />
|
<Compile Include="Converters\StringToVisibilityConverter.cs" />
|
||||||
|
@ -189,7 +190,9 @@
|
||||||
<Compile Include="Views\AvalonDock\AvalonDockWorkspaceView.xaml.cs">
|
<Compile Include="Views\AvalonDock\AvalonDockWorkspaceView.xaml.cs">
|
||||||
<DependentUpon>AvalonDockWorkspaceView.xaml</DependentUpon>
|
<DependentUpon>AvalonDockWorkspaceView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Views\Behaviors\BindableSelectedItemBehavior.cs" />
|
||||||
<Compile Include="Views\BindingProxy.cs" />
|
<Compile Include="Views\BindingProxy.cs" />
|
||||||
|
<Compile Include="Views\PathOfExileColors.cs" />
|
||||||
<Compile Include="Views\ToolPanes\BlockGroupBrowserView.xaml.cs">
|
<Compile Include="Views\ToolPanes\BlockGroupBrowserView.xaml.cs">
|
||||||
<DependentUpon>BlockGroupBrowserView.xaml</DependentUpon>
|
<DependentUpon>BlockGroupBrowserView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -367,6 +370,8 @@
|
||||||
<Resource Include="Resources\filtration.ico" />
|
<Resource Include="Resources\filtration.ico" />
|
||||||
<Resource Include="Resources\Icons\replace_colors_icon.png" />
|
<Resource Include="Resources\Icons\replace_colors_icon.png" />
|
||||||
<Resource Include="Resources\Icons\block_group_browser_icon.png" />
|
<Resource Include="Resources\Icons\block_group_browser_icon.png" />
|
||||||
|
<Resource Include="Resources\Icons\clear_filter_icon.png" />
|
||||||
|
<Resource Include="Resources\Icons\filter_icon.png" />
|
||||||
<Content Include="Resources\ItemBaseTypes.txt">
|
<Content Include="Resources\ItemBaseTypes.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -6,6 +6,7 @@ namespace Filtration.Models.BlockItemTypes
|
||||||
{
|
{
|
||||||
public FontSizeBlockItem()
|
public FontSizeBlockItem()
|
||||||
{
|
{
|
||||||
|
Value = 35;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FontSizeBlockItem(int value) : base(value)
|
public FontSizeBlockItem(int value) : base(value)
|
||||||
|
|
|
@ -75,6 +75,25 @@ namespace Filtration.Models
|
||||||
return BlockItems.Count(b => b is T) > 0;
|
return BlockItems.Count(b => b is T) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool HasBlockGroupInParentHierarchy(ItemFilterBlockGroup targetBlockGroup, ItemFilterBlockGroup startingBlockGroup)
|
||||||
|
{
|
||||||
|
if (startingBlockGroup == targetBlockGroup)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (BlockGroup == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startingBlockGroup.ParentGroup != null)
|
||||||
|
{
|
||||||
|
return HasBlockGroupInParentHierarchy(targetBlockGroup, startingBlockGroup.ParentGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnBlockGroupStatusChanged(object sender, EventArgs e)
|
private void OnBlockGroupStatusChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (BlockGroup.IsChecked == false && Action == BlockAction.Show)
|
if (BlockGroup.IsChecked == false && Action == BlockAction.Show)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 398 B |
Binary file not shown.
After Width: | Height: | Size: 202 B |
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Castle.Core.Internal;
|
||||||
using Filtration.Models;
|
using Filtration.Models;
|
||||||
using Filtration.Utilities;
|
using Filtration.Utilities;
|
||||||
|
|
||||||
|
@ -43,7 +44,11 @@ namespace Filtration.Translators
|
||||||
script.Description += lines[i].Substring(1).Trim(' ') + Environment.NewLine;
|
script.Description += lines[i].Substring(1).Trim(' ') + Environment.NewLine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!script.Description.IsNullOrEmpty())
|
||||||
|
{
|
||||||
script.Description = script.Description.TrimEnd('\n').TrimEnd('\r');
|
script.Description = script.Description.TrimEnd('\n').TrimEnd('\r');
|
||||||
|
}
|
||||||
|
|
||||||
// Extract each block from between boundaries and translate it into a ItemFilterBlock object
|
// Extract each block from between boundaries and translate it into a ItemFilterBlock object
|
||||||
// and add that object to the ItemFilterBlocks list
|
// and add that object to the ItemFilterBlocks list
|
||||||
|
|
|
@ -10,6 +10,7 @@ using Filtration.Models.BlockItemTypes;
|
||||||
using Filtration.Services;
|
using Filtration.Services;
|
||||||
using Filtration.Views;
|
using Filtration.Views;
|
||||||
using GalaSoft.MvvmLight.CommandWpf;
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
using Xceed.Wpf.Toolkit;
|
||||||
|
|
||||||
namespace Filtration.ViewModels
|
namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -187,11 +188,25 @@ namespace Filtration.ViewModels
|
||||||
return Block.Description;
|
return Block.Description;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (Block.Description != value)
|
||||||
{
|
{
|
||||||
Block.Description = value;
|
Block.Description = value;
|
||||||
|
IsDirty = true;
|
||||||
RaisePropertyChanged();
|
RaisePropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<ColorItem> AvailableColors
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
{
|
||||||
|
return PathOfExileColors.DefaultColors;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool HasTextColor
|
public bool HasTextColor
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Castle.Core.Internal;
|
using Castle.Core.Internal;
|
||||||
|
using Filtration.Enums;
|
||||||
using Filtration.Models;
|
using Filtration.Models;
|
||||||
using Filtration.Services;
|
using Filtration.Services;
|
||||||
using Filtration.Translators;
|
using Filtration.Translators;
|
||||||
|
@ -22,11 +25,12 @@ namespace Filtration.ViewModels
|
||||||
IItemFilterBlockViewModel SectionBrowserSelectedBlockViewModel { get; set; }
|
IItemFilterBlockViewModel SectionBrowserSelectedBlockViewModel { get; set; }
|
||||||
IEnumerable<ItemFilterBlockGroup> BlockGroups { get; }
|
IEnumerable<ItemFilterBlockGroup> BlockGroups { get; }
|
||||||
IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels { get; }
|
IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels { get; }
|
||||||
|
Predicate<IItemFilterBlockViewModel> BlockFilterPredicate { get; set; }
|
||||||
bool IsDirty { get; }
|
bool IsDirty { get; }
|
||||||
string Description { get; set; }
|
string Description { get; set; }
|
||||||
string DisplayName { get; }
|
string DisplayName { get; }
|
||||||
|
|
||||||
void Initialise(ItemFilterScript itemFilterScript);
|
void Initialise(ItemFilterScript itemFilterScript, bool newScript);
|
||||||
void RemoveDirtyFlag();
|
void RemoveDirtyFlag();
|
||||||
void SaveScript();
|
void SaveScript();
|
||||||
void SaveScriptAs();
|
void SaveScriptAs();
|
||||||
|
@ -47,12 +51,23 @@ namespace Filtration.ViewModels
|
||||||
private bool _isDirty;
|
private bool _isDirty;
|
||||||
private IItemFilterBlockViewModel _selectedBlockViewModel;
|
private IItemFilterBlockViewModel _selectedBlockViewModel;
|
||||||
private IItemFilterBlockViewModel _sectionBrowserSelectedBlockViewModel;
|
private IItemFilterBlockViewModel _sectionBrowserSelectedBlockViewModel;
|
||||||
|
private readonly ObservableCollection<IItemFilterBlockViewModel> _itemFilterBlockViewModels;
|
||||||
|
private ICollectionView _itemFilterBlockViewModelsCollectionView;
|
||||||
|
private Predicate<IItemFilterBlockViewModel> _blockFilterPredicate;
|
||||||
|
|
||||||
public ItemFilterScriptViewModel(IItemFilterBlockViewModelFactory itemFilterBlockViewModelFactory,
|
public ItemFilterScriptViewModel(IItemFilterBlockViewModelFactory itemFilterBlockViewModelFactory,
|
||||||
IItemFilterBlockTranslator blockTranslator,
|
IItemFilterBlockTranslator blockTranslator,
|
||||||
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
IAvalonDockWorkspaceViewModel avalonDockWorkspaceViewModel,
|
||||||
IItemFilterPersistenceService persistenceService)
|
IItemFilterPersistenceService persistenceService)
|
||||||
{
|
{
|
||||||
|
_itemFilterBlockViewModelFactory = itemFilterBlockViewModelFactory;
|
||||||
|
_blockTranslator = blockTranslator;
|
||||||
|
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
||||||
|
_avalonDockWorkspaceViewModel.ActiveDocumentChanged += OnActiveDocumentChanged;
|
||||||
|
_persistenceService = persistenceService;
|
||||||
|
_itemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModel>();
|
||||||
|
|
||||||
|
ClearFilterCommand = new RelayCommand(OnClearFilterCommand, () => BlockFilterPredicate != null);
|
||||||
CloseCommand = new RelayCommand(OnCloseCommand);
|
CloseCommand = new RelayCommand(OnCloseCommand);
|
||||||
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null);
|
DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null);
|
||||||
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null);
|
MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null);
|
||||||
|
@ -63,13 +78,9 @@ namespace Filtration.ViewModels
|
||||||
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => SelectedBlockViewModel != null);
|
AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => SelectedBlockViewModel != null);
|
||||||
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => SelectedBlockViewModel != null);
|
CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => SelectedBlockViewModel != null);
|
||||||
PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null);
|
PasteBlockCommand = new RelayCommand(OnPasteBlockCommand, () => SelectedBlockViewModel != null);
|
||||||
_itemFilterBlockViewModelFactory = itemFilterBlockViewModelFactory;
|
|
||||||
_blockTranslator = blockTranslator;
|
|
||||||
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
|
||||||
_persistenceService = persistenceService;
|
|
||||||
ItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModel>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RelayCommand ClearFilterCommand { get; private set; }
|
||||||
public RelayCommand CloseCommand { get; private set; }
|
public RelayCommand CloseCommand { get; private set; }
|
||||||
public RelayCommand DeleteBlockCommand { get; private set; }
|
public RelayCommand DeleteBlockCommand { get; private set; }
|
||||||
public RelayCommand MoveBlockToTopCommand { get; private set; }
|
public RelayCommand MoveBlockToTopCommand { get; private set; }
|
||||||
|
@ -81,7 +92,42 @@ namespace Filtration.ViewModels
|
||||||
public RelayCommand CopyBlockCommand { get; private set; }
|
public RelayCommand CopyBlockCommand { get; private set; }
|
||||||
public RelayCommand PasteBlockCommand { get; private set; }
|
public RelayCommand PasteBlockCommand { get; private set; }
|
||||||
|
|
||||||
public ObservableCollection<IItemFilterBlockViewModel> ItemFilterBlockViewModels { get; private set; }
|
public ObservableCollection<IItemFilterBlockViewModel> ItemFilterBlockViewModels
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
_itemFilterBlockViewModelsCollectionView =
|
||||||
|
CollectionViewSource.GetDefaultView(_itemFilterBlockViewModels);
|
||||||
|
if (BlockFilterPredicate != null)
|
||||||
|
{
|
||||||
|
_itemFilterBlockViewModelsCollectionView.Filter = BlockFilter;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_itemFilterBlockViewModelsCollectionView.Filter = null;
|
||||||
|
}
|
||||||
|
return _itemFilterBlockViewModels;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool BlockFilter(object item)
|
||||||
|
{
|
||||||
|
var blockViewModel = item as IItemFilterBlockViewModel;
|
||||||
|
return BlockFilterPredicate(blockViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Predicate<IItemFilterBlockViewModel> BlockFilterPredicate
|
||||||
|
{
|
||||||
|
get { return _blockFilterPredicate; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_blockFilterPredicate = value;
|
||||||
|
RaisePropertyChanged("ItemFilterBlockViewModels");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<IItemFilterBlockViewModel> DisplayedItemFilterBlockViewModels { get; private set; }
|
||||||
|
|
||||||
public IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels
|
public IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels
|
||||||
{
|
{
|
||||||
|
@ -99,7 +145,7 @@ namespace Filtration.ViewModels
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Script.Description = value;
|
Script.Description = value;
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
RaisePropertyChanged();
|
RaisePropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,21 +182,20 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
get { return _isDirty || HasDirtyChildren; }
|
get { return _isDirty || HasDirtyChildren; }
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (_isDirty != value)
|
||||||
{
|
{
|
||||||
_isDirty = value;
|
_isDirty = value;
|
||||||
|
if (_isDirty)
|
||||||
|
{
|
||||||
|
Title = Filename + "*";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Title = Filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HasDirtyChildren
|
|
||||||
{
|
|
||||||
get { return ItemFilterBlockViewModels.Any(vm => vm.IsDirty); }
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CleanChildren()
|
|
||||||
{
|
|
||||||
foreach (var vm in ItemFilterBlockViewModels)
|
|
||||||
{
|
|
||||||
vm.IsDirty = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +222,9 @@ namespace Filtration.ViewModels
|
||||||
get { return Script.FilePath; }
|
get { return Script.FilePath; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(ItemFilterScript itemFilterScript)
|
private bool _filenameIsFake;
|
||||||
|
|
||||||
|
public void Initialise(ItemFilterScript itemFilterScript, bool newScript)
|
||||||
{
|
{
|
||||||
ItemFilterBlockViewModels.Clear();
|
ItemFilterBlockViewModels.Clear();
|
||||||
|
|
||||||
|
@ -189,6 +236,13 @@ namespace Filtration.ViewModels
|
||||||
ItemFilterBlockViewModels.Add(vm);
|
ItemFilterBlockViewModels.Add(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_filenameIsFake = newScript;
|
||||||
|
|
||||||
|
if (newScript)
|
||||||
|
{
|
||||||
|
Script.FilePath = "Untitled.filter";
|
||||||
|
}
|
||||||
|
|
||||||
Title = Filename;
|
Title = Filename;
|
||||||
ContentId = "testcontentid";
|
ContentId = "testcontentid";
|
||||||
}
|
}
|
||||||
|
@ -197,7 +251,7 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
if (!ValidateScript()) return;
|
if (!ValidateScript()) return;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Script.FilePath))
|
if (_filenameIsFake)
|
||||||
{
|
{
|
||||||
SaveScriptAs();
|
SaveScriptAs();
|
||||||
return;
|
return;
|
||||||
|
@ -235,6 +289,8 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
Script.FilePath = saveDialog.FileName;
|
Script.FilePath = saveDialog.FileName;
|
||||||
_persistenceService.SaveItemFilterScript(Script);
|
_persistenceService.SaveItemFilterScript(Script);
|
||||||
|
_filenameIsFake = false;
|
||||||
|
Title = Filename;
|
||||||
RemoveDirtyFlag();
|
RemoveDirtyFlag();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -245,6 +301,27 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnActiveDocumentChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_avalonDockWorkspaceViewModel.ActiveScriptViewModel != this)
|
||||||
|
{
|
||||||
|
BlockFilterPredicate = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HasDirtyChildren
|
||||||
|
{
|
||||||
|
get { return ItemFilterBlockViewModels.Any(vm => vm.IsDirty); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CleanChildren()
|
||||||
|
{
|
||||||
|
foreach (var vm in ItemFilterBlockViewModels)
|
||||||
|
{
|
||||||
|
vm.IsDirty = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool ValidateScript()
|
private bool ValidateScript()
|
||||||
{
|
{
|
||||||
var result = Script.Validate();
|
var result = Script.Validate();
|
||||||
|
@ -265,11 +342,16 @@ namespace Filtration.ViewModels
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnCloseCommand()
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
if (!IsDirty)
|
if (!IsDirty)
|
||||||
{
|
{
|
||||||
_avalonDockWorkspaceViewModel.CloseDocument(this);
|
CloseScript();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -280,12 +362,12 @@ namespace Filtration.ViewModels
|
||||||
case MessageBoxResult.Yes:
|
case MessageBoxResult.Yes:
|
||||||
{
|
{
|
||||||
SaveScript();
|
SaveScript();
|
||||||
_avalonDockWorkspaceViewModel.CloseDocument(this);
|
CloseScript();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.No:
|
case MessageBoxResult.No:
|
||||||
{
|
{
|
||||||
_avalonDockWorkspaceViewModel.CloseDocument(this);
|
CloseScript();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageBoxResult.Cancel:
|
case MessageBoxResult.Cancel:
|
||||||
|
@ -296,9 +378,15 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCloseCommand()
|
private void CloseScript()
|
||||||
{
|
{
|
||||||
Close();
|
_avalonDockWorkspaceViewModel.ActiveDocumentChanged -= OnActiveDocumentChanged;
|
||||||
|
_avalonDockWorkspaceViewModel.CloseDocument(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClearFilterCommand()
|
||||||
|
{
|
||||||
|
BlockFilterPredicate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCopyBlockCommand()
|
private void OnCopyBlockCommand()
|
||||||
|
@ -339,7 +427,7 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedBlockViewModel = vm;
|
SelectedBlockViewModel = vm;
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +447,7 @@ namespace Filtration.ViewModels
|
||||||
Script.ItemFilterBlocks.Remove(block);
|
Script.ItemFilterBlocks.Remove(block);
|
||||||
Script.ItemFilterBlocks.Insert(0, block);
|
Script.ItemFilterBlocks.Insert(0, block);
|
||||||
ItemFilterBlockViewModels.Move(currentIndex, 0);
|
ItemFilterBlockViewModels.Move(currentIndex, 0);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
RaisePropertyChanged("ItemFilterSectionViewModels");
|
RaisePropertyChanged("ItemFilterSectionViewModels");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +468,7 @@ namespace Filtration.ViewModels
|
||||||
Script.ItemFilterBlocks.RemoveAt(blockPos);
|
Script.ItemFilterBlocks.RemoveAt(blockPos);
|
||||||
Script.ItemFilterBlocks.Insert(blockPos - 1, block);
|
Script.ItemFilterBlocks.Insert(blockPos - 1, block);
|
||||||
ItemFilterBlockViewModels.Move(currentIndex, currentIndex - 1);
|
ItemFilterBlockViewModels.Move(currentIndex, currentIndex - 1);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
RaisePropertyChanged("ItemFilterSectionViewModels");
|
RaisePropertyChanged("ItemFilterSectionViewModels");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,7 +489,7 @@ namespace Filtration.ViewModels
|
||||||
Script.ItemFilterBlocks.RemoveAt(blockPos);
|
Script.ItemFilterBlocks.RemoveAt(blockPos);
|
||||||
Script.ItemFilterBlocks.Insert(blockPos + 1, block);
|
Script.ItemFilterBlocks.Insert(blockPos + 1, block);
|
||||||
ItemFilterBlockViewModels.Move(currentIndex, currentIndex + 1);
|
ItemFilterBlockViewModels.Move(currentIndex, currentIndex + 1);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
RaisePropertyChanged("ItemFilterSectionViewModels");
|
RaisePropertyChanged("ItemFilterSectionViewModels");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -421,7 +509,7 @@ namespace Filtration.ViewModels
|
||||||
Script.ItemFilterBlocks.Remove(block);
|
Script.ItemFilterBlocks.Remove(block);
|
||||||
Script.ItemFilterBlocks.Add(block);
|
Script.ItemFilterBlocks.Add(block);
|
||||||
ItemFilterBlockViewModels.Move(currentIndex, ItemFilterBlockViewModels.Count - 1);
|
ItemFilterBlockViewModels.Move(currentIndex, ItemFilterBlockViewModels.Count - 1);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
RaisePropertyChanged("ItemFilterSectionViewModels");
|
RaisePropertyChanged("ItemFilterSectionViewModels");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -449,7 +537,7 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedBlockViewModel = vm;
|
SelectedBlockViewModel = vm;
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAddSectionCommand()
|
private void OnAddSectionCommand()
|
||||||
|
@ -465,7 +553,7 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
Script.ItemFilterBlocks.Insert(Script.ItemFilterBlocks.IndexOf(targetBlockViewModel.Block) + 1, newSection);
|
Script.ItemFilterBlocks.Insert(Script.ItemFilterBlocks.IndexOf(targetBlockViewModel.Block) + 1, newSection);
|
||||||
ItemFilterBlockViewModels.Insert(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1, vm);
|
ItemFilterBlockViewModels.Insert(ItemFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1, vm);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
SelectedBlockViewModel = vm;
|
SelectedBlockViewModel = vm;
|
||||||
RaisePropertyChanged("ItemFilterSectionViewModels");
|
RaisePropertyChanged("ItemFilterSectionViewModels");
|
||||||
}
|
}
|
||||||
|
@ -484,7 +572,7 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
Script.ItemFilterBlocks.Remove(targetBlockViewModel.Block);
|
Script.ItemFilterBlocks.Remove(targetBlockViewModel.Block);
|
||||||
ItemFilterBlockViewModels.Remove(targetBlockViewModel);
|
ItemFilterBlockViewModels.Remove(targetBlockViewModel);
|
||||||
_isDirty = true;
|
IsDirty = true;
|
||||||
}
|
}
|
||||||
SelectedBlockViewModel = null;
|
SelectedBlockViewModel = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace Filtration.ViewModels
|
||||||
_replaceColorsViewModel = replaceColorsViewModel;
|
_replaceColorsViewModel = replaceColorsViewModel;
|
||||||
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
_avalonDockWorkspaceViewModel = avalonDockWorkspaceViewModel;
|
||||||
|
|
||||||
|
|
||||||
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
OpenAboutWindowCommand = new RelayCommand(OnOpenAboutWindowCommand);
|
||||||
OpenScriptCommand = new RelayCommand(OnOpenScriptCommand);
|
OpenScriptCommand = new RelayCommand(OnOpenScriptCommand);
|
||||||
SaveScriptCommand = new RelayCommand(OnSaveScriptCommand, ActiveDocumentIsScript);
|
SaveScriptCommand = new RelayCommand(OnSaveScriptCommand, ActiveDocumentIsScript);
|
||||||
|
@ -76,6 +75,16 @@ namespace Filtration.ViewModels
|
||||||
ReplaceColorsCommand.RaiseCanExecuteChanged();
|
ReplaceColorsCommand.RaiseCanExecuteChanged();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "NewScript":
|
||||||
|
{
|
||||||
|
OnNewScriptCommand();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "OpenScript":
|
||||||
|
{
|
||||||
|
OnOpenScriptCommand();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -145,7 +154,7 @@ namespace Filtration.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
||||||
newViewModel.Initialise(loadedScript);
|
newViewModel.Initialise(loadedScript, false);
|
||||||
_avalonDockWorkspaceViewModel.AddDocument(newViewModel);
|
_avalonDockWorkspaceViewModel.AddDocument(newViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,8 +217,7 @@ namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
var newScript = new ItemFilterScript();
|
var newScript = new ItemFilterScript();
|
||||||
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
var newViewModel = _itemFilterScriptViewModelFactory.Create();
|
||||||
newViewModel.Initialise(newScript);
|
newViewModel.Initialise(newScript, true);
|
||||||
newViewModel.Description = "New Script";
|
|
||||||
_avalonDockWorkspaceViewModel.AddDocument(newViewModel);
|
_avalonDockWorkspaceViewModel.AddDocument(newViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
using System.Linq;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Filtration.Models;
|
using Filtration.Models;
|
||||||
using Filtration.Models.BlockItemTypes;
|
using Filtration.Models.BlockItemTypes;
|
||||||
|
using Filtration.Views;
|
||||||
using GalaSoft.MvvmLight.CommandWpf;
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
using Xceed.Wpf.Toolkit;
|
||||||
|
|
||||||
namespace Filtration.ViewModels
|
namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -58,6 +61,16 @@ namespace Filtration.ViewModels
|
||||||
_itemFilterScript = itemFilterScript;
|
_itemFilterScript = itemFilterScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObservableCollection<ColorItem> AvailableColors
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
{
|
||||||
|
return PathOfExileColors.DefaultColors;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Color NewTextColor
|
public Color NewTextColor
|
||||||
{
|
{
|
||||||
get { return _replaceColorsParameterSet.NewTextColor; }
|
get { return _replaceColorsParameterSet.NewTextColor; }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using GalaSoft.MvvmLight.CommandWpf;
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
using GalaSoft.MvvmLight.Messaging;
|
||||||
|
|
||||||
namespace Filtration.ViewModels
|
namespace Filtration.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -12,12 +13,23 @@ namespace Filtration.ViewModels
|
||||||
public StartPageViewModel()
|
public StartPageViewModel()
|
||||||
{
|
{
|
||||||
Title = "Start Page";
|
Title = "Start Page";
|
||||||
|
OpenScriptCommand = new RelayCommand(OnOpenScriptCommand);
|
||||||
|
NewScriptCommand = new RelayCommand(OnNewScriptCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Replace with MVVMLight ViewModel Messages
|
public RelayCommand OpenScriptCommand { get; private set; }
|
||||||
public RelayCommand OpenScriptCommand { get { return null; } }
|
public RelayCommand NewScriptCommand { get; private set; }
|
||||||
public RelayCommand NewScriptCommand { get { return null; } }
|
|
||||||
|
|
||||||
public bool IsScript { get { return false; } }
|
public bool IsScript { get { return false; } }
|
||||||
|
|
||||||
|
private static void OnOpenScriptCommand()
|
||||||
|
{
|
||||||
|
Messenger.Default.Send(new NotificationMessage("OpenScript"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void OnNewScriptCommand()
|
||||||
|
{
|
||||||
|
Messenger.Default.Send(new NotificationMessage("NewScript"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
AnchorablesSource="{Binding Tools}"
|
AnchorablesSource="{Binding Tools}"
|
||||||
AllowMixedOrientation="True"
|
AllowMixedOrientation="True"
|
||||||
DocumentsSource="{Binding OpenDocuments}"
|
DocumentsSource="{Binding OpenDocuments}"
|
||||||
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}">
|
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}" >
|
||||||
<xcad:DockingManager.LayoutItemTemplateSelector>
|
<xcad:DockingManager.LayoutItemTemplateSelector>
|
||||||
<viewsAvalonDock:PanesTemplateSelector>
|
<viewsAvalonDock:PanesTemplateSelector>
|
||||||
<viewsAvalonDock:PanesTemplateSelector.ItemFilterScriptTemplate>
|
<viewsAvalonDock:PanesTemplateSelector.ItemFilterScriptTemplate>
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
<xcad:LayoutPanel Orientation="Horizontal">
|
<xcad:LayoutPanel Orientation="Horizontal">
|
||||||
<xcad:LayoutAnchorablePane Name="SectionBrowserPane" DockWidth="150" />
|
<xcad:LayoutAnchorablePane Name="SectionBrowserPane" DockWidth="150" />
|
||||||
<xcad:LayoutDocumentPane/>
|
<xcad:LayoutDocumentPane/>
|
||||||
<xcad:LayoutAnchorablePane Name="BlockGroupBrowserPane" DockWidth="150" />
|
<xcad:LayoutAnchorablePane Name="BlockGroupBrowserPane" DockWidth="200" />
|
||||||
</xcad:LayoutPanel>
|
</xcad:LayoutPanel>
|
||||||
</xcad:LayoutRoot>
|
</xcad:LayoutRoot>
|
||||||
</xcad:DockingManager>
|
</xcad:DockingManager>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using Xceed.Wpf.AvalonDock.Layout;
|
using System.Linq;
|
||||||
|
using Filtration.ViewModels;
|
||||||
|
using Xceed.Wpf.AvalonDock.Layout;
|
||||||
|
|
||||||
namespace Filtration.Views.AvalonDock
|
namespace Filtration.Views.AvalonDock
|
||||||
{
|
{
|
||||||
|
@ -14,6 +16,16 @@ namespace Filtration.Views.AvalonDock
|
||||||
destinationContainer.FindParent<LayoutFloatingWindow>() != null)
|
destinationContainer.FindParent<LayoutFloatingWindow>() != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (anchorableToShow.Content is SectionBrowserViewModel)
|
||||||
|
{
|
||||||
|
var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
|
||||||
|
if (toolsPane != null)
|
||||||
|
{
|
||||||
|
anchorableToShow.CanHide = false;
|
||||||
|
toolsPane.Children.Add(anchorableToShow);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
//if (anchorableToShow.ContentId == "SectionBrowserTool")
|
//if (anchorableToShow.ContentId == "SectionBrowserTool")
|
||||||
//{
|
//{
|
||||||
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
|
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
// Taken from http://stackoverflow.com/a/5118406/4153185
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Interactivity;
|
||||||
|
|
||||||
|
namespace Filtration.Views.Behaviors
|
||||||
|
{
|
||||||
|
internal class BindableSelectedItemBehavior : Behavior<TreeView>
|
||||||
|
{
|
||||||
|
#region SelectedItem Property
|
||||||
|
|
||||||
|
public object SelectedItem
|
||||||
|
{
|
||||||
|
get { return GetValue(SelectedItemProperty); }
|
||||||
|
set { SetValue(SelectedItemProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty SelectedItemProperty =
|
||||||
|
DependencyProperty.Register("SelectedItem", typeof (object), typeof (BindableSelectedItemBehavior),
|
||||||
|
new UIPropertyMetadata(null, OnSelectedItemChanged));
|
||||||
|
|
||||||
|
private static void OnSelectedItemChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var item = e.NewValue as TreeViewItem;
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
item.SetValue(TreeViewItem.IsSelectedProperty, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected override void OnAttached()
|
||||||
|
{
|
||||||
|
base.OnAttached();
|
||||||
|
|
||||||
|
AssociatedObject.SelectedItemChanged += OnTreeViewSelectedItemChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDetaching()
|
||||||
|
{
|
||||||
|
base.OnDetaching();
|
||||||
|
|
||||||
|
if (AssociatedObject != null)
|
||||||
|
{
|
||||||
|
AssociatedObject.SelectedItemChanged -= OnTreeViewSelectedItemChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTreeViewSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
{
|
||||||
|
SelectedItem = e.NewValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,4 +17,6 @@
|
||||||
<Image Source="/Filtration;component/Resources/Icons/play_icon.png" x:Key="PlayIcon" 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/about_icon.png" x:Key="AboutIcon" x:Shared="false" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/replace_colors_icon.png" x:Key="ReplaceColorsIcon" x:Shared="false" />
|
<Image Source="/Filtration;component/Resources/Icons/replace_colors_icon.png" x:Key="ReplaceColorsIcon" x:Shared="false" />
|
||||||
|
<Image Source="/Filtration;component/Resources/Icons/clear_filter_icon.png" x:Key="ClearFilterIcon" x:Shared="False" />
|
||||||
|
<Image Source="/Filtration;component/Resources/Icons/filter_icon.png" x:Key="FilterIcon" x:Shared="False" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
|
@ -62,7 +62,7 @@
|
||||||
<ColumnDefinition SharedSizeGroup="AudioVisualBlockItemCloseColumn" Width="Auto" />
|
<ColumnDefinition SharedSizeGroup="AudioVisualBlockItemCloseColumn" Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" Text="{Binding DisplayHeading}" Style="{StaticResource DisplayHeading}" />
|
<TextBlock Grid.Column="0" Text="{Binding DisplayHeading}" Style="{StaticResource DisplayHeading}" />
|
||||||
<xctk:ColorPicker Grid.Column="1" SelectedColor="{Binding Color}" HorizontalAlignment="Right" Width="100" />
|
<xctk:ColorPicker Grid.Column="1" SelectedColor="{Binding Color}" HorizontalAlignment="Right" Width="100" AvailableColors="{Binding ElementName=SettingsGrid, Path=DataContext.AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors"/>
|
||||||
<userControls:CrossButton Grid.Column="2" Height="12" Command="{Binding ElementName=SettingsGrid, Path=DataContext.RemoveAudioVisualBlockItemCommand}" CommandParameter="{Binding}" />
|
<userControls:CrossButton Grid.Column="2" Height="12" Command="{Binding ElementName=SettingsGrid, Path=DataContext.RemoveAudioVisualBlockItemCommand}" CommandParameter="{Binding}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
|
@ -59,27 +59,10 @@
|
||||||
<Button ToolTip="Move Block Down" Command="{Binding MoveBlockDownCommand}" Content="{StaticResource MoveDownIcon}" />
|
<Button ToolTip="Move Block Down" Command="{Binding MoveBlockDownCommand}" Content="{StaticResource MoveDownIcon}" />
|
||||||
<Button ToolTip="Move Block to Bottom" Command="{Binding MoveBlockToBottomCommand}" Content="{StaticResource MoveToBottomIcon}" />
|
<Button ToolTip="Move Block to Bottom" Command="{Binding MoveBlockToBottomCommand}" Content="{StaticResource MoveToBottomIcon}" />
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
|
<ToolBar>
|
||||||
|
<Button ToolTip="Clear Filter" Command="{Binding ClearFilterCommand}" Content="{StaticResource ClearFilterIcon}" />
|
||||||
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
<!--<Expander DockPanel.Dock="Left" ExpandDirection="Right" MaxWidth="200" HorizontalAlignment="Left" >
|
|
||||||
<Expander.Header>
|
|
||||||
<TextBlock Text="Section Browser" Foreground="White" VerticalAlignment="Top">
|
|
||||||
<TextBlock.LayoutTransform>
|
|
||||||
<RotateTransform Angle="-90"/>
|
|
||||||
</TextBlock.LayoutTransform>
|
|
||||||
</TextBlock>
|
|
||||||
</Expander.Header>
|
|
||||||
<ListBox ItemsSource="{Binding ItemFilterSectionViewModels}"
|
|
||||||
SelectedItem="{Binding SectionBrowserSelectedViewModel}"
|
|
||||||
x:Name="SectionBrowserListBox"
|
|
||||||
SelectionChanged="SectionBrowserListBox_OnSelectionChanged"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden">
|
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding BlockDescription}" ToolTip="{Binding BlockDescription}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
|
||||||
</ListBox>
|
|
||||||
</Expander>-->
|
|
||||||
<userControls:AutoScrollingListBox ItemsSource="{Binding ItemFilterBlockViewModels}"
|
<userControls:AutoScrollingListBox ItemsSource="{Binding ItemFilterBlockViewModels}"
|
||||||
Margin="5,5,5,5"
|
Margin="5,5,5,5"
|
||||||
Padding="5"
|
Padding="5"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
xmlns:viewsAvalonDock="clr-namespace:Filtration.Views.AvalonDock"
|
xmlns:viewsAvalonDock="clr-namespace:Filtration.Views.AvalonDock"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:MainWindowViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewModels:MainWindowViewModel}"
|
||||||
Title="{Binding WindowTitle}" Height="707" Width="930" BorderThickness="1" BorderBrush="Black">
|
Title="{Binding WindowTitle}" Height="768" Width="1024" BorderThickness="1" BorderBrush="Black">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<Menu DockPanel.Dock="Top">
|
<Menu DockPanel.Dock="Top">
|
||||||
<MenuItem Header="_File">
|
<MenuItem Header="_File">
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using Xceed.Wpf.Toolkit;
|
||||||
|
|
||||||
|
namespace Filtration.Views
|
||||||
|
{
|
||||||
|
static internal class PathOfExileColors
|
||||||
|
{
|
||||||
|
static PathOfExileColors()
|
||||||
|
{
|
||||||
|
DefaultColors = new ObservableCollection<ColorItem>
|
||||||
|
{
|
||||||
|
new ColorItem(new Color {A = 255, R=127, G = 127, B = 127}, "Default"),
|
||||||
|
new ColorItem(new Color {A = 255, R=255, G = 255, B = 255}, "Value Default"),
|
||||||
|
new ColorItem(new Color {A = 255, R=255, G = 192, B = 203}, "Pink"),
|
||||||
|
new ColorItem(new Color {A = 255, R=30, G = 144, B = 255}, "Dodger Blue"),
|
||||||
|
new ColorItem(new Color {A = 255, R=150, G = 0, B = 0}, "Fire"),
|
||||||
|
new ColorItem(new Color {A = 255, R=54, G = 100, B = 146}, "Cold"),
|
||||||
|
new ColorItem(new Color {A = 255, R=255, G = 215, B = 0}, "Lightning"),
|
||||||
|
new ColorItem(new Color {A = 255, R=208, G = 32, B = 144}, "Chaos"),
|
||||||
|
new ColorItem(new Color {A = 255, R=136, G = 136, B = 255}, "Augmented"),
|
||||||
|
new ColorItem(new Color {A = 255, R=184, G = 218, B = 242}, "Crafted"),
|
||||||
|
new ColorItem(new Color {A = 255, R=210, G = 0, B = 0}, "Unmet"),
|
||||||
|
new ColorItem(new Color {A = 255, R=175, G = 96, B = 37}, "Unique Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=255, G = 255, B = 119}, "Rare Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=136, G = 136, B = 255}, "Magic Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=200, G = 200, B = 200}, "White Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=27, G = 162, B = 155}, "Gem Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=170, G = 158, B = 130}, "Currency Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=74, G = 230, B = 58}, "Quest Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=255, G = 200, B = 0}, "Nemesis Mod"),
|
||||||
|
new ColorItem(new Color {A = 220, R = 255, G = 40, B = 0}, "Nemesis Mod Outline"),
|
||||||
|
new ColorItem(new Color {A = 255, R=231, G = 180, B = 120}, "Title"),
|
||||||
|
new ColorItem(new Color {A = 255, R=210, G = 0, B = 0}, "Corrupted"),
|
||||||
|
new ColorItem(new Color {A = 255, R=170, G = 158, B = 130}, "Favour"),
|
||||||
|
new ColorItem(new Color {A = 255, R=180, G = 96, B = 0}, "Supporter Pack New Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=163, G = 141, B = 109}, "Supporter Pack Item"),
|
||||||
|
new ColorItem(new Color {A = 255, R=210, G = 0, B = 220}, "Bloodline Mod"),
|
||||||
|
new ColorItem(new Color {A = 200, R = 74, G = 0, B = 160}, "Bloodline Mod Outline"),
|
||||||
|
new ColorItem(new Color {A = 255, R=50, G = 230, B = 100}, "Torment Mod"),
|
||||||
|
new ColorItem(new Color {A = 200, R = 0, G = 100, B = 150}, "Torment Mod Outline"),
|
||||||
|
new ColorItem(new Color {A = 255, R=210, G = 0, B = 0}, "Can't Trade or Modify")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObservableCollection<ColorItem> DefaultColors { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -40,22 +40,22 @@
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox Grid.Row="0" Grid.Column="0" Content="Replace Text Color" IsChecked="{Binding ReplaceTextColor}" />
|
<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>
|
<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}" />
|
<xctk:ColorPicker Grid.Row="0" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldTextColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">New Text Color</TextBlock>
|
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">New Text Color</TextBlock>
|
||||||
<xctk:ColorPicker Grid.Row="1" Grid.Column="4" SelectedColor="{Binding NewTextColor}" />
|
<xctk:ColorPicker Grid.Row="1" Grid.Column="4" SelectedColor="{Binding NewTextColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
|
|
||||||
|
|
||||||
<CheckBox Grid.Row="2" Grid.Column="0" Content="Replace Background Color" IsChecked="{Binding ReplaceBackgroundColor}" />
|
<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>
|
<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}" />
|
<xctk:ColorPicker Grid.Row="2" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBackgroundColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
<TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">New Background Color</TextBlock>
|
<TextBlock Grid.Row="3" Grid.Column="2" VerticalAlignment="Center">New Background Color</TextBlock>
|
||||||
<xctk:ColorPicker Grid.Row="3" Grid.Column="4" SelectedColor="{Binding NewBackgroundColor}" />
|
<xctk:ColorPicker Grid.Row="3" Grid.Column="4" SelectedColor="{Binding NewBackgroundColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
|
|
||||||
<CheckBox Grid.Row="4" Grid.Column="0" Content="Replace Border Color" IsChecked="{Binding ReplaceBorderColor}" />
|
<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>
|
<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}" />
|
<xctk:ColorPicker Grid.Row="4" Grid.Column="4" SelectedColor="{Binding ReplaceColorsParameterSet.OldBorderColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
<TextBlock Grid.Row="5" Grid.Column="2" VerticalAlignment="Center">New Border Color</TextBlock>
|
<TextBlock Grid.Row="5" Grid.Column="2" VerticalAlignment="Center">New Border Color</TextBlock>
|
||||||
<xctk:ColorPicker Grid.Row="5" Grid.Column="4" SelectedColor="{Binding NewBorderColor}" />
|
<xctk:ColorPicker Grid.Row="5" Grid.Column="4" SelectedColor="{Binding NewBorderColor}" AvailableColors="{Binding AvailableColors}" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors" />
|
||||||
|
|
||||||
<userControls:ItemPreviewControl Grid.Row="6" Grid.Column="4" TextColor="{Binding DisplayTextColor}" BackgroundColor="{Binding DisplayBackgroundColor}" BorderColor="{Binding DisplayBorderColor}" />
|
<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>
|
<TextBlock Grid.Row="6" Grid.Column="2" VerticalAlignment="Center">Preview</TextBlock>
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:models="clr-namespace:Filtration.Models"
|
xmlns:models="clr-namespace:Filtration.Models"
|
||||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
|
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||||
|
xmlns:behaviors="clr-namespace:Filtration.Views.Behaviors"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:BlockGroupBrowserViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewModels:BlockGroupBrowserViewModel}"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
|
@ -12,7 +14,18 @@
|
||||||
|
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<TreeView ItemsSource="{Binding BlockGroups}">
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ToolBar Grid.Row="0">
|
||||||
|
<Button Height="20" Command="{Binding FilterToSelectedBlockGroupCommand}" Content="{StaticResource FilterIcon}" ToolTip="Filter to Selected Block Group" />
|
||||||
|
</ToolBar>
|
||||||
|
|
||||||
|
<TreeView Grid.Row="1" ItemsSource="{Binding BlockGroups}">
|
||||||
|
<i:Interaction.Behaviors>
|
||||||
|
<behaviors:BindableSelectedItemBehavior SelectedItem="{Binding SelectedBlockGroup, Mode=OneWayToSource}" />
|
||||||
|
</i:Interaction.Behaviors>
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<HierarchicalDataTemplate DataType="{x:Type models:ItemFilterBlockGroup}" ItemsSource="{Binding ChildGroups}">
|
<HierarchicalDataTemplate DataType="{x:Type models:ItemFilterBlockGroup}" ItemsSource="{Binding ChildGroups}">
|
||||||
<WrapPanel>
|
<WrapPanel>
|
||||||
|
|
|
@ -4,9 +4,13 @@
|
||||||
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
xmlns:viewModels="clr-namespace:Filtration.ViewModels"
|
||||||
|
xmlns:converters="clr-namespace:Filtration.Converters"
|
||||||
d:DataContext="{d:DesignInstance Type=viewModels:SectionBrowserViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewModels:SectionBrowserViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<converters:HashSignRemovalConverter x:Key="HashSignRemovalConverter" />
|
||||||
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<ListBox ItemsSource="{Binding SectionBlockViewModels}"
|
<ListBox ItemsSource="{Binding SectionBlockViewModels}"
|
||||||
SelectedItem="{Binding SelectedSectionBlockViewModel}"
|
SelectedItem="{Binding SelectedSectionBlockViewModel}"
|
||||||
|
@ -14,7 +18,7 @@
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"><!--SelectionChanged="SectionBrowserListBox_OnSelectionChanged"-->
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"><!--SelectionChanged="SectionBrowserListBox_OnSelectionChanged"-->
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Block.Description}" ToolTip="{Binding Block.Description}" />
|
<TextBlock Text="{Binding Block.Description, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Block.Description}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
Loading…
Reference in New Issue