Add a DisableDropSound indicator.

This commit is contained in:
GlenCFL 2018-12-06 09:16:30 -05:00
parent dce0af7fd6
commit 72b874e7d5
8 changed files with 55 additions and 18 deletions

View File

@ -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);
}
}
}

View File

@ -210,6 +210,7 @@
<Compile Include="Converters\BooleanToBlockActionInverseConverter.cs" />
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
<Compile Include="Converters\DisabledDefaultSoundConverter.cs" />
<Compile Include="Converters\MinimapIconToCroppedBitmapConverter.cs" />
<Compile Include="Converters\HashSignRemovalConverter.cs" />
<Compile Include="Converters\ItemRarityConverter.cs" />
@ -460,6 +461,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Resource Include="Resources\Icons\sound_dds.png" />
<EmbeddedResource Include="Resources\Prophecies.txt" />
<EmbeddedResource Include="Resources\ItemMods.txt" />
<Resource Include="Resources\loading_spinner.gif" />
@ -504,7 +506,7 @@
<Resource Include="Resources\Icons\open_icon.png" />
<Resource Include="Resources\Icons\arrow_down_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\arrow_top_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

View File

@ -150,6 +150,7 @@ namespace Filtration.ViewModels.DesignTime
public bool HasSound { get; }
public bool HasPositionalSound { get; }
public bool HasCustomSound { get; }
public bool HasDisabledDefaultSound { get; }
public bool HasAudioVisualBlockItems { get; }
public void RefreshBlockPreview()
{

View File

@ -65,6 +65,7 @@ namespace Filtration.ViewModels
bool HasSound { get; }
bool HasPositionalSound { get; }
bool HasCustomSound { get; }
bool HasDisabledDefaultSound { get; }
bool HasAudioVisualBlockItems { get; }
void RefreshBlockPreview();
}
@ -287,6 +288,7 @@ namespace Filtration.ViewModels
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>();
public bool HasPositionalSound => Block.HasBlockItemOfType<PositionalSoundBlockItem>();
public bool HasCustomSound => Block.HasBlockItemOfType<CustomSoundBlockItem>();
public bool HasDisabledDefaultSound => Block.HasBlockItemOfType<DisableDropSoundBlockItem>();
public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any();
@ -526,6 +528,7 @@ namespace Filtration.ViewModels
RaisePropertyChanged(nameof(HasSound));
RaisePropertyChanged(nameof(HasPositionalSound));
RaisePropertyChanged(nameof(HasCustomSound));
RaisePropertyChanged(nameof(HasDisabledDefaultSound));
}
private void OnBlockItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)

View File

@ -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_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/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/about_icon.png" x:Key="AboutIcon" x:Shared="false" />
<Image Source="/Filtration;component/Resources/Icons/ReplaceColors.ico" x:Key="ReplaceColorsIcon" x:Shared="false" />

View File

@ -18,6 +18,7 @@
<views:BindingProxy x:Key="Proxy" Data="{Binding}" />
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
<converters:DisabledDefaultSoundConverter x:Key="DisabledDefaultSoundConverter"/>
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
<Setter Property="LayoutTransform">
<Setter.Value>
@ -138,8 +139,8 @@
</Image.Source>
</Image>
<Button Command="{Binding PlaySoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
@ -147,11 +148,11 @@
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Button Command="{Binding PlayPositionalSoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
@ -159,11 +160,11 @@
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview positional drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Button Command="{Binding PlayCustomSoundCommand}"
Width="25"
Height="25"
Width="32"
Height="32"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,3,0"
@ -171,7 +172,7 @@
Background="Transparent"
BorderBrush="Transparent"
ToolTip="Click to preview custom drop sound">
<Image Source="/Filtration;component/Resources/Icons/speaker_icon.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Image Source="{Binding HasDisabledDefaultSound, Converter={StaticResource DisabledDefaultSoundConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
Stroke="{Binding DisplayEffectColor, Converter={StaticResource ColorToSolidColorBrushConverter}, Mode=OneWay}"