Improve the DisableDropSound indicator tooltip.
This commit is contained in:
parent
72b874e7d5
commit
7fe896b1d8
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@ -211,6 +211,7 @@
|
||||
<Compile Include="Converters\BooleanToBlockActionConverter.cs" />
|
||||
<Compile Include="Converters\BlockItemToRemoveEnabledVisibilityConverter.cs" />
|
||||
<Compile Include="Converters\DisabledDefaultSoundConverter.cs" />
|
||||
<Compile Include="Converters\DisabledDefaultSoundTooltipConverter.cs" />
|
||||
<Compile Include="Converters\MinimapIconToCroppedBitmapConverter.cs" />
|
||||
<Compile Include="Converters\HashSignRemovalConverter.cs" />
|
||||
<Compile Include="Converters\ItemRarityConverter.cs" />
|
||||
|
@ -19,6 +19,7 @@
|
||||
<converters:BlockGroupAdvancedFillColorConverter x:Key="BlockGroupAdvancedFillColorConverter" />
|
||||
<converters:MinimapIconToCroppedBitmapConverter x:Key="MinimapIconToCroppedBitmapConverter"/>
|
||||
<converters:DisabledDefaultSoundConverter x:Key="DisabledDefaultSoundConverter"/>
|
||||
<converters:DisabledDefaultSoundTooltipConverter x:Key="DisabledDefaultSoundTooltipConverter"/>
|
||||
<Style TargetType="{x:Type ContentPresenter}" x:Key="BlockItemFadeInStyle">
|
||||
<Setter Property="LayoutTransform">
|
||||
<Setter.Value>
|
||||
@ -146,8 +147,13 @@
|
||||
Margin="0,0,3,0"
|
||||
Visibility="{Binding HasSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
ToolTip="Click to preview drop sound">
|
||||
BorderBrush="Transparent">
|
||||
<Button.ToolTip>
|
||||
<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 Command="{Binding PlayPositionalSoundCommand}"
|
||||
@ -158,8 +164,13 @@
|
||||
Margin="0,0,3,0"
|
||||
Visibility="{Binding HasPositionalSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
ToolTip="Click to preview positional drop sound">
|
||||
BorderBrush="Transparent">
|
||||
<Button.ToolTip>
|
||||
<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 Command="{Binding PlayCustomSoundCommand}"
|
||||
@ -170,8 +181,13 @@
|
||||
Margin="0,0,3,0"
|
||||
Visibility="{Binding HasCustomSound, Converter={StaticResource BooleanVisibilityConverter}}"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
ToolTip="Click to preview custom drop sound">
|
||||
BorderBrush="Transparent">
|
||||
<Button.ToolTip>
|
||||
<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>
|
||||
<Line Y1="5" Y2="38" StrokeThickness="2" Panel.ZIndex="999"
|
||||
|
Loading…
x
Reference in New Issue
Block a user