Add new filter fuatures

This commit is contained in:
azakhi
2018-08-29 20:12:02 +03:00
parent a09f0a5090
commit 78b4ddc862
78 changed files with 911 additions and 231 deletions

View File

@@ -50,6 +50,8 @@ namespace Filtration
cfg.CreateMap<IntegerThemeComponent, IntegerThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<StrIntThemeComponent, StrIntThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<StringThemeComponent, StringThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<IconThemeComponent, IconThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<EffectColorThemeComponent, EffectColorThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<IThemeEditorViewModel, Theme>();
});

View File

@@ -45,6 +45,14 @@ namespace Filtration.Converters
{
themeComponentType = ThemeComponentType.CustomSound;
}
else if (blockItem.GetType() == typeof(MapIconBlockItem))
{
themeComponentType = ThemeComponentType.Icon;
}
else if (blockItem.GetType() == typeof(PlayEffectBlockItem))
{
themeComponentType = ThemeComponentType.Effect;
}
else
{
return null;

View File

@@ -1,28 +1,29 @@
using System;
using Filtration.ObjectModel.Enums;
using System;
using System.Globalization;
using System.Windows.Data;
namespace Filtration.Converters
{
internal class DropIconConverter : IValueConverter
internal class IconShapeToSourceConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var iconString = (string)value;
switch(iconString)
var iconShape = (IconShape)(int)value;
switch (iconShape)
{
case "Icon1":
return "/Filtration;component/Resources/DropIcons/Icon1.png";
case "Icon2":
return "/Filtration;component/Resources/DropIcons/Icon2.png";
case "Icon3":
return "/Filtration;component/Resources/DropIcons/Icon3.png";
case "Icon4":
return "/Filtration;component/Resources/DropIcons/Icon4.png";
case "Icon5":
return "/Filtration;component/Resources/DropIcons/Icon5.png";
case "Icon6":
return "/Filtration;component/Resources/DropIcons/Icon6.png";
case IconShape.Circle:
return "/Filtration;component/Resources/DropIcons/Circle.png";
case IconShape.Diamond:
return "/Filtration;component/Resources/DropIcons/Diamond.png";
case IconShape.Hexagon:
return "/Filtration;component/Resources/DropIcons/Hexagon.png";
case IconShape.Square:
return "/Filtration;component/Resources/DropIcons/Square.png";
case IconShape.Star:
return "/Filtration;component/Resources/DropIcons/Star.png";
case IconShape.Triangle:
return "/Filtration;component/Resources/DropIcons/Triangle.png";
}
return "/Filtration;component/Resources/DropIcons/NoIcon.png";

View File

@@ -0,0 +1,33 @@
using Filtration.ObjectModel.Enums;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Filtration.Converters
{
internal class SizeColorToRectConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var size = (int)(values[0]);
var color = (int)(values[1]);
if (size < 0 || color < 0)
return new Rect(0, 0, 0, 0);
Rect cropArea = new Rect();
cropArea.Width = 64;
cropArea.Height = 64;
cropArea.X = 0 + size * 64;
cropArea.Y = 0 + color * 64;
return cropArea;
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -1,65 +0,0 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Windows.Markup;
namespace Filtration.Extensions
{
internal class EnumerationExtension : MarkupExtension
{
private Type _enumType;
public EnumerationExtension(Type enumType)
{
if (enumType == null) throw new ArgumentNullException(nameof(enumType));
EnumType = enumType;
}
public Type EnumType
{
get
{
return _enumType;
}
private set
{
if (_enumType == value) return;
var enumType = Nullable.GetUnderlyingType(value) ?? value;
if (enumType.IsEnum == false) throw new ArgumentException("Type must be an Enum.");
_enumType = value;
}
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
var enumValues = Enum.GetValues(EnumType);
return (from object enumValue in enumValues
select new EnumerationMember { Value = enumValue, Description = GetDescription(enumValue) }).ToArray
();
}
private string GetDescription(object enumValue)
{
var descriptionAttribute =
EnumType.GetField(enumValue.ToString())
.GetCustomAttributes(typeof(DescriptionAttribute), false)
.FirstOrDefault() as DescriptionAttribute;
return descriptionAttribute != null ? descriptionAttribute.Description : enumValue.ToString();
}
public class EnumerationMember
{
public string Description { get; set; }
public object Value { get; set; }
}
}
}

View File

@@ -1,40 +0,0 @@
// Taken from http://stackoverflow.com/a/11433814/4153185
using System.Diagnostics;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Navigation;
namespace Filtration.Extensions
{
public static class HyperlinkExtensions
{
public static bool GetIsExternal(DependencyObject obj)
{
return (bool)obj.GetValue(IsExternalProperty);
}
public static void SetIsExternal(DependencyObject obj, bool value)
{
obj.SetValue(IsExternalProperty, value);
}
public static readonly DependencyProperty IsExternalProperty =
DependencyProperty.RegisterAttached("IsExternal", typeof(bool), typeof(HyperlinkExtensions), new UIPropertyMetadata(false, OnIsExternalChanged));
private static void OnIsExternalChanged(object sender, DependencyPropertyChangedEventArgs args)
{
var hyperlink = sender as Hyperlink;
if ((bool)args.NewValue)
{
if (hyperlink != null) hyperlink.RequestNavigate += Hyperlink_RequestNavigate;
}
else if (hyperlink != null) hyperlink.RequestNavigate -= Hyperlink_RequestNavigate;
}
private static void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}

View File

@@ -167,12 +167,11 @@
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
<Compile Include="Converters\DropIconConverter.cs" />
<Compile Include="Converters\SizeColorToRectConverter.cs" />
<Compile Include="Converters\HashSignRemovalConverter.cs" />
<Compile Include="Converters\IconShapeToSourceConverter.cs" />
<Compile Include="Converters\ItemRarityConverter.cs" />
<Compile Include="Converters\TreeViewMarginConverter.cs" />
<Compile Include="Extensions\EnumerationExtension.cs" />
<Compile Include="Extensions\HyperlinkExtensions.cs" />
<Compile Include="Models\UpdateData.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Repositories\ItemFilterScriptRepository.cs" />
@@ -546,13 +545,13 @@
</None>
<Resource Include="Resources\Icons\redo_icon.png" />
<Resource Include="Resources\Icons\undo_icon.png" />
<Resource Include="Resources\DropIcons\Icon1.png" />
<Resource Include="Resources\DropIcons\Icon2.png" />
<Resource Include="Resources\DropIcons\Icon3.png" />
<Resource Include="Resources\DropIcons\Icon4.png" />
<Resource Include="Resources\DropIcons\Icon5.png" />
<Resource Include="Resources\DropIcons\Icon6.png" />
<Resource Include="Resources\DropIcons\NoIcon.png" />
<Resource Include="Resources\DropIcons\Circle.png" />
<Resource Include="Resources\DropIcons\Diamond.png" />
<Resource Include="Resources\DropIcons\Hexagon.png" />
<Resource Include="Resources\DropIcons\Square.png" />
<Resource Include="Resources\DropIcons\Star.png" />
<Resource Include="Resources\DropIcons\Triangle.png" />
<Content Include="Resources\ItemBaseTypes.txt" />
<Content Include="Resources\ItemClasses.txt" />
</ItemGroup>

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@@ -1,5 +1,6 @@
A Mother's Parting Gift
Abandoned Wealth
Aberrant Fossil
Abyssal Axe
Abyssal Cry
Abyssal Sceptre
@@ -10,6 +11,7 @@ Added Cold Damage Support
Added Fire Damage Support
Added Lightning Damage Support
Additional Accuracy Support
Aetheric Fossil
Agate Amulet
Albino Rhoa Feather
Alchemy Shard
@@ -111,6 +113,7 @@ Battle Sword
Bazaar Map
Beach Map
Bear Trap
Beauty Through Death
Behemoth Mace
Belfry Map
Bestel's Manuscript
@@ -148,6 +151,7 @@ Blood Raiment
Blood Sceptre
Bloodlines Leaguestone
Bloodlust Support
Bloodstained Fossil
Blue Pearl Amulet
Blunt Arrow Quiver
Boarding Axe
@@ -161,9 +165,11 @@ Bone Helmet
Bone Offering
Bone Spirit Shield
Bonespire Talisman
Boon of the First Ones
Boot Blade
Boot Knife
Bottled Storm
Bound Fossil
Boundless Realms
Bowyer's Dream
Branded Kite Shield
@@ -293,6 +299,7 @@ Conjurer Boots
Conjurer Gloves
Conjurer's Vestment
Conquest Chainmail
Consecrated Path
Conservatory Map
Contagion
Controlled Destruction Support
@@ -309,6 +316,7 @@ Core Map
Coronal Leather
Coronal Maul
Corroded Blade
Corroded Fossil
Corroded Tower Shield
Corrugated Buckler
Corsair Sword
@@ -388,6 +396,7 @@ Defiled Cathedral Map
Deicide Mask
Demon Dagger
Demon's Horn
Dense Fossil
Desecrate
Desert Brigandine
Desert Map
@@ -463,6 +472,8 @@ Emperor of Purity
Emperor's Luck
Empower Support
Enameled Buckler
Enchanted Fossil
Encrusted Fossil
Endurance Charge on Melee Stun Support
Enduring Cry
Enfeeble
@@ -508,6 +519,7 @@ Ezomyte Dagger
Ezomyte Spiked Shield
Ezomyte Staff
Ezomyte Tower Shield
Faceted Fossil
Factory Map
Fancy Foil
Fangjaw Talisman
@@ -552,6 +564,7 @@ Fork Support
Fortify Support
Fossilised Spirit Shield
Foul Staff
Fractured Fossil
Fragment of the Chimera
Fragment of the Hydra
Fragment of the Minotaur
@@ -561,6 +574,7 @@ Freezing Pulse
Frenzy
Fright Claw
Fright Maul
Frigid Fossil
Frontier Leather
Frost Blades
Frost Bomb
@@ -590,6 +604,7 @@ Giant Mana Flask
Gift of the Gemling Queen
Gilded Axe
Gilded Buckler
Gilded Fossil
Gilded Sallet
Girded Tower Shield
Glacial Cascade
@@ -602,6 +617,7 @@ Glassblower's Bauble
Glimmer of Hope
Glorious Leather
Glorious Plate
Glyphic Fossil
Gnarled Branch
Goat's Horn
Goathide Boots
@@ -675,8 +691,10 @@ Heavy Quiver
Heavy Strike
Hellion's Paw
Her Mask
Herald of Agony
Herald of Ash
Herald of Ice
Herald of Purity
Herald of Thunder
Heterochromia
Hexclaw Talisman
@@ -684,6 +702,7 @@ Highborn Bow
Highborn Staff
Highland Blade
Hinekora's Hair
Hollow Fossil
Holy Chainmail
Hook Sword
Hope
@@ -759,6 +778,7 @@ Jade Chopper
Jade Flask
Jade Hatchet
Jagged Foil
Jagged Fossil
Jagged Maul
Jasper Axe
Jasper Chopper
@@ -843,6 +863,7 @@ Lordly Plate
Loricated Ringmail
Lost Worlds
Loyalty
Lucent Fossil
Lucky Connections
Lucky Deck
Lunaris Circlet
@@ -884,6 +905,7 @@ Merciless Armament
Mesa Map
Mesh Boots
Mesh Gloves
Metallic Fossil
Miasmeter
Midnight Blade
Might is Right
@@ -995,13 +1017,13 @@ Penetrating Arrow Quiver
Peninsula Map
Perandus Coin
Perandus Leaguestone
Perfect Fossil
Perfection
Pernarch
Petrified Club
Phantasmagoria Map
Phantom Mace
Phase Run
Physical Projectile Attack Damage Support
Physical to Lightning Support
Pier Map
Pierce Support
@@ -1031,19 +1053,29 @@ Port Map
Portal
Portal Scroll
Portal Shredder
Potent Alchemical Resonator
Potent Chaotic Resonator
Power Charge On Critical Support
Power Siphon
Powerful Alchemical Resonator
Powerful Chaotic Resonator
Praetor Crown
Precinct Map
Prehistoric Claw
Pride Before the Fall
Primal Skull Talisman
Prime Alchemical Resonator
Prime Chaotic Resonator
Primeval Rapier
Primitive Alchemical Resonator
Primitive Chaotic Resonator
Primitive Staff
Primordial Pool Map
Primordial Staff
Prismatic Fossil
Prismatic Jewel
Prismatic Ring
Pristine Fossil
Profane Wand
Projectile Weakness
Promenade Map
@@ -1157,6 +1189,7 @@ Sambar Sceptre
Samite Gloves
Samite Helmet
Samite Slippers
Sanctified Fossil
Sanctified Life Flask
Sanctified Mana Flask
Sand of Eternity
@@ -1173,7 +1206,9 @@ Scarlet Round Shield
Scholar Boots
Scholar of the Seas
Scholar's Robe
Scorched Fossil
Scorching Ray
Scourge Arrow
Screaming Essence
Screaming Essence of Anger
Screaming Essence of Anguish
@@ -1212,6 +1247,7 @@ Serpentscale Boots
Serpentscale Gauntlets
Serrated Arrow Quiver
Serrated Foil
Serrated Fossil
Shabby Jerkin
Shackled Boots
Shadow Axe
@@ -1221,7 +1257,6 @@ Shagreen Gloves
Shagreen Tower Shield
Shaper's Orb
Shaper's Orb (Tier 1)
Shaper's Orb (Tier 10)
Shaper's Orb (Tier 2)
Shaper's Orb (Tier 3)
Shaper's Orb (Tier 4)
@@ -1230,6 +1265,7 @@ Shaper's Orb (Tier 6)
Shaper's Orb (Tier 7)
Shaper's Orb (Tier 8)
Shaper's Orb (Tier 9)
Shaper's Orb (Tier 10)
Shard of Fate
Sharkskin Boots
Sharkskin Gloves
@@ -1265,6 +1301,7 @@ Shrieking Essence of Woe
Shrieking Essence of Wrath
Shrieking Essence of Zeal
Shrine Map
Shuddering Fossil
Siege Axe
Siege Ballista
Siege Helmet
@@ -1299,6 +1336,7 @@ Small Hybrid Flask
Small Life Flask
Small Mana Flask
Smallsword
Smite
Smoke Mine
Sniper Bow
Solar Maul
@@ -1385,6 +1423,7 @@ Sulphur Vents Map
Summit Map
Summon Chaos Golem
Summon Flame Golem
Summon Holy Relic
Summon Ice Golem
Summon Lightning Golem
Summon Phantasm on Kill Support
@@ -1402,6 +1441,7 @@ Sweep
Swift Affliction Support
Talisman Leaguestone
Talon Axe
Tangled Fossil
Tarnished Spirit Shield
Teak Round Shield
Tectonic Slam
@@ -1431,6 +1471,7 @@ The Blazing Fire
The Body
The Breach
The Brittle Emperor
The Cacophony
The Calling
The Carrion Crow
The Cartographer
@@ -1456,6 +1497,7 @@ The Dreamer
The Dreamland
The Drunken Aristocrat
The Encroaching Darkness
The Endless Darkness
The Endurance
The Enlightened
The Ethereal
@@ -1483,6 +1525,7 @@ The Hoarder
The Hunger
The Immortal
The Incantation
The Innocent
The Inoculated
The Insatiable
The Inventor
@@ -1512,6 +1555,7 @@ The Penitent
The Poet
The Polymath
The Porcupine
The Price of Protection
The Professor
The Puzzle
The Queen
@@ -1548,6 +1592,7 @@ The Throne
The Tower
The Traitor
The Trial
The Twilight Moon
The Twins
The Tyrant
The Undaunted
@@ -1562,6 +1607,7 @@ The Warden
The Warlord
The Watcher
The Web
The Wilted Rose
The Wind
The Witch
The Wolf
@@ -1589,6 +1635,7 @@ Tiger's Paw
Timber Axe
Time-Lost Relic
Timeworn Claw
Timeworn Reliquary Key
Titan Gauntlets
Titan Greaves
Titanium Spirit Shield
@@ -1604,6 +1651,7 @@ Torture Chamber Map
Totemic Maul
Tower Key
Tower Map
Toxic Rain
Toxic Sewer Map
Tranquillity
Transmutation Shard
@@ -1644,6 +1692,7 @@ Unset Ring
Unshaping Orb
Ursine Pelt
Uul-Netol's Breachstone
Vaal Ancestral Warchief
Vaal Arc
Vaal Axe
Vaal Blade
@@ -1713,6 +1762,7 @@ Vial of Summoning
Vial of the Ghost
Vial of the Ritual
Vial of Transcendence
Vicious Projectiles Support
Vigilant Strike
Vile Staff
Vile Toxins Support
@@ -1790,6 +1840,7 @@ Wild Leather
Wild Strike
Wings of Vastiri
Wither
Withering Touch Support
Wolf Pelt
Woodful Staff
Woodsplitter

View File

@@ -9,6 +9,7 @@ Bows
Claws
Currency
Daggers
Delve Stackable Currency
Divination Card
Fishing Rods
Flasks

View File

@@ -7,7 +7,7 @@
xmlns:commonConverters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
xmlns:blockItemTypes="clr-namespace:Filtration.ObjectModel.BlockItemTypes;assembly=Filtration.ObjectModel"
xmlns:extensions="clr-namespace:Filtration.Extensions"
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:views="clr-namespace:Filtration.Views"
@@ -86,14 +86,25 @@
<userControls:EditableListBoxControl Margin="5,5,5,5" ItemsSource="{Binding Items}" />
</DataTemplate>
<!-- Beam Block Template -->
<DataTemplate DataType="{x:Type blockItemTypes:BeamBlockItem}">
<!-- Play Effect Block Template -->
<DataTemplate DataType="{x:Type blockItemTypes:PlayEffectBlockItem}">
<StackPanel>
<WrapPanel VerticalAlignment="Center" Margin="5,5,5,5">
<RadioButton IsChecked="{Binding BooleanValue}" Margin="0,0,10,0">Permanent</RadioButton>
<RadioButton IsChecked="{Binding BooleanValue, Converter={StaticResource BoolInverterConverter}}" >Temporary</RadioButton>
<RadioButton IsChecked="{Binding Temporary, Converter={StaticResource BoolInverterConverter}}" Margin="0,0,10,0">Permanent</RadioButton>
<RadioButton IsChecked="{Binding Temporary}" >Temporary</RadioButton>
</WrapPanel>
<xctk:ColorPicker SelectedColor="{Binding Color}" AvailableColors="{Binding ElementName=BlockItemContentControl, Path=DataContext.AvailableColors }" ShowAvailableColors="True" AvailableColorsHeader="Path of Exile Colors"/>
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:EffectColor}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding Color}"
SelectedValuePath="Value" />
<userControls:ThemeComponentSelectionControl ThemeComponent="{Binding ThemeComponent}" Margin="0,2,0,0">
<userControls:ThemeComponentSelectionControl.AvailableThemeComponents>
<MultiBinding Converter="{StaticResource AvailableThemeComponentsConverter}">
<Binding Path="DataContext.Script.ThemeComponents" RelativeSource="{RelativeSource AncestorType={x:Type views:ItemFilterScriptView}}"/>
<Binding Path="." />
</MultiBinding>
</userControls:ThemeComponentSelectionControl.AvailableThemeComponents>
</userControls:ThemeComponentSelectionControl>
</StackPanel>
</DataTemplate>
@@ -171,11 +182,30 @@
</WrapPanel>
</DataTemplate>
<!-- Drop Icon Template -->
<DataTemplate DataType="{x:Type blockItemTypes:IconBlockItem}">
<WrapPanel HorizontalAlignment="Left">
<userControls:ImageComboBoxControl/>
</WrapPanel>
<!-- Map Icon Template -->
<DataTemplate DataType="{x:Type blockItemTypes:MapIconBlockItem}">
<StackPanel Orientation="Vertical" Margin="5,5,5,5">
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconSize}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding Size}"
SelectedValuePath="Value" />
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconColor}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding Color}"
SelectedValuePath="Value" />
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconShape}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding Shape}"
SelectedValuePath="Value" />
<userControls:ThemeComponentSelectionControl ThemeComponent="{Binding ThemeComponent}" Margin="0,2,0,0">
<userControls:ThemeComponentSelectionControl.AvailableThemeComponents>
<MultiBinding Converter="{StaticResource AvailableThemeComponentsConverter}">
<Binding Path="DataContext.Script.ThemeComponents" RelativeSource="{RelativeSource AncestorType={x:Type views:ItemFilterScriptView}}"/>
<Binding Path="." />
</MultiBinding>
</userControls:ThemeComponentSelectionControl.AvailableThemeComponents>
</userControls:ThemeComponentSelectionControl>
</StackPanel>
</DataTemplate>
<!-- Custom Sound Template -->

