Add temporary block type for new type
This commit is contained in:
36
Filtration/Converters/DropIconConverter.cs
Normal file
36
Filtration/Converters/DropIconConverter.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Filtration.Converters
|
||||
{
|
||||
internal class DropIconConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var iconString = (string)value;
|
||||
switch(iconString)
|
||||
{
|
||||
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";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,6 +167,7 @@
|
||||
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
|
||||
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
||||
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\DropIconConverter.cs" />
|
||||
<Compile Include="Converters\HashSignRemovalConverter.cs" />
|
||||
<Compile Include="Converters\ItemRarityConverter.cs" />
|
||||
<Compile Include="Converters\TreeViewMarginConverter.cs" />
|
||||
@@ -190,6 +191,9 @@
|
||||
<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>
|
||||
@@ -230,6 +234,10 @@
|
||||
<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>
|
||||
@@ -538,6 +546,12 @@
|
||||
</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" />
|
||||
<Content Include="Resources\ItemBaseTypes.txt" />
|
||||
<Content Include="Resources\ItemClasses.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
BIN
Filtration/Resources/DropIcons/Icon1.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
BIN
Filtration/Resources/DropIcons/Icon2.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
BIN
Filtration/Resources/DropIcons/Icon3.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
Filtration/Resources/DropIcons/Icon4.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
Filtration/Resources/DropIcons/Icon5.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
BIN
Filtration/Resources/DropIcons/Icon6.png
Normal file
BIN
Filtration/Resources/DropIcons/Icon6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -131,6 +131,13 @@
|
||||
<xctk:ShortUpDown Value="{Binding Path=SecondValue}" Minimum="1" Maximum="300" HorizontalAlignment="Right" ToolTip="Volume"/>
|
||||
</WrapPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Drop Icon Template -->
|
||||
<DataTemplate DataType="{x:Type blockItemTypes:IconBlockItem}">
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<userControls:ImageComboBoxControl/>
|
||||
</WrapPanel>
|
||||
</DataTemplate>
|
||||
</ContentControl.Resources>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
|
||||
@@ -88,6 +88,10 @@ namespace Filtration.UserControls
|
||||
"ShFusing", "ShRegal", "ShVaal"
|
||||
};
|
||||
|
||||
public List<string> IconsAvailable => new List<string> {
|
||||
"Icon1", "Icon2", "Icon3", "Icon4", "Icon5", "Icon6"
|
||||
};
|
||||
|
||||
private void OnSetBlockColorCommmand()
|
||||
{
|
||||
var blockItem = BlockItem as ColorBlockItem;
|
||||
|
||||
26
Filtration/UserControls/ImageComboBoxControl.xaml
Normal file
26
Filtration/UserControls/ImageComboBoxControl.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<UserControl
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Filtration.UserControls"
|
||||
xmlns:Converters="clr-namespace:Filtration.Converters" x:Class="Filtration.UserControls.ImageComboBoxControl"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Converters:DropIconConverter x:Key="DropIconConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<ComboBox ItemsSource="{Binding DataContext.IconsAvailable, ElementName=BlockItemContentControl}" SelectedValue="{Binding Value}" Style="{StaticResource MetroComboBox}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image MaxWidth="20" MaxHeight="20" Source="{Binding Converter={StaticResource DropIconConverter}, Mode=OneWay}" />
|
||||
<Label Content="{Binding}" VerticalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
Filtration/UserControls/ImageComboBoxControl.xaml.cs
Normal file
28
Filtration/UserControls/ImageComboBoxControl.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Filtration.UserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ImageComboBoxControl.xaml
|
||||
/// </summary>
|
||||
public partial class ImageComboBoxControl : UserControl
|
||||
{
|
||||
public ImageComboBoxControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,8 @@ namespace Filtration.ViewModels
|
||||
typeof (FontSizeBlockItem),
|
||||
typeof (SoundBlockItem),
|
||||
typeof (PositionalSoundBlockItem),
|
||||
typeof (DisableDropSoundBlockItem)
|
||||
typeof (DisableDropSoundBlockItem),
|
||||
typeof (IconBlockItem)
|
||||
};
|
||||
|
||||
public bool BlockEnabled
|
||||
@@ -214,7 +215,8 @@ 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 bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
|
||||
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
|
||||
|
||||
@@ -437,6 +439,7 @@ namespace Filtration.ViewModels
|
||||
RaisePropertyChanged(nameof(DisplayBackgroundColor));
|
||||
RaisePropertyChanged(nameof(DisplayBorderColor));
|
||||
RaisePropertyChanged(nameof(DisplayFontSize));
|
||||
RaisePropertyChanged(nameof(DisplayIcon));
|
||||
RaisePropertyChanged(nameof(HasSound));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<ResourceDictionary>
|
||||
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
||||
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
||||
<converters:DropIconConverter x:Key="DropIconConverter"/>
|
||||
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
||||
<Setter Property="LayoutTransform">
|
||||
<Setter.Value>
|
||||
@@ -94,6 +95,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- BlockItems Summary Panel -->
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
|
||||
@@ -126,9 +128,10 @@
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!-- 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" />
|
||||
<Button Command="{Binding PlaySoundCommand}"
|
||||
Width="25"
|
||||
Height="25"
|
||||
|
||||
Reference in New Issue
Block a user