Add a DisableDropSound indicator. (#118)
* Add a DisableDropSound indicator. * Improve the DisableDropSound indicator tooltip.
This commit is contained in:
parent
dce0af7fd6
commit
2f49e85227
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace Filtration.Converters
|
||||||
|
{
|
||||||
|
public class DisabledDefaultSoundConverter : IValueConverter
|
||||||
|
{
|
||||||
|
private static readonly BitmapImage _soundIcon;
|
||||||
|
private static readonly BitmapImage _soundDDSIcon;
|
||||||
|
|
||||||
|
static DisabledDefaultSoundConverter()
|
||||||
|
{
|
||||||
|
var soundUri = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/sound.png", UriKind.Absolute);
|
||||||
|
var soundDDSUri = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/sound_dds.png", UriKind.Absolute);
|
||||||
|
_soundIcon = new BitmapImage(soundUri);
|
||||||
|
_soundDDSIcon = new BitmapImage(soundDDSUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return (bool)value ? _soundDDSIcon : _soundIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return ReferenceEquals(value, _soundDDSIcon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Filtration.Converters
|
||||||
|
{
|
||||||
|
class DisabledDefaultSoundTooltipConverter : IMultiValueConverter
|
||||||
|
{
|
||||||
|
private static readonly string appendage = "\nNote: the default drop sound is disabled for this block.";
|
||||||
|
|
||||||
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (values[0] == DependencyProperty.UnsetValue ||
|
||||||
|
values[1] == DependencyProperty.UnsetValue)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseText = (string)(values[0]);
|
||||||
|
var hasDisabledDefaultSound = (bool)(values[1]);
|
||||||
|
|
||||||
|
if (hasDisabledDefaultSound)
|
||||||
|
{
|
||||||
|
return $"{baseText}{appendage}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return baseText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -210,6 +210,8 @@
|
||||||
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
|
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
|
||||||
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
||||||
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
|
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
|
||||||
|
<Compile Include="Converters\DisabledDefaultSoundConverter.cs" />
|
||||||
|
<Compile Include="Converters\DisabledDefaultSoundTooltipConverter.cs" />
|
||||||
<Compile Include="Converters\MinimapIconToCroppedBitmapConverter.cs" />
|
<Compile Include="Converters\MinimapIconToCroppedBitmapConverter.cs" />
|
||||||
<Compile Include="Converters\HashSignRemovalConverter.cs" />
|
<Compile Include="Converters\HashSignRemovalConverter.cs" />
|
||||||
<Compile Include="Converters\ItemRarityConverter.cs" />
|
<Compile Include="Converters\ItemRarityConverter.cs" />
|
||||||
|
@ -460,6 +462,7 @@
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Resource Include="Resources\Icons\sound_dds.png" />
|
||||||
<EmbeddedResource Include="Resources\Prophecies.txt" />
|
<EmbeddedResource Include="Resources\Prophecies.txt" />
|
||||||
<EmbeddedResource Include="Resources\ItemMods.txt" />
|
<EmbeddedResource Include="Resources\ItemMods.txt" />
|
||||||
<Resource Include="Resources\loading_spinner.gif" />
|
<Resource Include="Resources\loading_spinner.gif" />
|
||||||
|
@ -504,7 +507,7 @@
|
||||||
<Resource Include="Resources\Icons\open_icon.png" />
|
<Resource Include="Resources\Icons\open_icon.png" />
|
||||||
<Resource Include="Resources\Icons\arrow_down_large_icon.png" />
|
<Resource Include="Resources\Icons\arrow_down_large_icon.png" />
|
||||||
<Resource Include="Resources\Icons\arrow_up_large_icon.png" />
|
<Resource Include="Resources\Icons\arrow_up_large_icon.png" />
|
||||||
<Resource Include="Resources\Icons\speaker_icon.png" />
|
<Resource Include="Resources\Icons\sound.png" />
|
||||||
<Resource Include="Resources\Icons\play_icon.png" />
|
<Resource Include="Resources\Icons\play_icon.png" />
|
||||||
<Resource Include="Resources\Icons\arrow_top_icon.png" />
|
<Resource Include="Resources\Icons\arrow_top_icon.png" />
|
||||||
<Resource Include="Resources\Icons\arrow_bottom_icon.png" />
|
<Resource Include="Resources\Icons\arrow_bottom_icon.png" />
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
|
@ -150,6 +150,7 @@ namespace Filtration.ViewModels.DesignTime
|
||||||
public bool HasSound { get; }
|
public bool HasSound { get; }
|
||||||
public bool HasPositionalSound { get; }
|
public bool HasPositionalSound { get; }
|
||||||
public bool HasCustomSound { get; }
|
public bool HasCustomSound { get; }
|
||||||
|
public bool HasDisabledDefaultSound { get; }
|
||||||
public bool HasAudioVisualBlockItems { get; }
|
public bool HasAudioVisualBlockItems { get; }
|
||||||
public void RefreshBlockPreview()
|
public void RefreshBlockPreview()
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace Filtration.ViewModels
|
||||||
bool HasSound { get; }
|
bool HasSound { get; }
|
||||||
bool HasPositionalSound { get; }
|
bool HasPositionalSound { get; }
|
||||||
bool HasCustomSound { get; }
|
bool HasCustomSound { get; }
|
||||||
|
bool HasDisabledDefaultSound { get; }
|
||||||
bool HasAudioVisualBlockItems { get; }
|
bool HasAudioVisualBlockItems { get; }
|
||||||
void RefreshBlockPreview();
|
void RefreshBlockPreview();
|
||||||
}
|
}
|
||||||
|
@ -287,6 +288,7 @@ namespace Filtration.ViewModels
|
||||||
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
|
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
|
||||||
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
|
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
|
||||||
public bool HasCustomSound => Block.HasBlockItemOfType<CustomSoundBlockItem>();
|
public bool HasCustomSound => Block.HasBlockItemOfType<CustomSoundBlockItem>();
|
||||||
|
public bool HasDisabledDefaultSound => Block.HasBlockItemOfType<DisableDropSoundBlockItem>();
|
||||||
|
|
||||||
public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any();
|
public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any();
|
||||||
|
|
||||||
|
@ -526,6 +528,7 @@ namespace Filtration.ViewModels
|
||||||
RaisePropertyChanged(nameof(HasSound));
|
RaisePropertyChanged(nameof(HasSound));
|
||||||
RaisePropertyChanged(nameof(HasPositionalSound));
|
RaisePropertyChanged(nameof(HasPositionalSound));
|
||||||
RaisePropertyChanged(nameof(HasCustomSound));
|
RaisePropertyChanged(nameof(HasCustomSound));
|
||||||
|
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBlockItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void OnBlockItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<Image Source="/Filtration;component/Resources/Icons/arrow_up_large_icon.png" x:Key="MoveUpIcon" x:Shared="false" />
|
<Image Source="/Filtration;component/Resources/Icons/arrow_up_large_icon.png" x:Key="MoveUpIcon" x:Shared="false" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/arrow_bottom_icon.png" x:Key="MoveToBottomIcon" x:Shared="false" />
|
<Image Source="/Filtration;component/Resources/Icons/arrow_bottom_icon.png" x:Key="MoveToBottomIcon" x:Shared="false" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/arrow_down_large_icon.png" x:Key="MoveDownIcon" x:Shared="false" />
|
<Image Source="/Filtration;component/Resources/Icons/arrow_down_large_icon.png" x:Key="MoveDownIcon" x:Shared="false" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" x:Key="SpeakerIcon" x:Shared="false" />
|
|
||||||
<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/ReplaceColors.ico" x:Key="ReplaceColorsIcon" x:Shared="false" />
|
<Image Source="/Filtration;component/Resources/Icons/ReplaceColors.ico" x:Key="ReplaceColorsIcon" x:Shared="false" />
|
||||||
|
@ -37,4 +36,4 @@
|
||||||
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="StandbyDisabledIcon" x:Shared="False" />
|
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="StandbyDisabledIcon" x:Shared="False" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/standby_enabled_icon.png" x:Key="EnableDropSoundsIcon" x:Shared="False" />
|
<Image Source="/Filtration;component/Resources/Icons/standby_enabled_icon.png" x:Key="EnableDropSoundsIcon" x:Shared="False" />
|
||||||
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="DisableDropSoundsIcon" x:Shared="False" />
|
<Image Source="/Filtration;component/Resources/Icons/standby_disabled_icon.png" x:Key="DisableDropSoundsIcon" x:Shared="False" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<UserControl x:Class="Filtration.Views.ItemFilterBlockView"
|
<UserControl x:Class="Filtration.Views.ItemFilterBlockView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
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:userControls="clr-namespace:Filtration.UserControls"
|
xmlns:userControls="clr-namespace:Filtration.UserControls"
|
||||||
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
|
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
xmlns:blockItemBaseTypes="clr-namespace:Filtration.ObjectModel.BlockItemBaseTypes;assembly=Filtration.ObjectModel"
|
||||||
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||||
xmlns:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
xmlns:designTime="clr-namespace:Filtration.ViewModels.DesignTime"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemFilterBlockViewModel, IsDesignTimeCreatable=True}"
|
d:DataContext="{d:DesignInstance Type=designTime:DesignTimeItemFilterBlockViewModel, IsDesignTimeCreatable=True}"
|
||||||
d:DesignHeight="400" d:DesignWidth="817">
|
d:DesignHeight="400" d:DesignWidth="817">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
|
@ -18,6 +18,8 @@
|
||||||
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
|
||||||
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
||||||
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
|
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
|
||||||
|
<converters:DisabledDefaultSoundConverter x:Key="DisabledDefaultSoundConverter"/>
|
||||||
|
<converters:DisabledDefaultSoundTooltipConverter x:Key="DisabledDefaultSoundTooltipConverter"/>
|
||||||
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
||||||
<Setter Property="LayoutTransform">
|
<Setter Property="LayoutTransform">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
|
@ -130,48 +132,63 @@
|
||||||
<WrapPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">
|
<WrapPanel Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">
|
||||||
<Image Height="40" Width="40" Margin="0,0,10,0" Stretch="Fill">
|
<Image Height="40" Width="40" Margin="0,0,10,0" Stretch="Fill">
|
||||||
<Image.Source>
|
<Image.Source>
|
||||||
<MultiBinding Converter="{StaticResource MinimapIconToCroppedBitmapConverter}">
|
<MultiBinding Converter="{StaticResource MinimapIconToCroppedBitmapConverter}">
|
||||||
<Binding Path="DisplayIconSize"/>
|
<Binding Path="DisplayIconSize"/>
|
||||||
<Binding Path="DisplayIconColor"/>
|
<Binding Path="DisplayIconColor"/>
|
||||||
<Binding Path="DisplayIconShape"/>
|
<Binding Path="DisplayIconShape"/>
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Image.Source>
|
</Image.Source>
|
||||||
</Image>
|
</Image>
|
||||||
<Button Command="{Binding PlaySoundCommand}"
|
<Button Command="{Binding PlaySoundCommand}"
|
||||||
Width="25"
|
Width="32"
|
||||||
Height="25"
|
Height="32"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Margin="0,0,3,0"
|
Margin="0,0,3,0"
|
||||||
Visibility="{Binding HasSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
Visibility="{Binding HasSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent">
|
||||||
ToolTip="Click to preview drop sound">
|
<Button.ToolTip>
|
||||||
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
|
||||||
|
<Binding Source="Click to preview drop sound."/>
|
||||||
|
<Binding Path="HasDisabledDefaultSound"/>
|
||||||
|
</MultiBinding>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding PlayPositionalSoundCommand}"
|
<Button Command="{Binding PlayPositionalSoundCommand}"
|
||||||
Width="25"
|
Width="32"
|
||||||
Height="25"
|
Height="32"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Margin="0,0,3,0"
|
Margin="0,0,3,0"
|
||||||
Visibility="{Binding HasPositionalSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
Visibility="{Binding HasPositionalSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent">
|
||||||
ToolTip="Click to preview positional drop sound">
|
<Button.ToolTip>
|
||||||
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
|
||||||
|
<Binding Source="Click to preview positional drop sound."/>
|
||||||
|
<Binding Path="HasDisabledDefaultSound"/>
|
||||||
|
</MultiBinding>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding PlayCustomSoundCommand}"
|
<Button Command="{Binding PlayCustomSoundCommand}"
|
||||||
Width="25"
|
Width="32"
|
||||||
Height="25"
|
Height="32"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Margin="0,0,3,0"
|
Margin="0,0,3,0"
|
||||||
Visibility="{Binding HasCustomSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
Visibility="{Binding HasCustomSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent">
|
||||||
ToolTip="Click to preview custom drop sound">
|
<Button.ToolTip>
|
||||||
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
<MultiBinding Converter="{StaticResource DisabledDefaultSoundTooltipConverter}">
|
||||||
|
<Binding Source="Click to preview custom drop sound."/>
|
||||||
|
<Binding Path="HasDisabledDefaultSound"/>
|
||||||
|
</MultiBinding>
|
||||||
|
</Button.ToolTip>
|
||||||
|
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
|
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
|
||||||
Stroke="{Binding DisplayEffectColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}"
|
Stroke="{Binding DisplayEffectColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}"
|
||||||
|
|
Loading…
Reference in New Issue