View File

@@ -90,10 +90,6 @@ namespace Filtration.UserControls
"ShFusing", "ShRegal", "ShVaal"
};
public List<string> IconsAvailable => new List<string> {
"Icon1", "Icon2", "Icon3", "Icon4", "Icon5", "Icon6"
};
private void OnSetBlockValueCommmand()
{
var blockItemWithTheme = BlockItem as IBlockItemWithTheme;
@@ -121,6 +117,17 @@ namespace Filtration.UserControls
var stringBlockItem = BlockItem as StringBlockItem;
stringBlockItem.Value = ((StringThemeComponent)stringBlockItem.ThemeComponent).Value;
break;
case ThemeComponentType.Icon:
var iconBlockItem = BlockItem as IconBlockItem;
iconBlockItem.Size = ((IconThemeComponent)iconBlockItem.ThemeComponent).IconSize;
iconBlockItem.Color = ((IconThemeComponent)iconBlockItem.ThemeComponent).IconColor;
iconBlockItem.Shape = ((IconThemeComponent)iconBlockItem.ThemeComponent).IconShape;
break;
case ThemeComponentType.Effect:
var effectColorBlockItem = BlockItem as EffectColorBlockItem;
effectColorBlockItem.Color = ((EffectColorThemeComponent)effectColorBlockItem.ThemeComponent).EffectColor;
effectColorBlockItem.Temporary = ((EffectColorThemeComponent)effectColorBlockItem.ThemeComponent).Temporary;
break;
}
}

