2022-06-23 11:59:02 -07:00
|
|
|
<UserControl
|
2022-12-29 06:24:05 -08:00
|
|
|
x:Class="Ryujinx.Ava.UI.Controls.GameListView"
|
2022-06-23 11:59:02 -07:00
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2023-01-16 19:57:21 -08:00
|
|
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
2022-06-23 11:59:02 -07:00
|
|
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
|
|
d:DesignHeight="450"
|
|
|
|
d:DesignWidth="800"
|
2023-01-16 19:57:21 -08:00
|
|
|
Focusable="True"
|
|
|
|
mc:Ignorable="d">
|
2022-05-15 04:30:15 -07:00
|
|
|
<UserControl.Resources>
|
2022-12-29 06:24:05 -08:00
|
|
|
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
2023-01-20 17:57:37 -08:00
|
|
|
<MenuFlyout x:Key="GameContextMenu">
|
2022-05-15 04:30:15 -07:00
|
|
|
<MenuItem
|
|
|
|
Command="{Binding ToggleFavorite}"
|
|
|
|
Header="{locale:Locale GameListContextMenuToggleFavorite}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuToggleFavoriteToolTip}" />
|
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenUserSaveDirectory}"
|
2023-01-20 17:57:37 -08:00
|
|
|
IsEnabled="{Binding EnabledUserSaveDirectory}"
|
2022-05-15 04:30:15 -07:00
|
|
|
Header="{locale:Locale GameListContextMenuOpenUserSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenDeviceSaveDirectory}"
|
2023-01-20 17:57:37 -08:00
|
|
|
IsEnabled="{Binding EnabledDeviceSaveDirectory}"
|
2023-01-10 10:15:15 -08:00
|
|
|
Header="{locale:Locale GameListContextMenuOpenDeviceSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenDeviceSaveDirectoryToolTip}" />
|
2022-05-15 04:30:15 -07:00
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenBcatSaveDirectory}"
|
2023-01-20 17:57:37 -08:00
|
|
|
IsEnabled="{Binding EnabledBcatSaveDirectory}"
|
2023-01-10 10:15:15 -08:00
|
|
|
Header="{locale:Locale GameListContextMenuOpenBcatSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenBcatSaveDirectoryToolTip}" />
|
2022-05-15 04:30:15 -07:00
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenTitleUpdateManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageTitleUpdates}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageTitleUpdatesToolTip}" />
|
|
|
|
<MenuItem
|
2022-07-28 15:41:34 -07:00
|
|
|
Command="{Binding OpenDownloadableContentManager}"
|
2022-05-15 04:30:15 -07:00
|
|
|
Header="{locale:Locale GameListContextMenuManageDlc}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageDlcToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenCheatManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageCheat}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageCheatToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenSdModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
|
|
|
|
<Separator />
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding PurgePtcCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgePptc}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgePptcToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding PurgeShaderCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenPtcDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding OpenShaderCacheDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" />
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuExtractData}">
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding ExtractExeFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataExeFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataExeFSToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding ExtractRomFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataRomFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataRomFSToolTip}" />
|
|
|
|
<MenuItem
|
|
|
|
Command="{Binding ExtractLogo}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataLogo}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataLogoToolTip}" />
|
|
|
|
</MenuItem>
|
|
|
|
</MenuFlyout>
|
|
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
</Grid.RowDefinitions>
|
2022-06-23 11:59:02 -07:00
|
|
|
<ListBox
|
|
|
|
Name="GameListBox"
|
|
|
|
Grid.Row="0"
|
|
|
|
Padding="8"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
ContextFlyout="{StaticResource GameContextMenu}"
|
|
|
|
DoubleTapped="GameList_DoubleTapped"
|
|
|
|
Items="{Binding AppsObservableList}"
|
|
|
|
SelectionChanged="GameList_SelectionChanged">
|
2022-05-15 04:30:15 -07:00
|
|
|
<ListBox.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
2022-06-23 11:59:02 -07:00
|
|
|
<StackPanel
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
Orientation="Vertical"
|
|
|
|
Spacing="2" />
|
2022-05-15 04:30:15 -07:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ListBox.ItemsPanel>
|
|
|
|
<ListBox.Styles>
|
2023-01-08 18:36:11 -08:00
|
|
|
<Style Selector="ListBoxItem:selected /template/ Border#SelectionIndicator">
|
|
|
|
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].DataContext.ListItemSelectorSize}" />
|
|
|
|
</Style>
|
2022-05-15 04:30:15 -07:00
|
|
|
</ListBox.Styles>
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Grid>
|
2022-06-23 11:59:02 -07:00
|
|
|
<Border
|
|
|
|
Margin="0"
|
|
|
|
Padding="10"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
ClipToBounds="True"
|
|
|
|
CornerRadius="5">
|
|
|
|
<Grid>
|
2022-05-15 04:30:15 -07:00
|
|
|
<Grid.ColumnDefinitions>
|
2022-06-23 11:59:02 -07:00
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
<ColumnDefinition Width="10" />
|
|
|
|
<ColumnDefinition Width="*" />
|
2023-01-16 19:57:21 -08:00
|
|
|
<ColumnDefinition Width="150" />
|
|
|
|
<ColumnDefinition Width="100" />
|
2022-05-15 04:30:15 -07:00
|
|
|
</Grid.ColumnDefinitions>
|
2022-06-23 11:59:02 -07:00
|
|
|
<Image
|
|
|
|
Grid.RowSpan="3"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="0"
|
2022-05-15 04:30:15 -07:00
|
|
|
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
|
2022-06-23 11:59:02 -07:00
|
|
|
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
|
|
|
|
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
|
|
|
|
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
|
|
|
|
Source="{Binding Icon, Converter={StaticResource ByteImage}}" />
|
2023-01-16 19:57:21 -08:00
|
|
|
<Border
|
2022-06-23 11:59:02 -07:00
|
|
|
Grid.Column="2"
|
2023-01-16 19:57:21 -08:00
|
|
|
Margin="0,0,5,0"
|
|
|
|
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
|
|
|
BorderThickness="0,0,1,0">
|
|
|
|
<StackPanel
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Orientation="Vertical"
|
|
|
|
Spacing="5">
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
FontWeight="Bold"
|
|
|
|
Text="{Binding TitleName}"
|
|
|
|
TextAlignment="Left"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding Developer}"
|
|
|
|
TextAlignment="Left"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding Version}"
|
|
|
|
TextAlignment="Left"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
<StackPanel
|
|
|
|
Grid.Column="3"
|
|
|
|
Margin="10,0,0,0"
|
2022-06-23 11:59:02 -07:00
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Orientation="Vertical"
|
2023-01-16 19:57:21 -08:00
|
|
|
Spacing="5">
|
2022-06-23 11:59:02 -07:00
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
2023-01-16 19:57:21 -08:00
|
|
|
Text="{Binding TitleId}"
|
2022-06-23 11:59:02 -07:00
|
|
|
TextAlignment="Left"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
2023-01-16 19:57:21 -08:00
|
|
|
Text="{Binding FileExtension}"
|
2022-06-23 11:59:02 -07:00
|
|
|
TextAlignment="Left"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
2023-01-16 19:57:21 -08:00
|
|
|
Grid.Column="4"
|
2022-06-23 11:59:02 -07:00
|
|
|
HorizontalAlignment="Right"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Orientation="Vertical"
|
|
|
|
Spacing="5">
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding TimePlayed}"
|
|
|
|
TextAlignment="Right"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding LastPlayed}"
|
|
|
|
TextAlignment="Right"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding FileSize}"
|
|
|
|
TextAlignment="Right"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
</StackPanel>
|
|
|
|
<ui:SymbolIcon
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="0"
|
|
|
|
Margin="-5,-5,0,0"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Top"
|
2022-12-05 14:04:18 -08:00
|
|
|
FontSize="16"
|
|
|
|
Foreground="{DynamicResource SystemAccentColor}"
|
2022-06-23 11:59:02 -07:00
|
|
|
IsVisible="{Binding Favorite}"
|
|
|
|
Symbol="StarFilled" />
|
2022-05-15 04:30:15 -07:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|