2022-06-23 20:59:02 +02:00
|
|
|
<UserControl
|
|
|
|
x:Class="Ryujinx.Ava.Ui.Controls.GameGridView"
|
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
|
|
|
|
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"
|
|
|
|
d:DesignHeight="450"
|
|
|
|
d:DesignWidth="800"
|
|
|
|
mc:Ignorable="d">
|
|
|
|
<UserControl.Resources>
|
|
|
|
<controls:BitmapArrayValueConverter x:Key="ByteImage" />
|
|
|
|
<MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened">
|
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding ToggleFavorite}"
|
|
|
|
Header="{locale:Locale GameListContextMenuToggleFavorite}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuToggleFavoriteToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenUserSaveDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenUserSaveDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenDeviceSaveDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenUserDeviceDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserDeviceDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenBcatSaveDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenUserBcatDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserBcatDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<Separator />
|
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenTitleUpdateManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageTitleUpdates}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageTitleUpdatesToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenDlcManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageDlc}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageDlcToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenCheatManager}"
|
|
|
|
Header="{locale:Locale GameListContextMenuManageCheat}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageCheatToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenSdModsDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<Separator />
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
|
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding PurgePtcCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgePptc}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgePptcToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding PurgeShaderCache}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCache}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenPtcDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding OpenShaderCacheDirectory}"
|
|
|
|
Header="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="{locale:Locale GameListContextMenuExtractData}">
|
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding ExtractExeFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataExeFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataExeFSToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding ExtractRomFs}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataRomFS}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataRomFSToolTip}" />
|
2022-06-23 20:59:02 +02:00
|
|
|
<MenuItem
|
2022-05-15 13:30:15 +02:00
|
|
|
Command="{Binding ExtractLogo}"
|
|
|
|
Header="{locale:Locale GameListContextMenuExtractDataLogo}"
|
|
|
|
ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataLogoToolTip}" />
|
2022-06-23 20:59:02 +02: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="Padding" Value="0" />
|
|
|
|
<Setter Property="Margin" Value="5" />
|
|
|
|
<Setter Property="CornerRadius" Value="5" />
|
|
|
|
<Setter Property="Background" Value="{DynamicResource SystemAccentColorDark3}" />
|
|
|
|
<Style.Animations>
|
|
|
|
<Animation Duration="0:0:0.7">
|
|
|
|
<KeyFrame Cue="0%">
|
|
|
|
<Setter Property="MaxWidth" Value="0" />
|
|
|
|
<Setter Property="Opacity" Value="0.0" />
|
|
|
|
</KeyFrame>
|
|
|
|
<KeyFrame Cue="50%">
|
|
|
|
<Setter Property="MaxWidth" Value="1000" />
|
|
|
|
<Setter Property="Opacity" Value="0.3" />
|
|
|
|
</KeyFrame>
|
|
|
|
<KeyFrame Cue="100%">
|
|
|
|
<Setter Property="MaxWidth" Value="1000" />
|
|
|
|
<Setter Property="Opacity" Value="1.0" />
|
|
|
|
</KeyFrame>
|
|
|
|
</Animation>
|
|
|
|
</Style.Animations>
|
|
|
|
</Style>
|
|
|
|
</ListBox.Styles>
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Grid>
|
|
|
|
<Grid.Styles>
|
|
|
|
<Style Selector="ui|SymbolIcon.small.icon">
|
|
|
|
<Setter Property="FontSize" Value="15" />
|
|
|
|
</Style>
|
|
|
|
<Style Selector="ui|SymbolIcon.normal.icon">
|
|
|
|
<Setter Property="FontSize" Value="19" />
|
|
|
|
</Style>
|
|
|
|
<Style Selector="ui|SymbolIcon.large.icon">
|
|
|
|
<Setter Property="FontSize" Value="23" />
|
|
|
|
</Style>
|
|
|
|
<Style Selector="ui|SymbolIcon.huge.icon">
|
|
|
|
<Setter Property="FontSize" Value="26" />
|
|
|
|
</Style>
|
|
|
|
</Grid.Styles>
|
|
|
|
<Border
|
|
|
|
Margin="0"
|
|
|
|
Padding="{Binding $parent[UserControl].DataContext.GridItemPadding}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
|
|
|
|
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
|
2022-05-15 13:30:15 +02:00
|
|
|
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
|
2022-06-23 20:59:02 +02:00
|
|
|
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
|
|
|
|
ClipToBounds="True"
|
|
|
|
CornerRadius="5">
|
|
|
|
<Grid Margin="0">
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<Image
|
|
|
|
Grid.Row="0"
|
|
|
|
Margin="0"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Source="{Binding Icon, Converter={StaticResource ByteImage}}" />
|
|
|
|
<StackPanel
|
|
|
|
Grid.Row="1"
|
|
|
|
Height="50"
|
|
|
|
Margin="5"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
IsVisible="{Binding $parent[UserControl].DataContext.ShowNames}">
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Text="{Binding TitleName}"
|
|
|
|
TextAlignment="Center"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
<ui:SymbolIcon
|
|
|
|
Margin="5"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
|
|
|
|
Classes.icon="true"
|
2022-05-15 13:30:15 +02:00
|
|
|
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
|
2022-06-23 20:59:02 +02:00
|
|
|
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
|
|
|
|
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
|
|
|
|
Foreground="Yellow"
|
|
|
|
IsVisible="{Binding Favorite}"
|
|
|
|
Symbol="StarFilled" />
|
|
|
|
<ui:SymbolIcon
|
|
|
|
Margin="5"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Top"
|
2022-05-15 13:30:15 +02:00
|
|
|
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
|
2022-06-23 20:59:02 +02:00
|
|
|
Classes.icon="true"
|
|
|
|
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
|
|
|
|
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
|
|
|
|
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
|
|
|
|
Foreground="Black"
|
|
|
|
IsVisible="{Binding Favorite}"
|
|
|
|
Symbol="Star" />
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListBox.ItemTemplate>
|
|
|
|
</ListBox>
|
|
|
|
</Grid>
|
2022-05-15 13:30:15 +02:00
|
|
|
</UserControl>
|