View File

@@ -8,7 +8,7 @@
mc:Ignorable="d">
<UserControl.Resources>
<Converters:DropIconConverter x:Key="DropIconConverter"/>
<Converters:SizeColorToRectConverter x:Key="DropIconConverter"/>
</UserControl.Resources>
<Grid>

View File

@@ -8,7 +8,7 @@
d:DataContext="{d:DesignInstance Type=userControls:ItemPreviewControl}"
d:DesignHeight="35" d:DesignWidth="170">
<Border BorderBrush="Black" BorderThickness="1">
<Grid Width="166" Height="39">
<Grid Width="200" Height="39">
<Image Source="pack://application:,,,/resources/groundtile.png" Stretch="Fill" />
<Grid>
<Grid.RowDefinitions>

View File

@@ -5,7 +5,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extensions="clr-namespace:Filtration.Extensions"
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
xmlns:userControls="clr-namespace:Filtration.UserControls"
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
mc:Ignorable="d"

View File

@@ -67,6 +67,14 @@
<DataTemplate DataType="{x:Type themeEditor:StringThemeComponent}">
<!--TODO: How to show theese?-->
</DataTemplate>
<DataTemplate DataType="{x:Type themeEditor:IconThemeComponent}">
<!--TODO: How to show theese?-->
</DataTemplate>
<DataTemplate DataType="{x:Type themeEditor:EffectColorThemeComponent}">
<!--TODO: How to show theese?-->
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
</Grid>

