2022-06-23 11:59:02 -07:00
|
|
|
<UserControl
|
2022-12-29 06:24:05 -08:00
|
|
|
x:Class="Ryujinx.Ava.UI.Controls.GameGridView"
|
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"
|
|
|
|
xmlns:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox"
|
|
|
|
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"
|
2022-12-29 06:24:05 -08:00
|
|
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
2022-06-23 11:59:02 -07:00
|
|
|
d:DesignHeight="450"
|
|
|
|
d:DesignWidth="800"
|
2022-12-05 14:04:18 -08:00
|
|
|
mc:Ignorable="d"
|
|
|
|
Focusable="True">
|
2022-06-23 11:59:02 -07:00
|
|
|
<UserControl.Resources>
|
2022-12-29 06:24:05 -08:00
|
|
|
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened">
|
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding ToggleFavorite}"
|
|
|
|
Header="{locale:Locale GameListContextMenuToggleFavorite}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuToggleFavoriteToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenUserSaveDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenUserSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenDeviceSaveDirectory}"
|
2023-01-10 10:15:15 -08:00
|
|
|
Header="{locale:Locale GameListContextMenuOpenDeviceSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenDeviceSaveDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenBcatSaveDirectory}"
|
2023-01-10 10:15:15 -08:00
|
|
|
Header="{locale:Locale GameListContextMenuOpenBcatSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenBcatSaveDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenTitleUpdateManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageTitleUpdates}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageTitleUpdatesToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<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}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenCheatManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageCheat}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageCheatToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenSdModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<Separator />
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
|
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding PurgePtcCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgePptc}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgePptcToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding PurgeShaderCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenPtcDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding OpenShaderCacheDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuExtractData}">
|
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding ExtractExeFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataExeFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataExeFSToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding ExtractRomFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataRomFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataRomFSToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
<MenuItem
|
2022-05-15 04:30:15 -07:00
|
|
|
Command="{Binding ExtractLogo}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataLogo}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataLogoToolTip}" />
|
2022-06-23 11:59:02 -07:00
|
|
|
</MenuItem>
|
|
|
|
</MenuFlyout>
|
|
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<ListBox
|
|
|
|
Grid.Row="0"
|
|
|
|
Padding="8"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
ContextFlyout="{StaticResource GameContextMenu}"
|
|
|
|
DoubleTapped="GameList_DoubleTapped"
|
|
|
|
Items="{Binding AppsObservableList}"
|
|
|
|
SelectionChanged="GameList_SelectionChanged">
|
|
|
|
<ListBox.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<flex:FlexPanel
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
AlignContent="FlexStart"
|
|
|
|
JustifyContent="Center" />
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ListBox.ItemsPanel>
|
|
|
|
<ListBox.Styles>
|
|
|
|
<Style Selector="ListBoxItem">
|
|
|
|
<Setter Property="Margin" Value="5" />
|
2022-12-05 14:04:18 -08:00
|
|
|
<Setter Property="CornerRadius" Value="4" />
|
|
|
|
</Style>
|
2023-01-08 18:36:11 -08:00
|
|
|
<Style Selector="ListBoxItem:selected /template/ Border#SelectionIndicator">
|
|
|
|
<Setter Property="MinHeight" Value="{Binding $parent[UserControl].DataContext.GridItemSelectorSize}" />
|
|
|
|
</Style>
|
2022-06-23 11:59:02 -07:00
|
|
|
</ListBox.Styles>
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Grid>
|
|
|
|
<Border
|
2022-12-05 14:04:18 -08:00
|
|
|
Margin="10"
|
2022-06-23 11:59:02 -07:00
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
|
|
|
|
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
|
2022-05-15 04:30:15 -07:00
|
|
|
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
|
2022-06-23 11:59:02 -07:00
|
|
|
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
|
|
|
|
ClipToBounds="True"
|
2022-12-05 14:04:18 -08:00
|
|
|
CornerRadius="4">
|
|
|
|
<Grid>
|
2022-06-23 11:59:02 -07:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<Image
|
|
|
|
Grid.Row="0"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Source="{Binding Icon, Converter={StaticResource ByteImage}}" />
|
2022-12-05 14:04:18 -08:00
|
|
|
<Panel
|
2022-06-23 11:59:02 -07:00
|
|
|
Grid.Row="1"
|
|
|
|
Height="50"
|
2022-12-05 14:04:18 -08:00
|
|
|
Margin="0 10 0 0"
|
2022-06-23 11:59:02 -07:00
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
IsVisible="{Binding $parent[UserControl].DataContext.ShowNames}">
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
2022-12-05 14:04:18 -08:00
|
|
|
VerticalAlignment="Center"
|
2022-06-23 11:59:02 -07:00
|
|
|
Text="{Binding TitleName}"
|
|
|
|
TextAlignment="Center"
|
|
|
|
TextWrapping="Wrap" />
|
2022-12-05 14:04:18 -08:00
|
|
|
</Panel>
|
2022-06-23 11:59:02 -07:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
<ui:SymbolIcon
|
2022-12-05 14:04:18 -08:00
|
|
|
Margin="5,5,0,0"
|
2022-06-23 11:59:02 -07:00
|
|
|
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" />
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</Grid>
|
2022-05-15 04:30:15 -07:00
|
|
|
</UserControl>
|