Make the minimap icon preview transparent.

This commit is contained in:
GlenCFL 2018-09-01 06:58:59 -04:00
parent 0209de3817
commit 1fd96d4a48
122 changed files with 228 additions and 166 deletions

View File

@ -1,37 +0,0 @@
using Filtration.ObjectModel.Enums;
using System;
using System.Globalization;
using System.Windows.Data;
namespace Filtration.Converters
{
internal class IconShapeToSourceConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var iconShape = (IconShape)(int)value;
switch (iconShape)
{
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";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,98 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Filtration.ObjectModel.Enums;
namespace Filtration.Converters
{
internal class MinimapIconConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var prefix = "pack://application:,,,/Filtration;component/Resources/DropIcons";
var noIconPath = $"{prefix}/none.png";
if (values[0] == DependencyProperty.UnsetValue ||
values[1] == DependencyProperty.UnsetValue ||
values[2] == DependencyProperty.UnsetValue) {
return new BitmapImage(new Uri(noIconPath, UriKind.Absolute));
}
var iconSize = (IconSize)(int)(values[0]);
var iconColor = (IconColor)(int)(values[1]);
var iconShape = (IconShape)(int)(values[2]);
string iconSizeText, iconColorText, iconShapeText;
switch (iconSize) {
case IconSize.Largest:
iconSizeText = "0";
break;
case IconSize.Medium:
iconSizeText = "1";
break;
case IconSize.Small:
iconSizeText = "2";
break;
default:
return new BitmapImage(new Uri(noIconPath, UriKind.Absolute));
}
switch (iconColor) {
case IconColor.Blue:
iconColorText = "blue";
break;
case IconColor.Brown:
iconColorText = "brown";
break;
case IconColor.Green:
iconColorText = "green";
break;
case IconColor.Red:
iconColorText = "red";
break;
case IconColor.White:
iconColorText = "white";
break;
case IconColor.Yellow:
iconColorText = "yellow";
break;
default:
return new BitmapImage(new Uri(noIconPath, UriKind.Absolute));
}
switch (iconShape) {
case IconShape.Circle:
iconShapeText = "circle";
break;
case IconShape.Diamond:
iconShapeText = "diamond";
break;
case IconShape.Hexagon:
iconShapeText = "hexagon";
break;
case IconShape.Square:
iconShapeText = "square";
break;
case IconShape.Star:
iconShapeText = "star";
break;
case IconShape.Triangle:
iconShapeText = "triangle";
break;
default:
return new BitmapImage(new Uri(noIconPath, UriKind.Relative));
}
return new BitmapImage(new Uri($"{prefix}/{iconShapeText}_{iconColorText}_{iconSizeText}.png",
UriKind.Absolute));
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,38 +0,0 @@
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)
{
if (values[0] == DependencyProperty.UnsetValue ||
values[1] == DependencyProperty.UnsetValue)
return new Rect(0, 0, 0, 0);
var size = (int)(values[0]);
var color = (int)(values[1]);
if (size < 0 || color < 0)
return new Rect(0, 0, 0, 0);
var cropArea = new Rect
{
Width = 64,
Height = 64,
X = 0 + size * 64,
Y = 0 + color * 64
};
return cropArea;
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -167,9 +167,8 @@
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
<Compile Include="Converters\SizeColorToRectConverter.cs" />
<Compile Include="Converters\MinimapIconConverter.cs" />
<Compile Include="Converters\HashSignRemovalConverter.cs" />
<Compile Include="Converters\IconShapeToSourceConverter.cs" />
<Compile Include="Converters\ItemRarityConverter.cs" />
<Compile Include="Converters\TreeViewMarginConverter.cs" />
<Compile Include="Models\UpdateData.cs" />
@ -190,9 +189,6 @@
<Compile Include="UserControls\EditableListBoxControl.xaml.cs">
<DependentUpon>EditableListBoxControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\ImageComboBoxControl.xaml.cs">
<DependentUpon>ImageComboBoxControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\ItemPreviewControl.xaml.cs">
<DependentUpon>ItemPreviewControl.xaml</DependentUpon>
</Compile>
@ -233,10 +229,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\ImageComboBoxControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\ThemeComponentSelectionControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -545,13 +537,115 @@
</None>
<Resource Include="Resources\Icons\redo_icon.png" />
<Resource Include="Resources\Icons\undo_icon.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" />
<Resource Include="Resources\DropIcons\circle_red_0.png" />
<Resource Include="Resources\DropIcons\circle_blue_0.png" />
<Resource Include="Resources\DropIcons\circle_blue_1.png" />
<Resource Include="Resources\DropIcons\circle_blue_2.png" />
<Resource Include="Resources\DropIcons\circle_brown_0.png" />
<Resource Include="Resources\DropIcons\circle_brown_1.png" />
<Resource Include="Resources\DropIcons\circle_brown_2.png" />
<Resource Include="Resources\DropIcons\circle_green_0.png" />
<Resource Include="Resources\DropIcons\circle_green_1.png" />
<Resource Include="Resources\DropIcons\circle_green_2.png" />
<Resource Include="Resources\DropIcons\circle_red_1.png" />
<Resource Include="Resources\DropIcons\circle_red_2.png" />
<Resource Include="Resources\DropIcons\circle_white_0.png" />
<Resource Include="Resources\DropIcons\circle_white_1.png" />
<Resource Include="Resources\DropIcons\circle_white_2.png" />
<Resource Include="Resources\DropIcons\circle_yellow_0.png" />
<Resource Include="Resources\DropIcons\circle_yellow_1.png" />
<Resource Include="Resources\DropIcons\circle_yellow_2.png" />
<Resource Include="Resources\DropIcons\diamond_blue_0.png" />
<Resource Include="Resources\DropIcons\diamond_blue_1.png" />
<Resource Include="Resources\DropIcons\diamond_blue_2.png" />
<Resource Include="Resources\DropIcons\diamond_brown_0.png" />
<Resource Include="Resources\DropIcons\diamond_brown_1.png" />
<Resource Include="Resources\DropIcons\diamond_brown_2.png" />
<Resource Include="Resources\DropIcons\diamond_green_0.png" />
<Resource Include="Resources\DropIcons\diamond_green_1.png" />
<Resource Include="Resources\DropIcons\diamond_green_2.png" />
<Resource Include="Resources\DropIcons\diamond_red_0.png" />
<Resource Include="Resources\DropIcons\diamond_red_1.png" />
<Resource Include="Resources\DropIcons\diamond_red_2.png" />
<Resource Include="Resources\DropIcons\diamond_white_0.png" />
<Resource Include="Resources\DropIcons\diamond_white_1.png" />
<Resource Include="Resources\DropIcons\diamond_white_2.png" />
<Resource Include="Resources\DropIcons\diamond_yellow_0.png" />
<Resource Include="Resources\DropIcons\diamond_yellow_1.png" />
<Resource Include="Resources\DropIcons\diamond_yellow_2.png" />
<Resource Include="Resources\DropIcons\hexagon_blue_0.png" />
<Resource Include="Resources\DropIcons\hexagon_blue_1.png" />
<Resource Include="Resources\DropIcons\hexagon_blue_2.png" />
<Resource Include="Resources\DropIcons\hexagon_brown_0.png" />
<Resource Include="Resources\DropIcons\hexagon_brown_1.png" />
<Resource Include="Resources\DropIcons\hexagon_brown_2.png" />
<Resource Include="Resources\DropIcons\hexagon_green_0.png" />
<Resource Include="Resources\DropIcons\hexagon_green_1.png" />
<Resource Include="Resources\DropIcons\hexagon_green_2.png" />
<Resource Include="Resources\DropIcons\hexagon_red_0.png" />
<Resource Include="Resources\DropIcons\hexagon_red_1.png" />
<Resource Include="Resources\DropIcons\hexagon_red_2.png" />
<Resource Include="Resources\DropIcons\hexagon_white_0.png" />
<Resource Include="Resources\DropIcons\hexagon_white_1.png" />
<Resource Include="Resources\DropIcons\hexagon_white_2.png" />
<Resource Include="Resources\DropIcons\hexagon_yellow_0.png" />
<Resource Include="Resources\DropIcons\hexagon_yellow_1.png" />
<Resource Include="Resources\DropIcons\hexagon_yellow_2.png" />
<Resource Include="Resources\DropIcons\none.png" />
<Resource Include="Resources\DropIcons\square_blue_0.png" />
<Resource Include="Resources\DropIcons\square_blue_1.png" />
<Resource Include="Resources\DropIcons\square_blue_2.png" />
<Resource Include="Resources\DropIcons\square_brown_0.png" />
<Resource Include="Resources\DropIcons\square_brown_1.png" />
<Resource Include="Resources\DropIcons\square_brown_2.png" />
<Resource Include="Resources\DropIcons\square_green_0.png" />
<Resource Include="Resources\DropIcons\square_green_1.png" />
<Resource Include="Resources\DropIcons\square_green_2.png" />
<Resource Include="Resources\DropIcons\square_red_0.png" />
<Resource Include="Resources\DropIcons\square_red_1.png" />
<Resource Include="Resources\DropIcons\square_red_2.png" />
<Resource Include="Resources\DropIcons\square_white_0.png" />
<Resource Include="Resources\DropIcons\square_white_1.png" />
<Resource Include="Resources\DropIcons\square_white_2.png" />
<Resource Include="Resources\DropIcons\square_yellow_0.png" />
<Resource Include="Resources\DropIcons\square_yellow_1.png" />
<Resource Include="Resources\DropIcons\square_yellow_2.png" />
<Resource Include="Resources\DropIcons\star_blue_0.png" />
<Resource Include="Resources\DropIcons\star_blue_1.png" />
<Resource Include="Resources\DropIcons\star_blue_2.png" />
<Resource Include="Resources\DropIcons\star_brown_0.png" />
<Resource Include="Resources\DropIcons\star_brown_1.png" />
<Resource Include="Resources\DropIcons\star_brown_2.png" />
<Resource Include="Resources\DropIcons\star_green_0.png" />
<Resource Include="Resources\DropIcons\star_green_1.png" />
<Resource Include="Resources\DropIcons\star_green_2.png" />
<Resource Include="Resources\DropIcons\star_red_0.png" />
<Resource Include="Resources\DropIcons\star_red_1.png" />
<Resource Include="Resources\DropIcons\star_red_2.png" />
<Resource Include="Resources\DropIcons\star_white_0.png" />
<Resource Include="Resources\DropIcons\star_white_1.png" />
<Resource Include="Resources\DropIcons\star_white_2.png" />
<Resource Include="Resources\DropIcons\star_yellow_0.png" />
<Resource Include="Resources\DropIcons\star_yellow_1.png" />
<Resource Include="Resources\DropIcons\star_yellow_2.png" />
<Resource Include="Resources\DropIcons\triangle_blue_0.png" />
<Resource Include="Resources\DropIcons\triangle_blue_1.png" />
<Resource Include="Resources\DropIcons\triangle_blue_2.png" />
<Resource Include="Resources\DropIcons\triangle_brown_0.png" />
<Resource Include="Resources\DropIcons\triangle_brown_1.png" />
<Resource Include="Resources\DropIcons\triangle_brown_2.png" />
<Resource Include="Resources\DropIcons\triangle_green_0.png" />
<Resource Include="Resources\DropIcons\triangle_green_1.png" />
<Resource Include="Resources\DropIcons\triangle_green_2.png" />
<Resource Include="Resources\DropIcons\triangle_red_0.png" />
<Resource Include="Resources\DropIcons\triangle_red_1.png" />
<Resource Include="Resources\DropIcons\triangle_red_2.png" />
<Resource Include="Resources\DropIcons\triangle_white_0.png" />
<Resource Include="Resources\DropIcons\triangle_white_1.png" />
<Resource Include="Resources\DropIcons\triangle_white_2.png" />
<Resource Include="Resources\DropIcons\triangle_yellow_0.png" />
<Resource Include="Resources\DropIcons\triangle_yellow_1.png" />
<Resource Include="Resources\DropIcons\triangle_yellow_2.png" />
<Content Include="Resources\ItemBaseTypes.txt" />
<Content Include="Resources\ItemClasses.txt" />
</ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Some files were not shown because too many files have changed in this diff Show More