View File

@@ -8,6 +8,7 @@ using System.Windows.Media;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.BlockItemTypes;
using Filtration.ObjectModel.Enums;
using Filtration.Services;
using Filtration.Views;
using GalaSoft.MvvmLight.CommandWpf;
@@ -181,6 +182,7 @@ namespace Filtration.ViewModels
typeof (CorruptedBlockItem),
typeof (ElderItemBlockItem),
typeof (ShaperItemBlockItem),
typeof (MapTierBlockItem),
typeof (ShapedMapBlockItem),
typeof (ElderMapBlockItem),
typeof (GemLevelBlockItem),
@@ -197,8 +199,8 @@ namespace Filtration.ViewModels
typeof (SoundBlockItem),
typeof (PositionalSoundBlockItem),
typeof (DisableDropSoundBlockItem),
typeof (IconBlockItem),
typeof (BeamBlockItem),
typeof (MapIconBlockItem),
typeof (PlayEffectBlockItem),
typeof (CustomSoundBlockItem)
};
@@ -241,8 +243,10 @@ namespace Filtration.ViewModels
public Color DisplayBackgroundColor => Block.DisplayBackgroundColor;
public Color DisplayBorderColor => Block.DisplayBorderColor;
public double DisplayFontSize => Block.DisplayFontSize/1.8;
public string DisplayIcon => Block.DisplayIcon;
public Color DisplayBeamColor => Block.DisplayBeamColor;
public int DisplayIconSize => Block.DisplayIconSize;
public int DisplayIconColor => Block.DisplayIconColor;
public int DisplayIconShape => Block.DisplayIconShape;
public Color DisplayEffectColor => Block.DisplayEffectColor;
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
@@ -476,8 +480,10 @@ namespace Filtration.ViewModels
RaisePropertyChanged(nameof(DisplayBackgroundColor));
RaisePropertyChanged(nameof(DisplayBorderColor));
RaisePropertyChanged(nameof(DisplayFontSize));
RaisePropertyChanged(nameof(DisplayIcon));
RaisePropertyChanged(nameof(DisplayBeamColor));
RaisePropertyChanged(nameof(DisplayIconSize));
RaisePropertyChanged(nameof(DisplayIconColor));
RaisePropertyChanged(nameof(DisplayIconShape));
RaisePropertyChanged(nameof(DisplayEffectColor));
RaisePropertyChanged(nameof(HasSound));
RaisePropertyChanged(nameof(HasPositionalSound));
RaisePropertyChanged(nameof(HasCustomSound));

