Skip to content

Commit

Permalink
Finalise additional stats display
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuubari committed Nov 10, 2015
1 parent 013dca4 commit 93ecd92
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ public class KanColleWindowSettings : WindowSettings

}

public class ShipCatalogWindowSettings : WindowSettings { }
public class ShipCatalogWindowSettings : WindowSettings
{
public SerializableProperty<bool> ShowAdditionalStats => this.Cache(key => new SerializableProperty<bool>(key, Providers.Roaming, false));
}

public class SlotItemCatalogWindowSettings : WindowSettings { }
public class SlotItemCatalogWindowSettings : WindowSettings
{
public SerializableProperty<bool> ShowEquipmentStats => this.Cache(key => new SerializableProperty<bool>(key, Providers.Roaming, false));
}
}
2 changes: 1 addition & 1 deletion source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.5.8")]
[assembly: AssemblyVersion("4.1.5.9")]
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ HTTP proxy settings are applied immediately. Settings for all other protocols ar
<value>Refreshing the list…</value>
</data>
<data name="SlotItemCatalog_SkillLevel" xml:space="preserve">
<value>Skill</value>
<value>Rank</value>
</data>
<data name="SlotItemCatalog_Stats" xml:space="preserve">
<value>Stats</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ public bool IsReloading

#endregion

public bool ShowAdditionalStats
{
get { return this.Settings.ShowAdditionalStats.Value; }
set
{
if (this.Settings.ShowAdditionalStats.Value != value)
{
this.Settings.ShowAdditionalStats.Value = value;
this.RaisePropertyChanged();
}
}
}

