mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-15 06:54:47 +00:00
misc: Move systems-like classes out of the base of the Ryujinx project and into Ryujinx.Ava.Systems
This commit is contained in:
parent
109f0fc659
commit
638c616ab7
13 changed files with 34 additions and 29 deletions
|
@ -38,8 +38,8 @@ namespace Ryujinx.Ava.Common.Locale
|
||||||
{ LocaleKeys.RyujinxConfirm, [RyujinxApp.FullAppName] },
|
{ LocaleKeys.RyujinxConfirm, [RyujinxApp.FullAppName] },
|
||||||
{ LocaleKeys.RyujinxUpdater, [RyujinxApp.FullAppName] },
|
{ LocaleKeys.RyujinxUpdater, [RyujinxApp.FullAppName] },
|
||||||
{ LocaleKeys.RyujinxRebooter, [RyujinxApp.FullAppName] },
|
{ LocaleKeys.RyujinxRebooter, [RyujinxApp.FullAppName] },
|
||||||
{ LocaleKeys.CompatibilityListSearchBoxWatermarkWithCount, [CompatibilityCsv.Entries.Length] },
|
{ LocaleKeys.CompatibilityListSearchBoxWatermarkWithCount, [CompatibilityDatabase.Entries.Length] },
|
||||||
{ LocaleKeys.CompatibilityListTitle, [CompatibilityCsv.Entries.Length] }
|
{ LocaleKeys.CompatibilityListTitle, [CompatibilityDatabase.Entries.Length] }
|
||||||
});
|
});
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
|
|
|
@ -2,6 +2,7 @@ using DiscordRPC;
|
||||||
using LibHac.Tools.FsSystem;
|
using LibHac.Tools.FsSystem;
|
||||||
using Ryujinx.Audio.Backends.SDL2;
|
using Ryujinx.Audio.Backends.SDL2;
|
||||||
using Ryujinx.Ava;
|
using Ryujinx.Ava;
|
||||||
|
using Ryujinx.Ava.Systems;
|
||||||
using Ryujinx.Ava.Systems.Configuration;
|
using Ryujinx.Ava.Systems.Configuration;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Gommon;
|
||||||
using Projektanker.Icons.Avalonia;
|
using Projektanker.Icons.Avalonia;
|
||||||
using Projektanker.Icons.Avalonia.FontAwesome;
|
using Projektanker.Icons.Avalonia.FontAwesome;
|
||||||
using Projektanker.Icons.Avalonia.MaterialDesign;
|
using Projektanker.Icons.Avalonia.MaterialDesign;
|
||||||
|
using Ryujinx.Ava.Systems;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
using Ryujinx.Ava.Utilities;
|
using Ryujinx.Ava.Utilities;
|
||||||
|
|
|
@ -91,10 +91,12 @@
|
||||||
<Content Include="..\..\distribution\legal\THIRDPARTY.md">
|
<Content Include="..\..\distribution\legal\THIRDPARTY.md">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<TargetPath>THIRDPARTY.md</TargetPath>
|
<TargetPath>THIRDPARTY.md</TargetPath>
|
||||||
|
<Visible>False</Visible>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="..\..\LICENSE.txt">
|
<Content Include="..\..\LICENSE.txt">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<TargetPath>LICENSE.txt</TargetPath>
|
<TargetPath>LICENSE.txt</TargetPath>
|
||||||
|
<Visible>False</Visible>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ using Size = Avalonia.Size;
|
||||||
using Switch = Ryujinx.HLE.Switch;
|
using Switch = Ryujinx.HLE.Switch;
|
||||||
using VSyncMode = Ryujinx.Common.Configuration.VSyncMode;
|
using VSyncMode = Ryujinx.Common.Configuration.VSyncMode;
|
||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava.Systems
|
||||||
{
|
{
|
||||||
internal class AppHost
|
internal class AppHost
|
||||||
{
|
{
|
|
@ -36,7 +36,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary
|
||||||
{
|
{
|
||||||
_id = value;
|
_id = value;
|
||||||
|
|
||||||
Compatibility = CompatibilityCsv.Find(value);
|
Compatibility = CompatibilityDatabase.Find(value);
|
||||||
RichPresenceSpec = PlayReports.Analyzer.TryGetSpec(IdString, out GameSpec gameSpec)
|
RichPresenceSpec = PlayReports.Analyzer.TryGetSpec(IdString, out GameSpec gameSpec)
|
||||||
? gameSpec
|
? gameSpec
|
||||||
: default(Optional<GameSpec>);
|
: default(Optional<GameSpec>);
|
||||||
|
|
|
@ -11,24 +11,9 @@ using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Systems
|
namespace Ryujinx.Ava.Systems
|
||||||
{
|
{
|
||||||
public struct ColumnIndices(Func<ReadOnlySpan<char>, int> getIndex)
|
public class CompatibilityDatabase
|
||||||
{
|
{
|
||||||
public const string TitleIdCol = "\"title_id\"";
|
static CompatibilityDatabase() => Load();
|
||||||
public const string GameNameCol = "\"game_name\"";
|
|
||||||
public const string LabelsCol = "\"labels\"";
|
|
||||||
public const string StatusCol = "\"status\"";
|
|
||||||
public const string LastUpdatedCol = "\"last_updated\"";
|
|
||||||
|
|
||||||
public readonly int TitleId = getIndex(TitleIdCol);
|
|
||||||
public readonly int GameName = getIndex(GameNameCol);
|
|
||||||
public readonly int Labels = getIndex(LabelsCol);
|
|
||||||
public readonly int Status = getIndex(StatusCol);
|
|
||||||
public readonly int LastUpdated = getIndex(LastUpdatedCol);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CompatibilityCsv
|
|
||||||
{
|
|
||||||
static CompatibilityCsv() => Load();
|
|
||||||
|
|
||||||
public static void Load()
|
public static void Load()
|
||||||
{
|
{
|
||||||
|
@ -205,4 +190,19 @@ namespace Ryujinx.Ava.Systems
|
||||||
return $"{char.ToUpper(firstChar)}{rest}";
|
return $"{char.ToUpper(firstChar)}{rest}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct ColumnIndices(Func<ReadOnlySpan<char>, int> getIndex)
|
||||||
|
{
|
||||||
|
public const string TitleIdCol = "\"title_id\"";
|
||||||
|
public const string GameNameCol = "\"game_name\"";
|
||||||
|
public const string LabelsCol = "\"labels\"";
|
||||||
|
public const string StatusCol = "\"status\"";
|
||||||
|
public const string LastUpdatedCol = "\"last_updated\"";
|
||||||
|
|
||||||
|
public readonly int TitleId = getIndex(TitleIdCol);
|
||||||
|
public readonly int GameName = getIndex(GameNameCol);
|
||||||
|
public readonly int Labels = getIndex(LabelsCol);
|
||||||
|
public readonly int Status = getIndex(StatusCol);
|
||||||
|
public readonly int LastUpdated = getIndex(LastUpdatedCol);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -9,10 +9,9 @@ using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE;
|
using Ryujinx.HLE;
|
||||||
using Ryujinx.HLE.Loaders.Processes;
|
using Ryujinx.HLE.Loaders.Processes;
|
||||||
using Ryujinx.Horizon;
|
using Ryujinx.Horizon;
|
||||||
using Ryujinx.Horizon.Prepo.Types;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava.Systems
|
||||||
{
|
{
|
||||||
public static class DiscordIntegrationModule
|
public static class DiscordIntegrationModule
|
||||||
{
|
{
|
||||||
|
@ -124,7 +123,7 @@ namespace Ryujinx.Ava
|
||||||
_currentApp = null;
|
_currentApp = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HandlePlayReport(PlayReport playReport)
|
private static void HandlePlayReport(Horizon.Prepo.Types.PlayReport playReport)
|
||||||
{
|
{
|
||||||
if (_discordClient is null) return;
|
if (_discordClient is null) return;
|
||||||
if (!TitleIDs.CurrentApplication.Value.HasValue) return;
|
if (!TitleIDs.CurrentApplication.Value.HasValue) return;
|
|
@ -8,7 +8,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava.Systems
|
||||||
{
|
{
|
||||||
internal static class Rebooter
|
internal static class Rebooter
|
||||||
{
|
{
|
|
@ -27,7 +27,7 @@ using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava.Systems
|
||||||
{
|
{
|
||||||
internal static class Updater
|
internal static class Updater
|
||||||
{
|
{
|
|
@ -10,7 +10,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
private bool _onlyShowOwnedGames = true;
|
private bool _onlyShowOwnedGames = true;
|
||||||
|
|
||||||
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityCsv.Entries;
|
private IEnumerable<CompatibilityEntry> _currentEntries = CompatibilityDatabase.Entries;
|
||||||
private string[] _ownedGameTitleIds = [];
|
private string[] _ownedGameTitleIds = [];
|
||||||
|
|
||||||
public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames
|
public IEnumerable<CompatibilityEntry> CurrentEntries => OnlyShowOwnedGames
|
||||||
|
@ -45,11 +45,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(searchTerm))
|
if (string.IsNullOrEmpty(searchTerm))
|
||||||
{
|
{
|
||||||
SetEntries(CompatibilityCsv.Entries);
|
SetEntries(CompatibilityDatabase.Entries);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetEntries(CompatibilityCsv.Entries.Where(x =>
|
SetEntries(CompatibilityDatabase.Entries.Where(x =>
|
||||||
x.GameName.ContainsIgnoreCase(searchTerm)
|
x.GameName.ContainsIgnoreCase(searchTerm)
|
||||||
|| x.TitleId.Check(tid => tid.ContainsIgnoreCase(searchTerm))));
|
|| x.TitleId.Check(tid => tid.ContainsIgnoreCase(searchTerm))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ using LibHac.Ns;
|
||||||
using Ryujinx.Ava.Common;
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Input;
|
using Ryujinx.Ava.Input;
|
||||||
|
using Ryujinx.Ava.Systems;
|
||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
|
|
|
@ -12,6 +12,7 @@ using LibHac.Ns;
|
||||||
using Ryujinx.Ava.Common;
|
using Ryujinx.Ava.Common;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.Input;
|
using Ryujinx.Ava.Input;
|
||||||
|
using Ryujinx.Ava.Systems;
|
||||||
using Ryujinx.Ava.UI.Applet;
|
using Ryujinx.Ava.UI.Applet;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
|
|
Loading…
Add table
Reference in a new issue