View File

@@ -117,6 +117,8 @@ namespace Filtration.ViewModels
AddFontSizeThemeComponentCommand = new RelayCommand(OnAddFontSizeThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddAlertSoundThemeComponentCommand = new RelayCommand(OnAddAlertSoundThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddCustomSoundThemeComponentCommand = new RelayCommand(OnAddCustomSoundThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddIconThemeComponentCommand = new RelayCommand(OnAddIconThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
AddEffectColorThemeComponentCommand = new RelayCommand(OnAddEffectColorThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable);
DeleteThemeComponentCommand = new RelayCommand(OnDeleteThemeComponentCommand, () => ActiveDocumentIsTheme && ActiveThemeIsEditable && _avalonDockWorkspaceViewModel.ActiveThemeViewModel.SelectedThemeComponent != null);
ExpandAllBlocksCommand = new RelayCommand(OnExpandAllBlocksCommand, () => ActiveDocumentIsScript);
@@ -219,6 +221,8 @@ namespace Filtration.ViewModels
public RelayCommand AddFontSizeThemeComponentCommand { get; }
public RelayCommand AddAlertSoundThemeComponentCommand { get; }
public RelayCommand AddCustomSoundThemeComponentCommand { get; }
public RelayCommand AddIconThemeComponentCommand { get; }
public RelayCommand AddEffectColorThemeComponentCommand { get; }
public RelayCommand DeleteThemeComponentCommand { get; }
public RelayCommand AddBlockCommand { get; }
@@ -698,6 +702,16 @@ namespace Filtration.ViewModels
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.AddThemeComponentCommand.Execute(ThemeComponentType.CustomSound);
}
private void OnAddIconThemeComponentCommand()
{
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.AddThemeComponentCommand.Execute(ThemeComponentType.Icon);
}
private void OnAddEffectColorThemeComponentCommand()
{
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.AddThemeComponentCommand.Execute(ThemeComponentType.Effect);
}
private void OnDeleteThemeComponentCommand()
{
_avalonDockWorkspaceViewModel.ActiveThemeViewModel.DeleteThemeComponentCommand.Execute(

View File

@@ -1,7 +1,7 @@
<Window x:Class="Filtration.Views.AboutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extensions="clr-namespace:Filtration.Extensions"
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
Title="About Filtration"
Height="360"
Width="580"

View File

@@ -18,7 +18,8 @@
<ResourceDictionary>
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
<converters:DropIconConverter x:Key="DropIconConverter"/>
<converters:IconShapeToSourceConverter x:Key="IconShapeToSourceConverter"/>
<converters:SizeColorToRectConverter x:Key="SizeColorToRectConverter"/>
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
<Setter Property="LayoutTransform">
<Setter.Value>
@@ -131,12 +132,19 @@
<!-- Item Preview Box -->
<WrapPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">
<Image Source="{Binding DisplayIcon, Converter={StaticResource DropIconConverter}, Mode=OneWay}" Width="30" Height="30" Margin="0,0,10,0" />
<Line Y2="41" StrokeThickness="2" Stroke="{Binding DisplayBeamColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}" Margin="0,2,10,0" >
<Line.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Color="{Binding DisplayBeamColor, Mode=OneWay}" Direction="0"/>
</Line.Effect>
</Line>
<Rectangle Height="40" Width="40" Margin="0,0,10,0">
<Rectangle.Fill>
<ImageBrush ImageSource="{Binding DisplayIconShape, Converter={StaticResource IconShapeToSourceConverter}, Mode=OneWay}"
ViewboxUnits="Absolute" Stretch="Fill">
<ImageBrush.Viewbox>
<MultiBinding Converter="{StaticResource SizeColorToRectConverter}">
<Binding Path="DisplayIconSize"/>
<Binding Path="DisplayIconColor"/>
</MultiBinding>
</ImageBrush.Viewbox>
</ImageBrush>
</Rectangle.Fill>
</Rectangle>
<Button Command="{Binding PlaySoundCommand}"
Width="25"
Height="25"
@@ -173,7 +181,14 @@
ToolTip="Click to preview drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<ToggleButton Margin="0,2,2,2"
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
Stroke="{Binding DisplayEffectColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}"
Margin="10,2,0,0" >
<Line.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Color="{Binding DisplayEffectColor, Mode=OneWay}" Direction="0"/>
</Line.Effect>
</Line>
<ToggleButton Margin="-10,2,2,2"
Style="{StaticResource ChromelessToggleButton}"
x:Name="ItemPreviewButton"
IsChecked="{Binding AudioVisualBlockItemsGridVisible}"

View File

@@ -132,6 +132,8 @@
<fluent:Button SizeDefinition="Middle" Header="Add Font Size" Icon="{StaticResource AddIcon}" Command="{Binding AddFontSizeThemeComponentCommand}" />
<fluent:Button SizeDefinition="Middle" Header="Add Alert Sound" Icon="{StaticResource AddIcon}" Command="{Binding AddAlertSoundThemeComponentCommand}" />
<fluent:Button SizeDefinition="Middle" Header="Add Custom Sound" Icon="{StaticResource AddIcon}" Command="{Binding AddCustomSoundThemeComponentCommand}" />
<fluent:Button SizeDefinition="Middle" Header="Add Icon" Icon="{StaticResource AddIcon}" Command="{Binding AddIconThemeComponentCommand}" />
<fluent:Button SizeDefinition="Middle" Header="Add Effect Color" Icon="{StaticResource AddIcon}" Command="{Binding AddEffectColorThemeComponentCommand}" />
</fluent:RibbonGroupBox>
<fluent:RibbonGroupBox Header="Delete">
<fluent:Button Header="Delete Theme Component" Icon="{StaticResource ThemeComponentDeleteIcon}" LargeIcon="{StaticResource ThemeComponentDeleteIcon}" Command="{Binding DeleteThemeComponentCommand}" />