public ShipCatalogWindowViewModel()
{
this.Title = Resources.ShipCatalog_WindowTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ public bool IsReloading

#endregion

private bool showStats;

public bool ShowStats
{
get { return this.showStats; }
get { return this.Settings.ShowEquipmentStats.Value; }
set
{
if (this.showStats != value)
if (this.Settings.ShowEquipmentStats.Value != value)
{
this.showStats = value;
this.Settings.ShowEquipmentStats.Value = value;
this.RaisePropertyChanged();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
HorizontalAlignment="Right"
VerticalAlignment="Top"
WindowChrome.IsHitTestVisibleInChrome="True">
<CheckBox IsChecked="{Binding ShowAdditionalStats, Mode=TwoWay}"
Content="{Binding Resources.ShipCatalog_AdditionalStats, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Margin="0,0,5,0"
Height="26"
VerticalAlignment="Top"
HorizontalAlignment="Right"/>
<metro:CaptionButton IsChecked="{Binding Settings.TopMost.Value, Mode=TwoWay}"
ToolTip="{Binding Resources.Settings_Window_TopMost, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Style="{DynamicResource PinButtonStyleKey}" />
Expand Down Expand Up @@ -788,9 +794,8 @@
</GridViewColumn.CellTemplate>
</GridViewColumn>

<controls:CollapsibleGridViewColumn Width="64" Visibility="Visible">
<GridViewColumnHeader>
<!-- <GridViewColumnHeader Visibility="{Binding ShowMoreStats, Converter={StaticResource BooleanToVsibilityConverterKey}}"> -->
<controls:CollapsibleGridViewColumn Width="64" Visibility="{Binding ShowAdditionalStats, Converter={StaticResource BooleanToVisibilityConverterKey}}">
<GridViewColumnHeader Visibility="{Binding ShowAdditionalStats, Converter={StaticResource BooleanToVisibilityConverterKey}, Mode=OneWay}">
<metro2:SortButton MethodName="Sort"
MethodParameter="{x:Static viewModels:ShipCatalogSortWorker.EvasionColumn}">
<TextBlock Text="{Binding Resources.ShipCatalog_Column_Evasion, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
Expand All @@ -809,9 +814,8 @@
</controls:CollapsibleGridViewColumn.CellTemplate>
</controls:CollapsibleGridViewColumn>

<controls:CollapsibleGridViewColumn Width="64" Visibility="Visible">
<controls:CollapsibleGridViewColumn Width="64" Visibility="{Binding ShowAdditionalStats, Converter={StaticResource BooleanToVisibilityConverterKey}}">
<GridViewColumnHeader>
<!-- <GridViewColumnHeader Visibility="{Binding ShowMoreStats, Converter={StaticResource BooleanToVsibilityConverterKey}}"> -->
<metro2:SortButton MethodName="Sort"
MethodParameter="{x:Static viewModels:ShipCatalogSortWorker.AntiSubColumn}">
<TextBlock Text="{Binding Resources.ShipCatalog_Column_ASW, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
Orientation="Horizontal"
VerticalAlignment="Top"
WindowChrome.IsHitTestVisibleInChrome="True">
<CheckBox IsChecked="{Binding ShowStats, Mode=TwoWay}"
Content="{Binding Resources.SlotItemCatalog_ShowStats, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Margin="0,0,5,0"
Height="26"
VerticalAlignment="Top"
HorizontalAlignment="Right"/>
<metro:CaptionButton IsChecked="{Binding Settings.TopMost.Value, Mode=TwoWay}"
ToolTip="{Binding Resources.Settings_Window_TopMost, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Style="{DynamicResource PinButtonStyleKey}" />
Expand All @@ -71,25 +77,19 @@
<DockPanel Grid.Row="1">
<Border DockPanel.Dock="Top"
Margin="8,8,8,0">
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<metro2:CallMethodButton Content="{Binding Resources.SlotItemCatalog_Refresh, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Padding="40,6"
MethodName="Update"
HorizontalAlignment="Left"
Margin="0,0,3,0" />
<CheckBox IsChecked="{Binding ShowStats, Mode=TwoWay}"
Content="{Binding Resources.SlotItemCatalog_ShowStats, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Margin="3,0,0,0"
VerticalAlignment="Center" />
</StackPanel>
<metro2:CallMethodButton Content="{Binding Resources.SlotItemCatalog_Refresh, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
Padding="40,6"
MethodName="Update"
HorizontalAlignment="Left"
Margin="0,0,3,0" />
</Border>

<Border BorderBrush="{DynamicResource BorderBrushKey}"
BorderThickness="1"
Margin="8">
<ListView ItemsSource="{Binding SlotItems}"
ItemContainerStyle="{DynamicResource GridViewItemContainerStyleKey}"
ScrollViewer.PanningMode="Both">
ScrollViewer.PanningMode="Both" DataContext="{Binding}">
<ListView.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverterKey" />
<Style TargetType="{x:Type TextBlock}"
Expand Down Expand Up @@ -175,13 +175,15 @@

<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}"
HorizontalAlignment="Center"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type viewModels:SlotItemCounter}">
<TextBlock Text="{Binding Count, Mode=OneWay}"
Margin="0,4"
Foreground="{DynamicResource ActiveForegroundBrushKey}" />
Foreground="{DynamicResource ActiveForegroundBrushKey}"
HorizontalAlignment="Right"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Expand All @@ -192,17 +194,20 @@
<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}"
HorizontalAlignment="Center"/>
</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}"
HorizontalAlignment="Center"/>
</Border>
<Border Width="82"
BorderThickness="0,0,1,0"
BorderBrush="{DynamicResource BorderBrushKey}">
<TextBlock>
<TextBlock HorizontalAlignment="Center"
TextAlignment="Center">
<Run Text="{Binding Resources.SlotItemCatalog_Owned, Source={x:Static models:ResourceService.Current}, Mode=OneWay}" />
<Run Text="{Binding Resources.SlotItemCatalog_Extra, Source={x:Static models:ResourceService.Current}, Mode=OneWay}"
FontSize="11" />
Expand All @@ -216,7 +221,7 @@
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type viewModels:SlotItemCounter}">
<ItemsControl ItemsSource="{Binding Levels}"
Margin="0,0,0,-1">
Margin="-4,0,0,-1">
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataTemplate.Resources>
Expand All @@ -225,8 +230,10 @@
<Border BorderThickness="0,0,0,1"
BorderBrush="{DynamicResource BorderBrushKey}">
<DockPanel>
<TextBlock Width="53"
Margin="0,4">
<TextBlock Width="51"
Margin="0,4,1,0"
HorizontalAlignment="Center"
TextAlignment="Center">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text"
Expand All @@ -252,7 +259,7 @@
</Style>
</TextBlock.Style>
</TextBlock>
<!--<TextBlock Width="53"
<!--<TextBlock Width="52"
Margin="0,4">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
Expand All @@ -279,8 +286,9 @@
</Style>
</TextBlock.Style>
</TextBlock>-->
<Viewbox Width="53" VerticalAlignment="Center">
<kcvc:AircraftProficiencyIcon Height="10" Level="{Binding CounterKey.Adept}"/>
<Viewbox Width="51"
Margin="0,0,1,0">
<kcvc:AircraftProficiencyIcon Height="10" Level="{Binding CounterKey.Adept}" HorizontalAlignment="Center" />
<Viewbox.ToolTip>
<TextBlock>
<TextBlock.Style>
Expand Down Expand Up @@ -311,7 +319,8 @@
</Viewbox.ToolTip>
</Viewbox>
<TextBlock Width="83"
Margin="0,4">
Margin="0,4"
TextAlignment="Center">
<Run Text="{Binding Count, Mode=OneWay}"
Foreground="{DynamicResource ActiveForegroundBrushKey}" />
<Run Text="{Binding Remainder, StringFormat=({0}), Mode=OneWay}"
Expand Down

0 comments on commit 93ecd92

Please sign in to comment.