diff --git a/src/Ryujinx.UI.Common/Helper/CommandLineState.cs b/src/Ryujinx.Common/Helpers/CommandLineState.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/CommandLineState.cs rename to src/Ryujinx.Common/Helpers/CommandLineState.cs diff --git a/src/Ryujinx.UI.Common/Helper/ConsoleHelper.cs b/src/Ryujinx.Common/Helpers/ConsoleHelper.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/ConsoleHelper.cs rename to src/Ryujinx.Common/Helpers/ConsoleHelper.cs diff --git a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs b/src/Ryujinx.Common/Helpers/FileAssociationHelper.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs rename to src/Ryujinx.Common/Helpers/FileAssociationHelper.cs diff --git a/src/Ryujinx.UI.Common/Helper/LinuxHelper.cs b/src/Ryujinx.Common/Helpers/LinuxHelper.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/LinuxHelper.cs rename to src/Ryujinx.Common/Helpers/LinuxHelper.cs diff --git a/src/Ryujinx.UI.Common/Helper/ObjectiveC.cs b/src/Ryujinx.Common/Helpers/ObjectiveC.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/ObjectiveC.cs rename to src/Ryujinx.Common/Helpers/ObjectiveC.cs diff --git a/src/Ryujinx.UI.Common/Helper/OpenHelper.cs b/src/Ryujinx.Common/Helpers/OpenHelper.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/OpenHelper.cs rename to src/Ryujinx.Common/Helpers/OpenHelper.cs diff --git a/src/Ryujinx.UI.Common/Helper/ValueFormatUtils.cs b/src/Ryujinx.Common/Helpers/ValueFormatUtils.cs similarity index 100% rename from src/Ryujinx.UI.Common/Helper/ValueFormatUtils.cs rename to src/Ryujinx.Common/Helpers/ValueFormatUtils.cs diff --git a/src/Ryujinx.UI.Common/Helper/AppletMetadata.cs b/src/Ryujinx.UI.Common/Helper/AppletMetadata.cs deleted file mode 100644 index 644b7fe74..000000000 --- a/src/Ryujinx.UI.Common/Helper/AppletMetadata.cs +++ /dev/null @@ -1,64 +0,0 @@ -using LibHac.Common; -using LibHac.Ncm; -using LibHac.Ns; -using LibHac.Tools.FsSystem.NcaUtils; -using Ryujinx.HLE; -using Ryujinx.HLE.FileSystem; -using Ryujinx.UI.App.Common; - -namespace Ryujinx.UI.Common.Helper -{ - public readonly struct AppletMetadata - { - private readonly ContentManager _contentManager; - - public string Name { get; } - public ulong ProgramId { get; } - - public string Version { get; } - - public AppletMetadata(ContentManager contentManager, string name, ulong programId, string version = "1.0.0") - : this(name, programId, version) - { - _contentManager = contentManager; - } - - public AppletMetadata(string name, ulong programId, string version = "1.0.0") - { - Name = name; - ProgramId = programId; - Version = version; - } - - public string GetContentPath(ContentManager contentManager) - => (contentManager ?? _contentManager) - .GetInstalledContentPath(ProgramId, StorageId.BuiltInSystem, NcaContentType.Program); - - public bool CanStart(ContentManager contentManager, out ApplicationData appData, out BlitStruct appControl) - { - contentManager ??= _contentManager; - if (contentManager == null) - { - appData = null; - appControl = new BlitStruct(0); - return false; - } - - appData = new() - { - Name = Name, - Id = ProgramId, - Path = GetContentPath(contentManager) - }; - - if (string.IsNullOrEmpty(appData.Path)) - { - appControl = new BlitStruct(0); - return false; - } - - appControl = StructHelpers.CreateCustomNacpData(Name, Version); - return true; - } - } -} diff --git a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj index 9a487b55a..0a28fddf3 100644 --- a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj +++ b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj @@ -42,8 +42,4 @@ - - - - diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 03860da43..f3fcbf5aa 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -20,6 +20,8 @@ using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Renderer; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration.Multiplayer; @@ -40,7 +42,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.SystemState; using Ryujinx.Input; using Ryujinx.Input.HLE; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common; using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Helper; diff --git a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApi.cs b/src/Ryujinx/Common/Models/Amiibo/AmiiboApi.cs similarity index 97% rename from src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApi.cs rename to src/Ryujinx/Common/Models/Amiibo/AmiiboApi.cs index 7989f0f1a..826e98d4f 100644 --- a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApi.cs +++ b/src/Ryujinx/Common/Models/Amiibo/AmiiboApi.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Amiibo +namespace Ryujinx.Ava.Common.Models.Amiibo { public struct AmiiboApi : IEquatable { diff --git a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiGamesSwitch.cs b/src/Ryujinx/Common/Models/Amiibo/AmiiboApiGamesSwitch.cs similarity index 90% rename from src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiGamesSwitch.cs rename to src/Ryujinx/Common/Models/Amiibo/AmiiboApiGamesSwitch.cs index 40e635bf0..7d43506e4 100644 --- a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiGamesSwitch.cs +++ b/src/Ryujinx/Common/Models/Amiibo/AmiiboApiGamesSwitch.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Amiibo +namespace Ryujinx.Ava.Common.Models.Amiibo { public class AmiiboApiGamesSwitch { diff --git a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiUsage.cs b/src/Ryujinx/Common/Models/Amiibo/AmiiboApiUsage.cs similarity index 84% rename from src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiUsage.cs rename to src/Ryujinx/Common/Models/Amiibo/AmiiboApiUsage.cs index 4f8d292b1..911323182 100644 --- a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboApiUsage.cs +++ b/src/Ryujinx/Common/Models/Amiibo/AmiiboApiUsage.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Amiibo +namespace Ryujinx.Ava.Common.Models.Amiibo { public class AmiiboApiUsage { diff --git a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJson.cs b/src/Ryujinx/Common/Models/Amiibo/AmiiboJson.cs similarity index 87% rename from src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJson.cs rename to src/Ryujinx/Common/Models/Amiibo/AmiiboJson.cs index 15083f505..39ca94bb6 100644 --- a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJson.cs +++ b/src/Ryujinx/Common/Models/Amiibo/AmiiboJson.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Amiibo +namespace Ryujinx.Ava.Common.Models.Amiibo { public struct AmiiboJson { diff --git a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJsonSerializerContext.cs b/src/Ryujinx/Common/Models/Amiibo/AmiiboJsonSerializerContext.cs similarity index 69% rename from src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJsonSerializerContext.cs rename to src/Ryujinx/Common/Models/Amiibo/AmiiboJsonSerializerContext.cs index bc3f1303c..e0fe11bc5 100644 --- a/src/Ryujinx.UI.Common/Models/Amiibo/AmiiboJsonSerializerContext.cs +++ b/src/Ryujinx/Common/Models/Amiibo/AmiiboJsonSerializerContext.cs @@ -1,9 +1,7 @@ using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Amiibo +namespace Ryujinx.Ava.Common.Models.Amiibo { [JsonSerializable(typeof(AmiiboJson))] - public partial class AmiiboJsonSerializerContext : JsonSerializerContext - { - } + public partial class AmiiboJsonSerializerContext : JsonSerializerContext; } diff --git a/src/Ryujinx.UI.Common/Models/DownloadableContentModel.cs b/src/Ryujinx/Common/Models/DownloadableContentModel.cs similarity index 93% rename from src/Ryujinx.UI.Common/Models/DownloadableContentModel.cs rename to src/Ryujinx/Common/Models/DownloadableContentModel.cs index 95c64f078..ad9934bd2 100644 --- a/src/Ryujinx.UI.Common/Models/DownloadableContentModel.cs +++ b/src/Ryujinx/Common/Models/DownloadableContentModel.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.UI.Common.Models +namespace Ryujinx.Ava.Common.Models { // NOTE: most consuming code relies on this model being value-comparable public record DownloadableContentModel(ulong TitleId, string ContainerPath, string FullPath) diff --git a/src/Ryujinx.UI.Common/Models/Github/GithubReleaseAssetJsonResponse.cs b/src/Ryujinx/Common/Models/Github/GithubReleaseAssetJsonResponse.cs similarity index 82% rename from src/Ryujinx.UI.Common/Models/Github/GithubReleaseAssetJsonResponse.cs rename to src/Ryujinx/Common/Models/Github/GithubReleaseAssetJsonResponse.cs index 8f528dc0b..633e16596 100644 --- a/src/Ryujinx.UI.Common/Models/Github/GithubReleaseAssetJsonResponse.cs +++ b/src/Ryujinx/Common/Models/Github/GithubReleaseAssetJsonResponse.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.UI.Common.Models.Github +namespace Ryujinx.Ava.Common.Models.Github { public class GithubReleaseAssetJsonResponse { diff --git a/src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonResponse.cs b/src/Ryujinx/Common/Models/Github/GithubReleasesJsonResponse.cs similarity index 85% rename from src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonResponse.cs rename to src/Ryujinx/Common/Models/Github/GithubReleasesJsonResponse.cs index 7bec1bcdc..dee912e1c 100644 --- a/src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonResponse.cs +++ b/src/Ryujinx/Common/Models/Github/GithubReleasesJsonResponse.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Ryujinx.UI.Common.Models.Github +namespace Ryujinx.Ava.Common.Models.Github { public class GithubReleasesJsonResponse { diff --git a/src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonSerializerContext.cs b/src/Ryujinx/Common/Models/Github/GithubReleasesJsonSerializerContext.cs similarity index 74% rename from src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonSerializerContext.cs rename to src/Ryujinx/Common/Models/Github/GithubReleasesJsonSerializerContext.cs index 71864257c..a450ab22d 100644 --- a/src/Ryujinx.UI.Common/Models/Github/GithubReleasesJsonSerializerContext.cs +++ b/src/Ryujinx/Common/Models/Github/GithubReleasesJsonSerializerContext.cs @@ -1,9 +1,7 @@ using System.Text.Json.Serialization; -namespace Ryujinx.UI.Common.Models.Github +namespace Ryujinx.Ava.Common.Models.Github { [JsonSerializable(typeof(GithubReleasesJsonResponse), GenerationMode = JsonSourceGenerationMode.Metadata)] - public partial class GithubReleasesJsonSerializerContext : JsonSerializerContext - { - } + public partial class GithubReleasesJsonSerializerContext : JsonSerializerContext; } diff --git a/src/Ryujinx.UI.Common/Models/TitleUpdateModel.cs b/src/Ryujinx/Common/Models/TitleUpdateModel.cs similarity index 91% rename from src/Ryujinx.UI.Common/Models/TitleUpdateModel.cs rename to src/Ryujinx/Common/Models/TitleUpdateModel.cs index 5422e1303..fedecddbe 100644 --- a/src/Ryujinx.UI.Common/Models/TitleUpdateModel.cs +++ b/src/Ryujinx/Common/Models/TitleUpdateModel.cs @@ -1,4 +1,4 @@ -namespace Ryujinx.UI.Common.Models +namespace Ryujinx.Ava.Common.Models { // NOTE: most consuming code relies on this model being value-comparable public record TitleUpdateModel(ulong TitleId, ulong Version, string DisplayVersion, string Path) diff --git a/src/Ryujinx.UI.Common/Models/XCITrimmerFileModel.cs b/src/Ryujinx/Common/Models/XCITrimmerFileModel.cs similarity index 95% rename from src/Ryujinx.UI.Common/Models/XCITrimmerFileModel.cs rename to src/Ryujinx/Common/Models/XCITrimmerFileModel.cs index 95fb3985b..526bf230c 100644 --- a/src/Ryujinx.UI.Common/Models/XCITrimmerFileModel.cs +++ b/src/Ryujinx/Common/Models/XCITrimmerFileModel.cs @@ -1,8 +1,8 @@ +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; -using Ryujinx.UI.App.Common; -namespace Ryujinx.UI.Common.Models +namespace Ryujinx.Ava.Common.Models { public record XCITrimmerFileModel( string Name, diff --git a/src/Ryujinx/DiscordIntegrationModule.cs b/src/Ryujinx/DiscordIntegrationModule.cs index 92c8e2aa6..f13b34ec8 100644 --- a/src/Ryujinx/DiscordIntegrationModule.cs +++ b/src/Ryujinx/DiscordIntegrationModule.cs @@ -1,10 +1,10 @@ using DiscordRPC; using Humanizer; using Humanizer.Localisation; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common; using Ryujinx.HLE; using Ryujinx.HLE.Loaders.Processes; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common.Configuration; using System.Text; diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 98bbfa2bb..76ed0b076 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -8,6 +8,7 @@ using Projektanker.Icons.Avalonia.MaterialDesign; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Ava.Utilities.SystemInfo; using Ryujinx.Common; using Ryujinx.Common.Configuration; @@ -17,7 +18,6 @@ using Ryujinx.Common.SystemInterop; using Ryujinx.Graphics.Vulkan.MoltenVK; using Ryujinx.Headless; using Ryujinx.SDL2.Common; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common; using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Helper; diff --git a/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs index 74fb41efa..4f998b040 100644 --- a/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs +++ b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs @@ -10,9 +10,10 @@ using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common.Configuration; using Ryujinx.HLE.HOS; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common.Helper; using SkiaSharp; using System; diff --git a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs index 25a34b423..ee0a324eb 100644 --- a/src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs +++ b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs @@ -3,7 +3,7 @@ using Avalonia.Input; using Avalonia.Interactivity; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using System; namespace Ryujinx.Ava.UI.Controls diff --git a/src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs index 5b0730d5a..a7654785f 100644 --- a/src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs +++ b/src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs @@ -5,7 +5,7 @@ using Avalonia.Interactivity; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using System; using System.Linq; diff --git a/src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs b/src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs index bc5622b54..0ceaa6c4c 100644 --- a/src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs +++ b/src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs @@ -1,5 +1,5 @@ using Avalonia.Interactivity; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; namespace Ryujinx.Ava.UI.Helpers { diff --git a/src/Ryujinx/UI/Helpers/MultiplayerInfoConverter.cs b/src/Ryujinx/UI/Helpers/MultiplayerInfoConverter.cs index 8bd8b5f0d..4135fd4c7 100644 --- a/src/Ryujinx/UI/Helpers/MultiplayerInfoConverter.cs +++ b/src/Ryujinx/UI/Helpers/MultiplayerInfoConverter.cs @@ -1,7 +1,7 @@ using Avalonia.Data.Converters; using Avalonia.Markup.Xaml; using Ryujinx.Ava.Common.Locale; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.UI.Common.Helper; using System; using System.Globalization; diff --git a/src/Ryujinx/UI/Helpers/XCITrimmerFileSpaceSavingsConverter.cs b/src/Ryujinx/UI/Helpers/XCITrimmerFileSpaceSavingsConverter.cs index 14e8e178a..ab6199c3f 100644 --- a/src/Ryujinx/UI/Helpers/XCITrimmerFileSpaceSavingsConverter.cs +++ b/src/Ryujinx/UI/Helpers/XCITrimmerFileSpaceSavingsConverter.cs @@ -3,7 +3,7 @@ using Avalonia.Data; using Avalonia.Data.Converters; using Gommon; using Ryujinx.Ava.Common.Locale; -using Ryujinx.UI.Common.Models; +using Ryujinx.Ava.Common.Models; using System; using System.Globalization; diff --git a/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusConverter.cs b/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusConverter.cs index 56a102415..c3fb1fe95 100644 --- a/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusConverter.cs +++ b/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusConverter.cs @@ -2,7 +2,7 @@ using Avalonia; using Avalonia.Data; using Avalonia.Data.Converters; using Ryujinx.Ava.Common.Locale; -using Ryujinx.UI.Common.Models; +using Ryujinx.Ava.Common.Models; using System; using System.Globalization; using static Ryujinx.Common.Utilities.XCIFileTrimmer; diff --git a/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusDetailConverter.cs b/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusDetailConverter.cs index cd4e27f01..e12d4efd9 100644 --- a/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusDetailConverter.cs +++ b/src/Ryujinx/UI/Helpers/XCITrimmerFileStatusDetailConverter.cs @@ -1,7 +1,7 @@ using Avalonia; using Avalonia.Data; using Avalonia.Data.Converters; -using Ryujinx.UI.Common.Models; +using Ryujinx.Ava.Common.Models; using System; using System.Globalization; using static Ryujinx.Common.Utilities.XCIFileTrimmer; diff --git a/src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs b/src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs index 224f78f45..f2d27f2df 100644 --- a/src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs +++ b/src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs @@ -1,4 +1,4 @@ -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using System; using System.Collections.Generic; diff --git a/src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs b/src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs index f0fb035d1..d7ae51e96 100644 --- a/src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs +++ b/src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs @@ -1,4 +1,4 @@ -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using System; using System.Collections.Generic; diff --git a/src/Ryujinx/UI/Models/SaveModel.cs b/src/Ryujinx/UI/Models/SaveModel.cs index 578538d21..8364e1966 100644 --- a/src/Ryujinx/UI/Models/SaveModel.cs +++ b/src/Ryujinx/UI/Models/SaveModel.cs @@ -3,8 +3,8 @@ using LibHac.Fs; using LibHac.Ncm; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.HLE.FileSystem; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common.Helper; using System; using System.IO; diff --git a/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs index 468a7c269..01a5dadd3 100644 --- a/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs @@ -3,13 +3,13 @@ using Avalonia.Collections; using Avalonia.Media.Imaging; using Avalonia.Threading; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models.Amiibo; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; -using Ryujinx.UI.Common.Models.Amiibo; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Ryujinx/UI/ViewModels/AppListFavoriteComparable.cs b/src/Ryujinx/UI/ViewModels/AppListFavoriteComparable.cs index e80984508..9c37368de 100644 --- a/src/Ryujinx/UI/ViewModels/AppListFavoriteComparable.cs +++ b/src/Ryujinx/UI/ViewModels/AppListFavoriteComparable.cs @@ -1,4 +1,4 @@ -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using System; namespace Ryujinx.Ava.UI.ViewModels diff --git a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs index 3abaae3ae..4e9660a65 100644 --- a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs @@ -5,10 +5,10 @@ using Avalonia.Threading; using DynamicData; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.Helpers; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.HLE.FileSystem; -using Ryujinx.UI.App.Common; -using Ryujinx.UI.Common.Models; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index c5f9f57ec..3bc100ba3 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -21,6 +21,7 @@ using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models.Generic; using Ryujinx.Ava.UI.Renderer; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; @@ -34,7 +35,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption; using Ryujinx.HLE.UI; using Ryujinx.Input.HLE; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common; using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Helper; diff --git a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs index dacdc3056..a179218af 100644 --- a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs @@ -4,10 +4,10 @@ using Avalonia.Platform.Storage; using Avalonia.Threading; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.Helpers; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.HLE.FileSystem; -using Ryujinx.UI.App.Common; -using Ryujinx.UI.Common.Models; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs index 402b182af..64965cd96 100644 --- a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs @@ -4,10 +4,10 @@ using Gommon; using Avalonia.Threading; using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.Helpers; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common.Utilities; -using Ryujinx.UI.App.Common; -using Ryujinx.UI.Common.Models; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -371,6 +371,16 @@ namespace Ryujinx.Ava.UI.ViewModels } } + public XCITrimmerFileModel NullableProcessingApplication + { + get => _processingApplication.OrDefault(); + set + { + _processingApplication = value; + OnPropertyChanged(); + } + } + public bool Processing { get => _cancellationTokenSource != null; diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index 181773b2e..1f8617ad7 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -7,6 +7,7 @@ using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.Windows; +using Ryujinx.Ava.Utilities; using Ryujinx.Common; using Ryujinx.Common.Utilities; using Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption; diff --git a/src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs b/src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs index 9a940c938..8c76b8e2f 100644 --- a/src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs @@ -1,7 +1,7 @@ using Avalonia.Interactivity; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models.Amiibo; using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.UI.Common.Models.Amiibo; namespace Ryujinx.Ava.UI.Windows { diff --git a/src/Ryujinx/UI/Windows/CheatWindow.axaml.cs b/src/Ryujinx/UI/Windows/CheatWindow.axaml.cs index 2fc9617fb..f5795d42c 100644 --- a/src/Ryujinx/UI/Windows/CheatWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/CheatWindow.axaml.cs @@ -2,9 +2,9 @@ using Avalonia.Collections; using LibHac.Tools.FsSystem; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Models; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common.Configuration; using System.Globalization; using System.IO; diff --git a/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml index df70f02eb..8efcfcadc 100644 --- a/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml +++ b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml @@ -6,9 +6,9 @@ xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" - xmlns:models="clr-namespace:Ryujinx.UI.Common.Models;assembly=Ryujinx.UI.Common" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" + xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models" Width="500" Height="380" mc:Ignorable="d" diff --git a/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs index 2afa8b529..02f420752 100644 --- a/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs @@ -3,10 +3,10 @@ using Avalonia.Interactivity; using Avalonia.Styling; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.UI.Common.Helper; -using Ryujinx.UI.Common.Models; using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Windows diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index 0e1e88b9c..f0aaf4cac 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -15,6 +15,7 @@ using Ryujinx.Ava.Input; using Ryujinx.Ava.UI.Applet; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.ViewModels; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.Common.UI; @@ -24,7 +25,6 @@ using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.Input.HLE; using Ryujinx.Input.SDL2; -using Ryujinx.UI.App.Common; using Ryujinx.UI.Common; using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Helper; diff --git a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml index 6e22cfed7..0ba9bc7d8 100644 --- a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml +++ b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml @@ -6,9 +6,9 @@ xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" - xmlns:models="clr-namespace:Ryujinx.UI.Common.Models;assembly=Ryujinx.UI.Common" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" + xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models" Width="500" Height="300" mc:Ignorable="d" diff --git a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs index a13ad4012..421990bcd 100644 --- a/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs @@ -3,10 +3,10 @@ using Avalonia.Interactivity; using Avalonia.Styling; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.UI.App.Common; +using Ryujinx.Ava.Utilities.AppLibrary; using Ryujinx.UI.Common.Helper; -using Ryujinx.UI.Common.Models; using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Windows diff --git a/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml b/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml index d726f8099..2d56931b5 100644 --- a/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml +++ b/src/Ryujinx/UI/Windows/XCITrimmerWindow.axaml @@ -6,9 +6,8 @@ xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" - xmlns:models="clr-namespace:Ryujinx.UI.Common.Models;assembly=Ryujinx.UI.Common" - xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" + xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models" Width="700" Height="600" x:DataType="viewModels:XCITrimmerViewModel" @@ -140,7 +139,7 @@ Padding="2.5"> ))] - internal partial class LdnGameDataSerializerContext : JsonSerializerContext - { - - } + internal partial class LdnGameDataSerializerContext : JsonSerializerContext; } diff --git a/src/Ryujinx/Utilities/AppletMetadata.cs b/src/Ryujinx/Utilities/AppletMetadata.cs new file mode 100644 index 000000000..82baed7d3 --- /dev/null +++ b/src/Ryujinx/Utilities/AppletMetadata.cs @@ -0,0 +1,60 @@ +using LibHac.Common; +using LibHac.Ncm; +using LibHac.Ns; +using LibHac.Tools.FsSystem.NcaUtils; +using Ryujinx.Ava.Utilities.AppLibrary; +using Ryujinx.HLE; +using Ryujinx.HLE.FileSystem; + +namespace Ryujinx.Ava.Utilities +{ + public readonly struct AppletMetadata + { + private readonly ContentManager _contentManager; + + public string Name { get; } + public ulong ProgramId { get; } + + public string Version { get; } + + public AppletMetadata(ContentManager contentManager, string name, ulong programId, string version = "1.0.0") + : this(name, programId, version) + { + _contentManager = contentManager; + } + + public AppletMetadata(string name, ulong programId, string version = "1.0.0") + { + Name = name; + ProgramId = programId; + Version = version; + } + + public string GetContentPath(ContentManager contentManager) + => (contentManager ?? _contentManager) + .GetInstalledContentPath(ProgramId, StorageId.BuiltInSystem, NcaContentType.Program); + + public bool CanStart(ContentManager contentManager, out ApplicationData appData, + out BlitStruct appControl) + { + contentManager ??= _contentManager; + if (contentManager == null) + { + appData = null; + appControl = new BlitStruct(0); + return false; + } + + appData = new() { Name = Name, Id = ProgramId, Path = GetContentPath(contentManager) }; + + if (string.IsNullOrEmpty(appData.Path)) + { + appControl = new BlitStruct(0); + return false; + } + + appControl = StructHelpers.CreateCustomNacpData(Name, Version); + return true; + } + } +} diff --git a/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs b/src/Ryujinx/Utilities/DownloadableContentsHelper.cs similarity index 98% rename from src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs rename to src/Ryujinx/Utilities/DownloadableContentsHelper.cs index 020529b55..b6d2420a3 100644 --- a/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs +++ b/src/Ryujinx/Utilities/DownloadableContentsHelper.cs @@ -3,18 +3,18 @@ using LibHac.Fs; using LibHac.Fs.Fsa; using LibHac.Tools.FsSystem; using LibHac.Tools.FsSystem.NcaUtils; +using Ryujinx.Ava.Common.Models; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.Utilities; -using Ryujinx.UI.Common.Models; using System; using System.Collections.Generic; using System.IO; using Path = System.IO.Path; -namespace Ryujinx.UI.Common.Helper +namespace Ryujinx.Ava.Utilities { public static class DownloadableContentsHelper { diff --git a/src/Ryujinx.UI.Common/Helper/SetupValidator.cs b/src/Ryujinx/Utilities/SetupValidator.cs similarity index 99% rename from src/Ryujinx.UI.Common/Helper/SetupValidator.cs rename to src/Ryujinx/Utilities/SetupValidator.cs index ddd9c9e30..0bd3a348d 100644 --- a/src/Ryujinx.UI.Common/Helper/SetupValidator.cs +++ b/src/Ryujinx/Utilities/SetupValidator.cs @@ -4,7 +4,7 @@ using Ryujinx.HLE.FileSystem; using System; using System.IO; -namespace Ryujinx.UI.Common.Helper +namespace Ryujinx.Ava.Utilities { /// /// Ensure installation validity diff --git a/src/Ryujinx.UI.Common/Helper/ShortcutHelper.cs b/src/Ryujinx/Utilities/ShortcutHelper.cs similarity index 99% rename from src/Ryujinx.UI.Common/Helper/ShortcutHelper.cs rename to src/Ryujinx/Utilities/ShortcutHelper.cs index 8c006a227..a0fb5599a 100644 --- a/src/Ryujinx.UI.Common/Helper/ShortcutHelper.cs +++ b/src/Ryujinx/Utilities/ShortcutHelper.cs @@ -1,5 +1,6 @@ using Ryujinx.Common; using Ryujinx.Common.Configuration; +using Ryujinx.UI.Common.Helper; using ShellLink; using SkiaSharp; using System; @@ -7,7 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.Versioning; -namespace Ryujinx.UI.Common.Helper +namespace Ryujinx.Ava.Utilities { public static class ShortcutHelper { diff --git a/src/Ryujinx.UI.Common/Helper/TitleHelper.cs b/src/Ryujinx/Utilities/TitleHelper.cs similarity index 95% rename from src/Ryujinx.UI.Common/Helper/TitleHelper.cs rename to src/Ryujinx/Utilities/TitleHelper.cs index 9d73aea75..be7a87f82 100644 --- a/src/Ryujinx.UI.Common/Helper/TitleHelper.cs +++ b/src/Ryujinx/Utilities/TitleHelper.cs @@ -1,7 +1,6 @@ using Ryujinx.HLE.Loaders.Processes; -using System; -namespace Ryujinx.UI.Common.Helper +namespace Ryujinx.Ava.Utilities { public static class TitleHelper { diff --git a/src/Ryujinx.UI.Common/Helper/TitleUpdatesHelper.cs b/src/Ryujinx/Utilities/TitleUpdatesHelper.cs similarity index 98% rename from src/Ryujinx.UI.Common/Helper/TitleUpdatesHelper.cs rename to src/Ryujinx/Utilities/TitleUpdatesHelper.cs index 36de8b31a..8cffb9b25 100644 --- a/src/Ryujinx.UI.Common/Helper/TitleUpdatesHelper.cs +++ b/src/Ryujinx/Utilities/TitleUpdatesHelper.cs @@ -6,6 +6,7 @@ using LibHac.Ncm; using LibHac.Ns; using LibHac.Tools.FsSystem; using LibHac.Tools.FsSystem.NcaUtils; +using Ryujinx.Ava.Common.Models; using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; @@ -13,7 +14,6 @@ using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.HLE.Utilities; using Ryujinx.UI.Common.Configuration; -using Ryujinx.UI.Common.Models; using System; using System.Collections.Generic; using System.IO; @@ -22,7 +22,7 @@ using Path = System.IO.Path; using SpanHelpers = LibHac.Common.SpanHelpers; using TitleUpdateMetadata = Ryujinx.Common.Configuration.TitleUpdateMetadata; -namespace Ryujinx.UI.Common.Helper +namespace Ryujinx.Ava.Utilities { public static class TitleUpdatesHelper {