Compare commits
10 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
672f5df0f9 | ||
|
|
804d9c1efe | ||
|
|
9270b35648 | ||
|
|
5a6d01db3c | ||
|
|
ef9c1416ec | ||
|
|
5efa7d5dfa | ||
|
|
a82569d615 | ||
|
|
ed5832ca73 | ||
|
|
574aa9ff9c | ||
|
|
8a29428de2 |
File diff suppressed because it is too large
Load Diff
@@ -402,7 +402,7 @@
|
|||||||
<x:Double x:Key="ControlContentThemeFontSize">13</x:Double>
|
<x:Double x:Key="ControlContentThemeFontSize">13</x:Double>
|
||||||
<x:Double x:Key="MenuItemHeight">26</x:Double>
|
<x:Double x:Key="MenuItemHeight">26</x:Double>
|
||||||
<x:Double x:Key="TabItemMinHeight">28</x:Double>
|
<x:Double x:Key="TabItemMinHeight">28</x:Double>
|
||||||
<x:Double x:Key="ContentDialogMaxWidth">700</x:Double>
|
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
||||||
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
<x:Double x:Key="ContentDialogMaxHeight">756</x:Double>
|
||||||
</Styles.Resources>
|
</Styles.Resources>
|
||||||
</Styles>
|
</Styles>
|
||||||
|
|||||||
@@ -171,12 +171,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AdditionalFiles Include="Assets\locales.json" />
|
<AdditionalFiles Include="Assets\locales.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Utilities\Compat\CompatibilityContentDialog.axaml.cs">
|
|
||||||
<DependentUpon>CompatibilityContentDialog.axaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Assets\Fonts\Mono\" />
|
<Folder Include="Assets\Fonts\Mono\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<ui:ContentDialog xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="using:Ryujinx.Ava.Utilities.Compat"
|
|
||||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
|
||||||
xmlns:ext="using:Ryujinx.Ava.Common.Markup"
|
|
||||||
x:Class="Ryujinx.Ava.Utilities.Compat.CompatibilityContentDialog"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="400"
|
|
||||||
CloseButtonText="{ext:Locale SettingsButtonClose}"
|
|
||||||
DefaultButton="Close"
|
|
||||||
x:DataType="local:CompatibilityViewModel">
|
|
||||||
<ui:ContentDialog.DataContext>
|
|
||||||
<local:CompatibilityViewModel/>
|
|
||||||
</ui:ContentDialog.DataContext>
|
|
||||||
<ui:ContentDialog.Resources>
|
|
||||||
<x:Double x:Key="ContentDialogMaxWidth">900</x:Double>
|
|
||||||
</ui:ContentDialog.Resources>
|
|
||||||
</ui:ContentDialog>
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Utilities.Compat
|
|
||||||
{
|
|
||||||
public partial class CompatibilityContentDialog : ContentDialog
|
|
||||||
{
|
|
||||||
protected override Type StyleKeyOverride => typeof(ContentDialog);
|
|
||||||
|
|
||||||
public CompatibilityContentDialog() => InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@ using nietras.SeparatedValues;
|
|||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -32,21 +33,22 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
{
|
{
|
||||||
public CompatibilityEntry(SepReaderHeader header, SepReader.Row row)
|
public CompatibilityEntry(SepReaderHeader header, SepReader.Row row)
|
||||||
{
|
{
|
||||||
IssueNumber = row[header.IndexOf("issue_number")].Parse<int>();
|
if (row.ColCount != header.ColNames.Count)
|
||||||
|
throw new InvalidDataException($"CSV row {row.RowIndex} ({row.ToString()}) has mismatched column count");
|
||||||
var titleIdRow = row[header.IndexOf("extracted_game_id")].ToString();
|
|
||||||
|
var titleIdRow = ColStr(row[header.IndexOf("\"extracted_game_id\"")]);
|
||||||
TitleId = !string.IsNullOrEmpty(titleIdRow)
|
TitleId = !string.IsNullOrEmpty(titleIdRow)
|
||||||
? titleIdRow
|
? titleIdRow
|
||||||
: default(Optional<string>);
|
: default(Optional<string>);
|
||||||
|
|
||||||
var issueTitleRow = row[header.IndexOf("issue_title")].ToString();
|
var issueTitleRow = ColStr(row[header.IndexOf("\"issue_title\"")]);
|
||||||
if (TitleId.HasValue)
|
if (TitleId.HasValue)
|
||||||
issueTitleRow = issueTitleRow.ReplaceIgnoreCase($" - {TitleId}", string.Empty);
|
issueTitleRow = issueTitleRow.ReplaceIgnoreCase($" - {TitleId}", string.Empty);
|
||||||
|
|
||||||
GameName = issueTitleRow.Trim().Trim('"');
|
GameName = issueTitleRow.Trim().Trim('"');
|
||||||
|
|
||||||
IssueLabels = row[header.IndexOf("issue_labels")].ToString().Split(';');
|
IssueLabels = ColStr(row[header.IndexOf("\"issue_labels\"")]).Split(';');
|
||||||
Status = row[header.IndexOf("extracted_status")].ToString().ToLower() switch
|
Status = ColStr(row[header.IndexOf("\"extracted_status\"")]).ToLower() switch
|
||||||
{
|
{
|
||||||
"playable" => LocaleKeys.CompatibilityListPlayable,
|
"playable" => LocaleKeys.CompatibilityListPlayable,
|
||||||
"ingame" => LocaleKeys.CompatibilityListIngame,
|
"ingame" => LocaleKeys.CompatibilityListIngame,
|
||||||
@@ -56,23 +58,23 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
_ => null
|
_ => null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (row[header.IndexOf("last_event_date")].TryParse<DateTime>(out var dt))
|
if (DateTime.TryParse(ColStr(row[header.IndexOf("\"last_event_date\"")]), out var dt))
|
||||||
LastEvent = dt;
|
LastEvent = dt;
|
||||||
|
|
||||||
if (row[header.IndexOf("events_count")].TryParse<int>(out var eventsCount))
|
return;
|
||||||
EventCount = eventsCount;
|
|
||||||
|
string ColStr(SepReader.Col col) => col.ToString().Trim('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
public int IssueNumber { get; }
|
|
||||||
public string GameName { get; }
|
public string GameName { get; }
|
||||||
public Optional<string> TitleId { get; }
|
public Optional<string> TitleId { get; }
|
||||||
public string[] IssueLabels { get; }
|
public string[] IssueLabels { get; }
|
||||||
public LocaleKeys? Status { get; }
|
public LocaleKeys? Status { get; }
|
||||||
public DateTime LastEvent { get; }
|
public DateTime LastEvent { get; }
|
||||||
public int EventCount { get; }
|
|
||||||
|
|
||||||
public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
|
public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
|
||||||
public string FormattedTitleId => TitleId.OrElse(new string(' ', 16));
|
public string FormattedTitleId => TitleId
|
||||||
|
.OrElse(new string(' ', 16));
|
||||||
|
|
||||||
public string FormattedIssueLabels => IssueLabels
|
public string FormattedIssueLabels => IssueLabels
|
||||||
.Where(it => !it.StartsWithIgnoreCase("status"))
|
.Where(it => !it.StartsWithIgnoreCase("status"))
|
||||||
@@ -82,13 +84,11 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder("CompatibilityEntry: {");
|
var sb = new StringBuilder("CompatibilityEntry: {");
|
||||||
sb.Append($"{nameof(IssueNumber)}={IssueNumber}, ");
|
|
||||||
sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
|
sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
|
||||||
sb.Append($"{nameof(TitleId)}={TitleId}, ");
|
sb.Append($"{nameof(TitleId)}={TitleId}, ");
|
||||||
sb.Append($"{nameof(IssueLabels)}=\"{IssueLabels}\", ");
|
sb.Append($"{nameof(IssueLabels)}=\"{IssueLabels}\", ");
|
||||||
sb.Append($"{nameof(Status)}=\"{Status}\", ");
|
sb.Append($"{nameof(Status)}=\"{Status}\", ");
|
||||||
sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\", ");
|
sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\"");
|
||||||
sb.Append($"{nameof(EventCount)}={EventCount}");
|
|
||||||
sb.Append('}');
|
sb.Append('}');
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
|
|||||||
@@ -47,9 +47,8 @@
|
|||||||
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
||||||
Margin="5">
|
Margin="5">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
FontFamily="{StaticResource JetBrainsMono}"
|
|
||||||
Text="{Binding GameName}"
|
Text="{Binding GameName}"
|
||||||
Width="333"
|
Width="320"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
Width="135"
|
Width="135"
|
||||||
@@ -60,14 +59,12 @@
|
|||||||
<TextBlock Grid.Column="2"
|
<TextBlock Grid.Column="2"
|
||||||
Padding="7, 0"
|
Padding="7, 0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontFamily="{StaticResource JetBrainsMono}"
|
|
||||||
Text="{Binding LocalizedStatus}"
|
Text="{Binding LocalizedStatus}"
|
||||||
Width="85"
|
Width="85"
|
||||||
Foreground="{Binding Status, Converter={x:Static helpers:PlayabilityStatusConverter.Shared}}"
|
Foreground="{Binding Status, Converter={x:Static helpers:PlayabilityStatusConverter.Shared}}"
|
||||||
TextWrapping="NoWrap" />
|
TextWrapping="NoWrap" />
|
||||||
<TextBlock Grid.Column="3"
|
<TextBlock Grid.Column="3"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontFamily="{StaticResource JetBrainsMono}"
|
|
||||||
Text="{Binding FormattedIssueLabels}"
|
Text="{Binding FormattedIssueLabels}"
|
||||||
TextWrapping="WrapWithOverflow" />
|
TextWrapping="WrapWithOverflow" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
|
using FluentAvalonia.UI.Controls;
|
||||||
using nietras.SeparatedValues;
|
using nietras.SeparatedValues;
|
||||||
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -19,11 +21,17 @@ namespace Ryujinx.Ava.Utilities.Compat
|
|||||||
csvStream.Position = 0;
|
csvStream.Position = 0;
|
||||||
|
|
||||||
CompatibilityCsv.Shared = new CompatibilityCsv(Sep.Reader().From(csvStream));
|
CompatibilityCsv.Shared = new CompatibilityCsv(Sep.Reader().From(csvStream));
|
||||||
}
|
}
|
||||||
|
|
||||||
CompatibilityContentDialog contentDialog = new()
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
Content = new CompatibilityList { DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary) }
|
PrimaryButtonText = string.Empty,
|
||||||
|
SecondaryButtonText = string.Empty,
|
||||||
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.SettingsButtonClose],
|
||||||
|
Content = new CompatibilityList
|
||||||
|
{
|
||||||
|
DataContext = new CompatibilityViewModel(RyujinxApp.MainWindow.ViewModel.ApplicationLibrary)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Style closeButton = new(x => x.Name("CloseButton"));
|
Style closeButton = new(x => x.Name("CloseButton"));
|
||||||
|
|||||||
Reference in New Issue
Block a user