Skip to content

Commit

Permalink
SlotItemCatalog: proficiency icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuubari committed Nov 6, 2015
1 parent 3fc0771 commit 7da8b58
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Windows;
using System.Windows.Controls;
using Grabacr07.KanColleWrapper.Models;

namespace Grabacr07.KanColleViewer.Controls
{
public class AircraftProficiencyIcon : Control
{
static AircraftProficiencyIcon()
{
DefaultStyleKeyProperty.OverrideMetadata(
typeof(AircraftProficiencyIcon),
new FrameworkPropertyMetadata(typeof(AircraftProficiencyIcon)));
}

public int Level
{
get { return (int)this.GetValue(LevelProperty); }
set { this.SetValue(LevelProperty, value); }
}

public static readonly DependencyProperty LevelProperty =
DependencyProperty.Register(nameof(Level), typeof(int), typeof(AircraftProficiencyIcon), new UIPropertyMetadata(0));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<Reference Include="Microsoft.Expression.Interactions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -120,13 +122,19 @@
<SubType>Designer</SubType>
<DependentUpon>Generic.xaml</DependentUpon>
</Page>
<Page Include="Themes\Generic.AircraftProficiencyIcon.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<DependentUpon>Generic.xaml</DependentUpon>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Controls.Globalization\ResourceService.cs" />
<Compile Include="Controls\AircraftProficiencyIcon.cs" />
<Compile Include="Controls\AppIcon.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:controls="clr-namespace:Grabacr07.KanColleViewer.Controls">
<Style x:Key="PilotBeginnerProficiency" TargetType="{x:Type Rectangle}">
<Setter Property="Stroke" Value="#D1D3D5" />
<Setter Property="Fill" Value="#9AB5D0" />
<Setter Property="StrokeThickness" Value="0.5" />
<Setter Property="RadiusX" Value="0.5" />
<Setter Property="RadiusY" Value="0.5" />
<Setter Property="Height" Value="25" />
<Setter Property="Width" Value="4" />
<Setter Property="Canvas.Top" Value="0" />
<Setter Property="Canvas.Left" Value="0" />
</Style>
<Style x:Key="PilotIntermediateProficiency" TargetType="{x:Type Path}">
<Setter Property="Data" Value="F1 M 0.666666,3.8147e-006L 4.66666,3.8147e-006C 5.03485,3.8147e-006 5.33333,0.298477 5.33333,0.666668L 13.5893,32.6667C 13.5893,33.0349 13.2909,33.3333 12.9227,33.3333L 8.92268,33.3333C 8.55449,33.3333 8.25602,33.0349 8.25602,32.6667L -2.95851e-007,0.666668C -2.95851e-007,0.298477 0.298476,3.8147e-006 0.666666,3.8147e-006 Z " />
<Setter Property="StrokeThickness" Value="0.5" />
<Setter Property="Stroke" Value="#C2B789" />
<Setter Property="Fill" Value="#D59C08" />
<Setter Property="Height" Value="25" />
<Setter Property="Width" Value="10" />
<Setter Property="Canvas.Top" Value="0" />
<Setter Property="Canvas.Left" Value="0" />
<Setter Property="StrokeLineJoin" Value="Round" />
<Setter Property="Stretch" Value="Uniform" />
</Style>
<Style x:Key="PilotMasterProficiency" TargetType="{x:Type Path}">
<Setter Property="Data" Value="M 11.8449,17.0962L 17.1782,17.0962L 26.7456,33.7612L 17.1782,50.4296L 11.8449,50.4296L 21.4123,33.7612L 11.8449,17.0962 Z " />
<Setter Property="StrokeThickness" Value="0.5" />
<Setter Property="Stroke" Value="#C1B996" />
<Setter Property="Fill" Value="#D49B0E" />
<Setter Property="Height" Value="25" />
<Setter Property="Width" Value="12" />
<Setter Property="Canvas.Top" Value="0" />
<Setter Property="Canvas.Left" Value="0" />
<Setter Property="StrokeLineJoin" Value="Round" />
<Setter Property="Stretch" Value="Uniform" />
</Style>
<Style TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Setter Property="Width"
Value="26" />
<Setter Property="Height"
Value="26" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Level"
Value="1">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="2">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" />
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" Canvas.Left="6" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="3">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" />
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" Canvas.Left="6" />
<Rectangle Style="{StaticResource PilotBeginnerProficiency}" Canvas.Left="11.5" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="4">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Path Style="{StaticResource PilotIntermediateProficiency}" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="5">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Path Style="{StaticResource PilotIntermediateProficiency}" />
<Path Style="{StaticResource PilotIntermediateProficiency}" Canvas.Left="6" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="6">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Path Style="{StaticResource PilotIntermediateProficiency}" />
<Path Style="{StaticResource PilotIntermediateProficiency}" Canvas.Left="6" />
<Path Style="{StaticResource PilotIntermediateProficiency}" Canvas.Left="11.5" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="Level"
Value="7">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AircraftProficiencyIcon}">
<Canvas>
<Path Style="{StaticResource PilotMasterProficiency}" />
<Path Style="{StaticResource PilotMasterProficiency}" Canvas.Left="6" />
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ResourceDictionary Source="/KanColleViewer.Controls;component/Themes/Generic.Modernizable.xaml" />
<ResourceDictionary Source="/KanColleViewer.Controls;component/Themes/Generic.Quest.xaml" />
<ResourceDictionary Source="/KanColleViewer.Controls;component/Themes/Generic.SlotItemIcon.xaml" />
<ResourceDictionary Source="/KanColleViewer.Controls;component/Themes/Generic.AircraftProficiencyIcon.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<DockPanel Grid.Row="1">
<Border DockPanel.Dock="Top"
Margin="8,8,8,0">
<metro2:CallMethodButton Content="{Binding Resources.SlotItemCatalog_Refresh, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
<metro2:CallMethodButton Content="{Binding Resources.SlotItemCatalog_Refresh, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Padding="40,6"
MethodName="Update"
HorizontalAlignment="Left" />
Expand Down Expand Up @@ -131,7 +131,7 @@
<GridView>
<GridViewColumn Width="190">
<GridViewColumn.Header>
<TextBlock Text="{Binding Resources.SlotItemCatalog_ItemName, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<TextBlock Text="{Binding Resources.SlotItemCatalog_ItemName, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type viewModels:SlotItemCounter}">
Expand All @@ -151,7 +151,7 @@

<GridViewColumn Width="52">
<GridViewColumn.Header>
<TextBlock Text="{Binding Resources.SlotItemCatalog_Total, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<TextBlock Text="{Binding Resources.SlotItemCatalog_Total, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type viewModels:SlotItemCounter}">
Expand All @@ -168,12 +168,12 @@
<Border Width="52"
BorderThickness="0,0,1,0"
BorderBrush="{DynamicResource BorderBrushKey}">
<TextBlock Text="{Binding Resources.SlotItemCatalog_ImprovementLevel, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<TextBlock Text="{Binding Resources.SlotItemCatalog_ImprovementLevel, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
</Border>
<Border Width="52"
BorderThickness="0,0,1,0"
BorderBrush="{DynamicResource BorderBrushKey}">
<TextBlock Text="{Binding Resources.SlotItemCatalog_SkillLevel, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<TextBlock Text="{Binding Resources.SlotItemCatalog_SkillLevel, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
</Border>
<Border Width="82"
BorderThickness="0,0,1,0"
Expand All @@ -185,7 +185,7 @@
</TextBlock>
</Border>
<Border>
<TextBlock Text="{Binding Resources.SlotItemCatalog_Equipped, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<TextBlock Text="{Binding Resources.SlotItemCatalog_Equipped, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
</Border>
</DockPanel>
</GridViewColumn.Header>
Expand Down Expand Up @@ -228,7 +228,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Width="53"
<!--<TextBlock Width="53"
Margin="0,4">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
Expand All @@ -254,7 +254,38 @@
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</TextBlock>-->
<Viewbox Width="53" Height="12pt" >
<kcvc:AircraftProficiencyIcon Level="{Binding CounterKey.Adept}"/>
<Viewbox.ToolTip>
<TextBlock>
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text"
Value="{Binding CounterKey.Adept, StringFormat=+{0}}" />
<Setter Property="Foreground"
Value="#FFD49C0F" />
<Setter Property="Opacity"
Value="1.0" />
<Style.Triggers>
<DataTrigger Binding="{Binding CounterKey.Adept}"
Value="0">
<Setter Property="Foreground"
Value="{DynamicResource InactiveForegroundBrushKey}" />
<Setter Property="Opacity"
Value=".5" />
</DataTrigger>
<DataTrigger Binding="{Binding CounterKey.Adept, Converter={StaticResource RangeToBooleanConverter}, ConverterParameter=1-3}"
Value="True">
<Setter Property="Foreground"
Value="#FF98B3CE" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Viewbox.ToolTip>
</Viewbox>
<TextBlock Width="83"
Margin="0,4">
<Run Text="{Binding Count, Mode=OneWay}"
Expand Down Expand Up @@ -306,7 +337,7 @@
Padding="20"
Visibility="{Binding IsReloading, Converter={StaticResource BooleanToVisibilityConverter}}"
d:IsHidden="True">
<TextBlock Text="{Binding Resources.SlotItemCatalog_Refreshing, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
<TextBlock Text="{Binding Resources.SlotItemCatalog_Refreshing, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Style="{DynamicResource EmphaticTextStyleKey}"
FontSize="16"
Background="{DynamicResource ThemeBrushKey}"
Expand Down

0 comments on commit 7da8b58

Please sign in to comment.