Compare commits
3 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc95e80ee9 | ||
|
|
d75ce52bd4 | ||
|
|
4a4ea557de |
@@ -42,7 +42,7 @@
|
|||||||
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
|
||||||
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
|
||||||
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
|
||||||
<PackageVersion Include="Gommon" Version="2.7.0.1" />
|
<PackageVersion Include="Gommon" Version="2.7.0.2" />
|
||||||
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
|
||||||
<PackageVersion Include="Sep" Version="0.6.0" />
|
<PackageVersion Include="Sep" Version="0.6.0" />
|
||||||
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
<PackageVersion Include="shaderc.net" Version="0.1.0" />
|
||||||
|
|||||||
@@ -22597,6 +22597,31 @@
|
|||||||
"zh_TW": ""
|
"zh_TW": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "CompatibilityListLastUpdated",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "Last updated: {0}",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "CompatibilityListWarning",
|
"ID": "CompatibilityListWarning",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
|||||||
@@ -133,12 +133,13 @@
|
|||||||
Spacing="5">
|
Spacing="5">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding TimePlayedString}"
|
Text="{Binding LastPlayedString}"
|
||||||
TextAlignment="End"
|
TextAlignment="End"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{Binding LastPlayedString}"
|
Text="{Binding TimePlayedString}"
|
||||||
|
IsVisible="{Binding HasPlayedPreviously}"
|
||||||
TextAlignment="End"
|
TextAlignment="End"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Input;
|
||||||
using FluentAvalonia.Core;
|
using FluentAvalonia.Core;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
@@ -23,6 +25,11 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Load();
|
Load();
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
this.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Alt));
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsWindow()
|
public SettingsWindow()
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
|
|
||||||
public string TimePlayedString => ValueFormatUtils.FormatTimeSpan(TimePlayed);
|
public string TimePlayedString => ValueFormatUtils.FormatTimeSpan(TimePlayed);
|
||||||
|
|
||||||
|
public bool HasPlayedPreviously => TimePlayedString != string.Empty;
|
||||||
|
|
||||||
public string LastPlayedString => ValueFormatUtils.FormatDateTime(LastPlayed)?.Replace(" ", "\n");
|
public string LastPlayedString => ValueFormatUtils.FormatDateTime(LastPlayed)?.Replace(" ", "\n");
|
||||||
|
|
||||||
public string FileSizeString => ValueFormatUtils.FormatFileSize(FileSize);
|
public string FileSizeString => ValueFormatUtils.FormatFileSize(FileSize);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Gommon;
|
using Gommon;
|
||||||
|
using Humanizer;
|
||||||
using nietras.SeparatedValues;
|
using nietras.SeparatedValues;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
@@ -83,6 +84,9 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
public LocaleKeys? Status { get; }
|
public LocaleKeys? Status { get; }
|
||||||
public DateTime LastUpdated { get; }
|
public DateTime LastUpdated { get; }
|
||||||
|
|
||||||
|
public string LocalizedLastUpdated =>
|
||||||
|
LocaleManager.FormatDynamicValue(LocaleKeys.CompatibilityListLastUpdated, LastUpdated.Humanize());
|
||||||
|
|
||||||
public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
|
public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
|
||||||
public string FormattedTitleId => TitleId
|
public string FormattedTitleId => TitleId
|
||||||
.OrElse(new string(' ', 16));
|
.OrElse(new string(' ', 16));
|
||||||
@@ -97,7 +101,9 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
StringBuilder sb = new("CompatibilityEntry: {");
|
StringBuilder sb = new("CompatibilityEntry: {");
|
||||||
sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
|
sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
|
||||||
sb.Append($"{nameof(TitleId)}={TitleId}, ");
|
sb.Append($"{nameof(TitleId)}={TitleId}, ");
|
||||||
sb.Append($"{nameof(Labels)}=\"{Labels}\", ");
|
sb.Append($"{nameof(Labels)}={
|
||||||
|
Labels.FormatCollection(it => $"\"{it}\"", separator: ", ", prefix: "[", suffix: "]")
|
||||||
|
}, ");
|
||||||
sb.Append($"{nameof(Status)}=\"{Status}\", ");
|
sb.Append($"{nameof(Status)}=\"{Status}\", ");
|
||||||
sb.Append($"{nameof(LastUpdated)}=\"{LastUpdated}\"");
|
sb.Append($"{nameof(LastUpdated)}=\"{LastUpdated}\"");
|
||||||
sb.Append('}');
|
sb.Append('}');
|
||||||
|
|||||||
@@ -44,8 +44,11 @@
|
|||||||
ItemsSource="{Binding CurrentEntries}">
|
ItemsSource="{Binding CurrentEntries}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
<DataTemplate DataType="{x:Type local:CompatibilityEntry}">
|
||||||
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
<Grid Width="750"
|
||||||
Margin="5">
|
Margin="5"
|
||||||
|
ColumnDefinitions="Auto,Auto,Auto,*"
|
||||||
|
Background="Transparent"
|
||||||
|
ToolTip.Tip="{Binding LocalizedLastUpdated}">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="{Binding GameName}"
|
Text="{Binding GameName}"
|
||||||
Width="320"
|
Width="320"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using Humanizer;
|
||||||
|
using Humanizer.Localisation;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -31,7 +33,7 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
Gigabytes = 9,
|
Gigabytes = 9,
|
||||||
Terabytes = 10,
|
Terabytes = 10,
|
||||||
Petabytes = 11,
|
Petabytes = 11,
|
||||||
Exabytes = 12,
|
Exabytes = 12
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double SizeBase10 = 1000;
|
private const double SizeBase10 = 1000;
|
||||||
@@ -48,22 +50,24 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
public static string FormatTimeSpan(TimeSpan? timeSpan)
|
public static string FormatTimeSpan(TimeSpan? timeSpan)
|
||||||
{
|
{
|
||||||
if (!timeSpan.HasValue || timeSpan.Value.TotalSeconds < 1)
|
if (!timeSpan.HasValue || timeSpan.Value.TotalSeconds < 1)
|
||||||
{
|
return string.Empty;
|
||||||
// Game was never played
|
|
||||||
return TimeSpan.Zero.ToString("c", CultureInfo.InvariantCulture);
|
if (timeSpan.Value.TotalSeconds < 60)
|
||||||
}
|
return timeSpan.Value.Humanize(1,
|
||||||
|
countEmptyUnits: false,
|
||||||
|
maxUnit: TimeUnit.Second,
|
||||||
|
minUnit: TimeUnit.Second);
|
||||||
|
|
||||||
if (timeSpan.Value.TotalDays < 1)
|
if (timeSpan.Value.TotalMinutes < 60)
|
||||||
{
|
return timeSpan.Value.Humanize(1,
|
||||||
// Game was played for less than a day
|
countEmptyUnits: false,
|
||||||
return timeSpan.Value.ToString("c", CultureInfo.InvariantCulture);
|
maxUnit: TimeUnit.Minute,
|
||||||
}
|
minUnit: TimeUnit.Minute);
|
||||||
|
|
||||||
// Game was played for more than a day
|
return timeSpan.Value.Humanize(1,
|
||||||
TimeSpan onlyTime = timeSpan.Value.Subtract(TimeSpan.FromDays(timeSpan.Value.Days));
|
countEmptyUnits: false,
|
||||||
string onlyTimeString = onlyTime.ToString("c", CultureInfo.InvariantCulture);
|
maxUnit: TimeUnit.Hour,
|
||||||
|
minUnit: TimeUnit.Hour);
|
||||||
return $"{timeSpan.Value.Days}d, {onlyTimeString}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user