mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-02-23 21:54:37 +01:00
UI: Show what each value is in the Game Info dialog, add game icon
This commit is contained in:
parent
1972a47f39
commit
bd08a111a8
@ -2578,7 +2578,7 @@
|
|||||||
"ar_SA": "",
|
"ar_SA": "",
|
||||||
"de_DE": "",
|
"de_DE": "",
|
||||||
"el_GR": "",
|
"el_GR": "",
|
||||||
"en_US": "Show Game Stats",
|
"en_US": "Show Game Info",
|
||||||
"es_ES": "",
|
"es_ES": "",
|
||||||
"fr_FR": "",
|
"fr_FR": "",
|
||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
@ -2603,7 +2603,7 @@
|
|||||||
"ar_SA": "",
|
"ar_SA": "",
|
||||||
"de_DE": "",
|
"de_DE": "",
|
||||||
"el_GR": "",
|
"el_GR": "",
|
||||||
"en_US": "Show the other various information about the currently selected game that is missing from the Grid view layout.",
|
"en_US": "Show stats & details about the currently selected game.",
|
||||||
"es_ES": "",
|
"es_ES": "",
|
||||||
"fr_FR": "",
|
"fr_FR": "",
|
||||||
"he_IL": "",
|
"he_IL": "",
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
Icon="{ext:Icon mdi-gamepad}"
|
Icon="{ext:Icon mdi-gamepad}"
|
||||||
ToolTip.Tip="{ext:Locale GameListContextMenuShowCompatEntryToolTip}"/>
|
ToolTip.Tip="{ext:Locale GameListContextMenuShowCompatEntryToolTip}"/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
IsVisible="{Binding IsGrid}"
|
|
||||||
Click="OpenApplicationData_Click"
|
Click="OpenApplicationData_Click"
|
||||||
Header="{ext:Locale GameListContextMenuShowGameData}"
|
Header="{ext:Locale GameListContextMenuShowGameData}"
|
||||||
Icon="{ext:Icon mdi-chart-line}"
|
Icon="{ext:Icon mdi-chart-line}"
|
||||||
|
@ -2,12 +2,18 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
||||||
xmlns:appLibrary="using:Ryujinx.Ava.Utilities.AppLibrary"
|
xmlns:appLibrary="using:Ryujinx.Ava.Utilities.AppLibrary"
|
||||||
|
xmlns:viewModels="using:Ryujinx.Ava.UI.ViewModels"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="Ryujinx.Ava.UI.Controls.ApplicationDataView"
|
x:Class="Ryujinx.Ava.UI.Controls.ApplicationDataView"
|
||||||
x:DataType="appLibrary:ApplicationData">
|
x:DataType="viewModels:ApplicationDataViewModel">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Margin="0"
|
||||||
|
MaxWidth="256"
|
||||||
|
MinWidth="256"
|
||||||
|
Source="{Binding AppData.Icon, Converter={x:Static helpers:BitmapArrayValueConverter.Instance}}" />
|
||||||
|
<Border Margin="5, 0" Width="2" Height="256" BorderBrush="Gray" Background="Gray" />
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<Grid
|
<Grid
|
||||||
RowDefinitions="Auto, Auto, Auto, Auto"
|
RowDefinitions="Auto, Auto, Auto, Auto"
|
||||||
@ -16,15 +22,15 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Padding="0, -2, 0, 5"
|
Padding="0, -2, 0, 5"
|
||||||
Classes="h1"
|
Classes="h1"
|
||||||
Text="{Binding Name}" />
|
Text="{Binding AppData.Name}" />
|
||||||
<TextBlock Grid.Row="1"
|
<TextBlock Grid.Row="1"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding Version}"
|
Text="{Binding FormattedVersion}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock Grid.Row="2"
|
<TextBlock Grid.Row="2"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding Developer}"
|
Text="{Binding FormattedDeveloper}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<StackPanel Grid.ColumnSpan="2" Grid.Row="3"
|
<StackPanel Grid.ColumnSpan="2" Grid.Row="3"
|
||||||
@ -35,14 +41,14 @@
|
|||||||
Click="PlayabilityStatus_OnClick"
|
Click="PlayabilityStatus_OnClick"
|
||||||
HorizontalContentAlignment="Left"
|
HorizontalContentAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
IsVisible="{Binding HasPlayabilityInfo}"
|
IsVisible="{Binding AppData.HasPlayabilityInfo}"
|
||||||
Background="{DynamicResource AppListBackgroundColor}"
|
Background="{DynamicResource AppListBackgroundColor}"
|
||||||
Padding="0">
|
Padding="0">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="1.5"
|
Margin="1.5"
|
||||||
Tag="{Binding IdString}"
|
Tag="{Binding AppData.IdString}"
|
||||||
Text="{Binding LocalizedStatus}"
|
Text="{Binding AppData.LocalizedStatus}"
|
||||||
Foreground="{Binding PlayabilityStatus, Converter={x:Static helpers:PlayabilityStatusConverter.Shared}}"
|
Foreground="{Binding AppData.PlayabilityStatus, Converter={x:Static helpers:PlayabilityStatusConverter.Shared}}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<Button.Styles>
|
<Button.Styles>
|
||||||
@ -62,13 +68,13 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="1.5"
|
Margin="1.5"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding IdString}"
|
Text="{Binding AppData.IdString}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Separator Margin="0, 10, 0, 10" />
|
<Separator Margin="0, 10, 0, 10" Height="2" BorderBrush="Gray" Background="Gray" />
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||||
<StackPanel Grid.Column="0"
|
<StackPanel Grid.Column="0"
|
||||||
Margin="10,0,0,0"
|
Margin="10,0,0,0"
|
||||||
@ -78,12 +84,13 @@
|
|||||||
Spacing="5">
|
Spacing="5">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding FileExtension}"
|
Text="{Binding FormattedFileExtension}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding Converter={helpers:MultiplayerInfoConverter}}"
|
IsVisible="{Binding AppData.HasLdnGames}"
|
||||||
|
Text="{Binding FormattedLdnInfo}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@ -96,21 +103,22 @@
|
|||||||
Spacing="5">
|
Spacing="5">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding LastPlayedString}"
|
Text="{Binding FormattedLastPlayed}"
|
||||||
TextAlignment="End"
|
TextAlignment="End"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding TimePlayedString}"
|
Text="{Binding FormattedPlayTime}"
|
||||||
IsVisible="{Binding HasPlayedPreviously}"
|
IsVisible="{Binding AppData.HasPlayedPreviously}"
|
||||||
TextAlignment="End"
|
TextAlignment="End"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding FileSizeString}"
|
Text="{Binding FormattedFileSize}"
|
||||||
TextAlignment="End"
|
TextAlignment="End"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@ -26,7 +26,8 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
PrimaryButtonText = string.Empty,
|
PrimaryButtonText = string.Empty,
|
||||||
SecondaryButtonText = string.Empty,
|
SecondaryButtonText = string.Empty,
|
||||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
|
||||||
Content = new ApplicationDataView { DataContext = appData }
|
MinWidth = 256,
|
||||||
|
Content = new ApplicationDataView { DataContext = new ApplicationDataViewModel(appData) }
|
||||||
};
|
};
|
||||||
|
|
||||||
Style closeButton = new(x => x.Name("CloseButton"));
|
Style closeButton = new(x => x.Name("CloseButton"));
|
||||||
|
@ -140,6 +140,7 @@
|
|||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
IsVisible="{Binding HasLdnGames}"
|
||||||
Text="{Binding Converter={helpers:MultiplayerInfoConverter}}"
|
Text="{Binding Converter={helpers:MultiplayerInfoConverter}}"
|
||||||
TextAlignment="Start"
|
TextAlignment="Start"
|
||||||
TextWrapping="Wrap"/>
|
TextWrapping="Wrap"/>
|
||||||
|
@ -12,13 +12,10 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value is ApplicationData applicationData)
|
if (value is ApplicationData { HasLdnGames: true } applicationData)
|
||||||
{
|
|
||||||
if (applicationData.PlayerCount != 0 && applicationData.GameCount != 0)
|
|
||||||
{
|
{
|
||||||
return $"Hosted Games: {applicationData.GameCount}\nOnline Players: {applicationData.PlayerCount}";
|
return $"Hosted Games: {applicationData.GameCount}\nOnline Players: {applicationData.PlayerCount}";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
34
src/Ryujinx/UI/ViewModels/ApplicationDataViewModel.cs
Normal file
34
src/Ryujinx/UI/ViewModels/ApplicationDataViewModel.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using Gommon;
|
||||||
|
using Ryujinx.Ava.Utilities.AppLibrary;
|
||||||
|
|
||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class ApplicationDataViewModel : BaseModel
|
||||||
|
{
|
||||||
|
private const string FormatVersion = "Current Version: {0}";
|
||||||
|
private const string FormatDeveloper = "Developed by {0}";
|
||||||
|
|
||||||
|
private const string FormatExtension = "Game type: {0}";
|
||||||
|
private const string FormatLastPlayed = "Last played: {0}";
|
||||||
|
private const string FormatPlayTime = "Play time: {0}";
|
||||||
|
private const string FormatSize = "Size: {0}";
|
||||||
|
|
||||||
|
private const string FormatHostedGames = "Hosted Games: {0}";
|
||||||
|
private const string FormatPlayerCount = "Online Players: {0}";
|
||||||
|
|
||||||
|
public ApplicationData AppData { get; }
|
||||||
|
|
||||||
|
public ApplicationDataViewModel(ApplicationData appData) => AppData = appData;
|
||||||
|
|
||||||
|
public string FormattedVersion => FormatVersion.Format(AppData.Version);
|
||||||
|
public string FormattedDeveloper => FormatDeveloper.Format(AppData.Developer);
|
||||||
|
|
||||||
|
public string FormattedFileExtension => FormatExtension.Format(AppData.FileExtension);
|
||||||
|
public string FormattedLastPlayed => FormatLastPlayed.Format(AppData.LastPlayedString);
|
||||||
|
public string FormattedPlayTime => FormatPlayTime.Format(AppData.TimePlayedString);
|
||||||
|
public string FormattedFileSize => FormatSize.Format(AppData.FileSizeString);
|
||||||
|
|
||||||
|
public string FormattedLdnInfo =>
|
||||||
|
$"{FormatHostedGames.Format(AppData.GameCount)}\n{FormatPlayerCount.Format(AppData.PlayerCount)}";
|
||||||
|
}
|
||||||
|
}
|
@ -49,6 +49,9 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
|
|
||||||
public int PlayerCount { get; set; }
|
public int PlayerCount { get; set; }
|
||||||
public int GameCount { get; set; }
|
public int GameCount { get; set; }
|
||||||
|
|
||||||
|
public bool HasLdnGames => PlayerCount != 0 && GameCount != 0;
|
||||||
|
|
||||||
public TimeSpan TimePlayed { get; set; }
|
public TimeSpan TimePlayed { get; set; }
|
||||||
public DateTime? LastPlayed { get; set; }
|
public DateTime? LastPlayed { get; set; }
|
||||||
public string FileExtension { get; set; }
|
public string FileExtension { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user