Skip to content

Commit

Permalink
Fixed: HLTB rows showing even if they have no data after its latest u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
darklinkpower committed Sep 21, 2024
1 parent 0d7edcf commit 08725e6
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 99 deletions.
52 changes: 6 additions & 46 deletions source/Views/DetailsViewGameOverview.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,9 @@
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type StackPanel}}, Path=ActualWidth}"/>
<ContentControl x:Name="HowLongToBeat_PluginButton" HorizontalAlignment="Right" Margin="0,0,0,10"
Visibility="{PluginSettings Plugin=HowLongToBeat, Path=EnableIntegrationButton, FallbackValue=Collapsed, Converter={StaticResource BooleanToVisibilityConverter}}" />

<GridEx Name="HltbDataGrid" ColumnCount="2" AutoLayoutColumns="2" RowCount="6" Tag="{DynamicResource DetailsViewShowHltbDataGrid}">
<GridEx.Style>
<ContentControl ContentTemplate="{DynamicResource HltbDataGridTemplate}"
Tag="{DynamicResource DetailsViewShowHltbDataGrid}">
<ContentControl.Style>
<Style>
<Setter Property="Control.Visibility" Value="Collapsed" />
<Style.Triggers>
Expand All @@ -1001,49 +1001,9 @@
</MultiDataTrigger>
</Style.Triggers>
</Style>
</GridEx.Style>
<Label Content="{DynamicResource LOCHowLongToBeatMainStory}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainStoryFormat, Path=Visibility}" />
<TextBlock Name="MainStoryFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainStoryFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatMainExtra}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainExtraFormat, Path=Visibility}" />
<TextBlock Name="MainExtraFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainExtraFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCompletionist}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CompletionistFormat, Path=Visibility}" />
<TextBlock Name="CompletionistFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CompletionistFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatSolo}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=SoloFormat, Path=Visibility}" />
<TextBlock Name="SoloFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=SoloFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCoOp}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CoOpFormat, Path=Visibility}" />
<TextBlock Name="CoOpFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CoOpFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatVs}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=VsFormat, Path=Visibility}" />
<TextBlock Name="VsFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=VsFormat, FallbackValue=--}"/>
</GridEx>
</ContentControl.Style>
</ContentControl>

</StackPanel>
</Border>
</Grid>
Expand Down
55 changes: 7 additions & 48 deletions source/Views/GridViewGameOverview.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,11 @@
<ContentControl DockPanel.Dock="Left" x:Name="HowLongToBeat_PluginButton" VerticalAlignment="Top"/>
<ContentControl x:Name="HowLongToBeat_PluginProgressBar" Margin="5,5,0,0" VerticalAlignment="Center"/>
</DockPanel>
<GridEx Name="HltbDataGrid" ColumnCount="2"
Margin="0,15,0,0"
AutoLayoutColumns="2" RowCount="6"
Tag="{DynamicResource GridViewShowHltbDataGrid}">
<GridEx.Style>

<ContentControl ContentTemplate="{DynamicResource HltbDataGridTemplate}"
Margin="0,15,0,0"
Tag="{DynamicResource GridViewShowHltbDataGrid}">
<ContentControl.Style>
<Style>
<Setter Property="Control.Visibility" Value="Collapsed" />
<Style.Triggers>
Expand All @@ -627,49 +627,8 @@
</MultiDataTrigger>
</Style.Triggers>
</Style>
</GridEx.Style>
<Label Content="{DynamicResource LOCHowLongToBeatMainStory}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainStoryFormat, Path=Visibility}" />
<TextBlock Name="MainStoryFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainStoryFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatMainExtra}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainExtraFormat, Path=Visibility}" />
<TextBlock Name="MainExtraFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainExtraFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCompletionist}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CompletionistFormat, Path=Visibility}" />
<TextBlock Name="CompletionistFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CompletionistFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatSolo}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=SoloFormat, Path=Visibility}" />
<TextBlock Name="SoloFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=SoloFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCoOp}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CoOpFormat, Path=Visibility}" />
<TextBlock Name="CoOpFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CoOpFormat, FallbackValue=--}"/>

<Label Content="{DynamicResource LOCHowLongToBeatVs}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=VsFormat, Path=Visibility}" />
<TextBlock Name="VsFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=VsFormat, FallbackValue=--}"/>
</GridEx>
</ContentControl.Style>
</ContentControl>
</StackPanel>
</Expander>
<!--#endregion -->
Expand Down
67 changes: 62 additions & 5 deletions source/Views/LibraryDetailsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,67 @@
</DataTrigger>
</Style.Triggers>
</Style>

<DataTemplate x:Key="HltbDataGridTemplate">
<DataTemplate.Resources>
<Style TargetType="Label" x:Key="HltbGridLabelStyle">
<Setter Property="FontSize" Value="{DynamicResource FontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource TextBrushDarker}"/>
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style TargetType="TextBlock" x:Key="HltbGridTextStyle" BasedOn="{StaticResource BaseTextBlockStyle}">
<Setter Property="Margin" Value="20,5,0,5" />
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Value="--">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataTemplate.Resources>
<GridEx Name="HltbDataGrid" ColumnCount="2" AutoLayoutColumns="2" RowCount="6" Tag="{DynamicResource DetailsViewShowHltbDataGrid}">
<Label Content="{DynamicResource LOCHowLongToBeatMainStory}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainStoryFormat, Path=Visibility}" />
<TextBlock Name="MainStoryFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainStoryFormat, FallbackValue='--'}"/>

<Style TargetType="Label" x:Key="HltbGridLabelStyle">
<Setter Property="FontSize" Value="{DynamicResource FontSize}"/>
<Setter Property="Foreground" Value="{DynamicResource TextBrushDarker}"/>
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Label Content="{DynamicResource LOCHowLongToBeatMainExtra}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=MainExtraFormat, Path=Visibility}" />

<TextBlock Name="MainExtraFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=MainExtraFormat, FallbackValue='--'}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCompletionist}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CompletionistFormat, Path=Visibility}" />
<TextBlock Name="CompletionistFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CompletionistFormat, FallbackValue='--'}"/>

<Label Content="{DynamicResource LOCHowLongToBeatSolo}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=SoloFormat, Path=Visibility}" />
<TextBlock Name="SoloFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=SoloFormat, FallbackValue='--'}"/>

<Label Content="{DynamicResource LOCHowLongToBeatCoOp}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=CoOpFormat, Path=Visibility}" />
<TextBlock Name="CoOpFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=CoOpFormat, FallbackValue='--'}"/>

<Label Content="{DynamicResource LOCHowLongToBeatVs}"
Style="{DynamicResource HltbGridLabelStyle}"
Visibility="{Binding ElementName=VsFormat, Path=Visibility}" />
<TextBlock Name="VsFormat"
Style="{DynamicResource HltbGridTextStyle}"
Text="{PluginSettings Plugin=HowLongToBeat, Path=VsFormat, FallbackValue='--'}"/>
</GridEx>
</DataTemplate>
</ResourceDictionary>

0 comments on commit 08725e6

Please sign in to comment.