Skip to content

Commit

Permalink
fix: 截图不存在提示 & 查看版本错误
Browse files Browse the repository at this point in the history
  • Loading branch information
tangge233 committed Sep 21, 2024
1 parent d932678 commit 2aba4a9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,29 @@
mc:Ignorable="d" x:Class="PageVersionScreenshot"
PanScroll="{Binding ElementName=PanBack}" Grid.IsSharedSizeScope="True">
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack">
<WrapPanel Margin="10" Name="PanList">
<!--<local:MyCard Height="220" Width="120" Margin="7" Tag="Path">
<Grid>
<local:MyCard HorizontalAlignment="Center" VerticalAlignment="Center" Margin="40" x:Name="PanNoPic">
<Grid Margin="20,17">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.ColumnSpan="4" Margin="0,0,0,9" HorizontalAlignment="Center" Text="暂时没有截图文件" FontSize="19" UseLayoutRounding="True" SnapsToDevicePixels="True" Foreground="{DynamicResource ColorBrush3}" />
<Rectangle Grid.Row="1" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Height="2" Fill="{DynamicResource ColorBrush3}" />
<TextBlock Grid.Row="2" Grid.ColumnSpan="4" Margin="10,15,10,5" Text="在游戏内按下 F2(截图键)后,可在此处查看保存的截图" TextWrapping="Wrap" />
<local:MyButton Grid.Row="3" Grid.Column="1" Height="35" HorizontalAlignment="Center" Click="BtnOpenFolder_Click" MinWidth="140" Text="打开截图文件夹" Margin="10,10,10,0" Padding="13,0" ColorType="Highlight" />
</Grid>
</local:MyCard>
<WrapPanel Margin="10" Name="PanList">
<!--<local:MyCard Height="220" Width="120" Margin="7" Tag="Path">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="180"/>
Expand All @@ -20,6 +41,7 @@
</StackPanel>
</Grid>
</local:MyCard>-->
</WrapPanel>
</WrapPanel>
</Grid>
</local:MyScrollViewer>
</local:MyPageRight>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Public Class PageVersionScreenshot

'重复加载部分
PanBack.ScrollToHome()

ScreenshotPath = PageVersionLeft.Version.Path + "screenshots"
Reload()

'非重复加载部分
Expand All @@ -17,7 +17,7 @@ Public Class PageVersionScreenshot
End Sub

Dim FileList As List(Of String) = New List(Of String)
Dim ScreenshotPath As String = PageVersionLeft.Version.Path + "screenshots"
Dim ScreenshotPath As String

''' <summary>
''' 确保当前页面上的信息已正确显示。
Expand All @@ -26,6 +26,11 @@ Public Class PageVersionScreenshot
AniControlEnabled += 1
PanBack.ScrollToHome()
LoadFileList()
If FileList.Count.Equals(0) Then
PanNoPic.Visibility = Visibility.Visible
Else
PanNoPic.Visibility = Visibility.Collapsed
End If
AniControlEnabled -= 1
End Sub

Expand Down Expand Up @@ -141,4 +146,9 @@ Public Class PageVersionScreenshot
Hint("截图文件不存在!")
End If
End Sub

Private Sub BtnOpenFolder_Click(sender As Object, e As MouseButtonEventArgs)
If Not Directory.Exists(ScreenshotPath) Then Directory.CreateDirectory(ScreenshotPath)
OpenExplorer("""" & ScreenshotPath & """")
End Sub
End Class

0 comments on commit 2aba4a9

Please sign in to comment.