diff --git a/.editorconfig b/.editorconfig index 1eaf77ae6..76edc491c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -259,12 +259,12 @@ dotnet_diagnostic.CA1861.severity = none # Disable "Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'" dotnet_diagnostic.CA1862.severity = none -[src/Ryujinx.HLE/HOS/Services/**.cs] -# Disable "mark members as static" rule for services +[src/Ryujinx/UI/ViewModels/**.cs] +# Disable "mark members as static" rule for ViewModels dotnet_diagnostic.CA1822.severity = none -[src/Ryujinx.Ava/UI/ViewModels/**.cs] -# Disable "mark members as static" rule for ViewModels +[src/Ryujinx.HLE/HOS/Services/**.cs] +# Disable "mark members as static" rule for services dotnet_diagnostic.CA1822.severity = none [src/Ryujinx.Tests/Cpu/*.cs] diff --git a/.github/labeler.yml b/.github/labeler.yml index b967cc776..cd7650a9d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -20,7 +20,7 @@ gpu: gui: - changed-files: - - any-glob-to-any-file: ['src/Ryujinx/**', 'src/Ryujinx.UI.Common/**', 'src/Ryujinx.UI.LocaleGenerator/**', 'src/Ryujinx.Ava/**'] + - any-glob-to-any-file: ['src/Ryujinx/**', 'src/Ryujinx.UI.Common/**', 'src/Ryujinx.UI.LocaleGenerator/**', 'src/Ryujinx.Gtk3/**'] horizon: - changed-files: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 598f23c5e..9e11302fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,15 +67,15 @@ jobs: run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Headless.SDL2 --self-contained true if: github.event_name == 'pull_request' && matrix.platform.os != 'macOS-latest' - - name: Publish Ryujinx.Ava - run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_ava -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Ava --self-contained true + - name: Publish Ryujinx.Gtk3 + run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_gtk -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Gtk3 --self-contained true if: github.event_name == 'pull_request' && matrix.platform.os != 'macOS-latest' - name: Set executable bit run: | chmod +x ./publish/Ryujinx ./publish/Ryujinx.sh chmod +x ./publish_sdl2_headless/Ryujinx.Headless.SDL2 ./publish_sdl2_headless/Ryujinx.sh - chmod +x ./publish_ava/Ryujinx.Ava ./publish_ava/Ryujinx.sh + chmod +x ./publish_gtk/Ryujinx.Gtk3 ./publish_gtk/Ryujinx.sh if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest' - name: Upload Ryujinx artifact @@ -92,11 +92,11 @@ jobs: path: publish_sdl2_headless if: github.event_name == 'pull_request' && matrix.platform.os != 'macOS-latest' - - name: Upload Ryujinx.Ava artifact + - name: Upload Ryujinx.Gtk3 artifact uses: actions/upload-artifact@v4 with: - name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }} - path: publish_ava + name: gtk-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }} + path: publish_gtk if: github.event_name == 'pull_request' && matrix.platform.os != 'macOS-latest' build_macos: @@ -140,19 +140,19 @@ jobs: shell: bash if: github.event_name == 'pull_request' - - name: Publish macOS Ryujinx.Ava + - name: Publish macOS Ryujinx run: | - ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER" + ./distribution/macos/create_macos_build_ava.sh . publish_tmp publish ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER" - name: Publish macOS Ryujinx.Headless.SDL2 run: | ./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ env.RYUJINX_BASE_VERSION }}" "${{ steps.git_short_hash.outputs.result }}" "${{ matrix.configuration }}" "-p:ExtraDefineConstants=DISABLE_UPDATER" - - name: Upload Ryujinx.Ava artifact + - name: Upload Ryujinx artifact uses: actions/upload-artifact@v4 with: - name: ava-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal - path: "publish_ava/*.tar.gz" + name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal + path: "publish/*.tar.gz" if: github.event_name == 'pull_request' - name: Upload Ryujinx.Headless.SDL2 artifact diff --git a/.github/workflows/nightly_pr_comment.yml b/.github/workflows/nightly_pr_comment.yml index f59a6be1f..38850df06 100644 --- a/.github/workflows/nightly_pr_comment.yml +++ b/.github/workflows/nightly_pr_comment.yml @@ -39,24 +39,24 @@ jobs: return core.error(`No artifacts found`); } let body = `Download the artifacts for this pull request:\n`; - let hidden_avalonia_artifacts = `\n\n
Experimental GUI (Avalonia)\n`; + let hidden_gtk_artifacts = `\n\n
Old GUI (GTK3)\n`; let hidden_headless_artifacts = `\n\n
GUI-less (SDL2)\n`; let hidden_debug_artifacts = `\n\n
Only for Developers\n`; for (const art of artifacts) { if(art.name.includes('Debug')) { hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; - } else if(art.name.includes('ava-ryujinx')) { - hidden_avalonia_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; + } else if(art.name.includes('gtk-ryujinx')) { + hidden_gtk_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } else if(art.name.includes('sdl2-ryujinx-headless')) { hidden_headless_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } else { body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } } - hidden_avalonia_artifacts += `\n
`; + hidden_gtk_artifacts += `\n
`; hidden_headless_artifacts += `\n
`; hidden_debug_artifacts += `\n
`; - body += hidden_avalonia_artifacts; + body += hidden_gtk_artifacts; body += hidden_headless_artifacts; body += hidden_debug_artifacts; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac598684f..133c2fad0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,14 +86,13 @@ jobs: - name: Publish run: | - dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_gtk/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained true + dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained true dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained true - dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Ava --self-contained true - name: Packing Windows builds if: matrix.platform.os == 'windows-latest' run: | - pushd publish_gtk + pushd publish_ava 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish popd @@ -102,6 +101,7 @@ jobs: popd pushd publish_ava + mv publish/Ryujinx.exe publish/Ryujinx.Ava.exe 7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish popd shell: bash @@ -109,7 +109,7 @@ jobs: - name: Packing Linux builds if: matrix.platform.os == 'ubuntu-latest' run: | - pushd publish_gtk + pushd publish_ava chmod +x publish/Ryujinx.sh publish/Ryujinx tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish popd @@ -120,6 +120,7 @@ jobs: popd pushd publish_ava + mv publish/Ryujinx publish/Ryujinx.Ava chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish popd @@ -183,10 +184,10 @@ jobs: sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs shell: bash - - name: Publish macOS Ryujinx.Ava + - name: Publish macOS Ryujinx run: | ./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release - + - name: Publish macOS Ryujinx.Headless.SDL2 run: | ./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release diff --git a/Ryujinx.sln b/Ryujinx.sln index 47a5c714c..b8304164d 100644 --- a/Ryujinx.sln +++ b/Ryujinx.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32228.430 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx", "src\Ryujinx\Ryujinx.csproj", "{074045D4-3ED2-4711-9169-E385F2BFB5A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Gtk3", "src\Ryujinx.Gtk3\Ryujinx.Gtk3.csproj", "{074045D4-3ED2-4711-9169-E385F2BFB5A0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Tests", "src\Ryujinx.Tests\Ryujinx.Tests.csproj", "{EBB55AEA-C7D7-4DEB-BF96-FA1789E225E9}" EndProject @@ -69,7 +69,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Headless.SDL2", "sr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Graphics.Nvdec.FFmpeg", "src\Ryujinx.Graphics.Nvdec.FFmpeg\Ryujinx.Graphics.Nvdec.FFmpeg.csproj", "{BEE1C184-C9A4-410B-8DFC-FB74D5C93AEB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Ava", "src\Ryujinx.Ava\Ryujinx.Ava.csproj", "{7C1B2721-13DA-4B62-B046-C626605ECCE6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx", "src\Ryujinx\Ryujinx.csproj", "{7C1B2721-13DA-4B62-B046-C626605ECCE6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.UI.Common", "src\Ryujinx.UI.Common\Ryujinx.UI.Common.csproj", "{BA161CA0-CD65-4E6E-B644-51C8D1E542DC}" EndProject diff --git a/distribution/linux/Ryujinx.sh b/distribution/linux/Ryujinx.sh index 6cce4d213..30eb14399 100755 --- a/distribution/linux/Ryujinx.sh +++ b/distribution/linux/Ryujinx.sh @@ -6,10 +6,6 @@ if [ -f "$SCRIPT_DIR/Ryujinx.Headless.SDL2" ]; then RYUJINX_BIN="Ryujinx.Headless.SDL2" fi -if [ -f "$SCRIPT_DIR/Ryujinx.Ava" ]; then - RYUJINX_BIN="Ryujinx.Ava" -fi - if [ -f "$SCRIPT_DIR/Ryujinx" ]; then RYUJINX_BIN="Ryujinx" fi diff --git a/distribution/macos/create_app_bundle.sh b/distribution/macos/create_app_bundle.sh index 858c06f59..0fa54eadd 100755 --- a/distribution/macos/create_app_bundle.sh +++ b/distribution/macos/create_app_bundle.sh @@ -14,8 +14,8 @@ mkdir "$APP_BUNDLE_DIRECTORY/Contents/Frameworks" mkdir "$APP_BUNDLE_DIRECTORY/Contents/MacOS" mkdir "$APP_BUNDLE_DIRECTORY/Contents/Resources" -# Copy executables first -cp "$PUBLISH_DIRECTORY/Ryujinx.Ava" "$APP_BUNDLE_DIRECTORY/Contents/MacOS/Ryujinx" +# Copy executable and nsure executable can be executed +cp "$PUBLISH_DIRECTORY/Ryujinx" "$APP_BUNDLE_DIRECTORY/Contents/MacOS/Ryujinx" chmod u+x "$APP_BUNDLE_DIRECTORY/Contents/MacOS/Ryujinx" # Then all libraries diff --git a/distribution/macos/create_macos_build_ava.sh b/distribution/macos/create_macos_build_ava.sh index 80594a40a..23eafc129 100755 --- a/distribution/macos/create_macos_build_ava.sh +++ b/distribution/macos/create_macos_build_ava.sh @@ -22,9 +22,9 @@ EXTRA_ARGS=$8 if [ "$VERSION" == "1.1.0" ]; then - RELEASE_TAR_FILE_NAME=test-ava-ryujinx-$CONFIGURATION-$VERSION+$SOURCE_REVISION_ID-macos_universal.app.tar + RELEASE_TAR_FILE_NAME=ryujinx-$CONFIGURATION-$VERSION+$SOURCE_REVISION_ID-macos_universal.app.tar else - RELEASE_TAR_FILE_NAME=test-ava-ryujinx-$VERSION-macos_universal.app.tar + RELEASE_TAR_FILE_NAME=ryujinx-$VERSION-macos_universal.app.tar fi ARM64_APP_BUNDLE="$TEMP_DIRECTORY/output_arm64/Ryujinx.app" @@ -38,9 +38,9 @@ mkdir -p "$TEMP_DIRECTORY" DOTNET_COMMON_ARGS=(-p:DebugType=embedded -p:Version="$VERSION" -p:SourceRevisionId="$SOURCE_REVISION_ID" --self-contained true $EXTRA_ARGS) dotnet restore -dotnet build -c "$CONFIGURATION" src/Ryujinx.Ava -dotnet publish -c "$CONFIGURATION" -r osx-arm64 -o "$TEMP_DIRECTORY/publish_arm64" "${DOTNET_COMMON_ARGS[@]}" src/Ryujinx.Ava -dotnet publish -c "$CONFIGURATION" -r osx-x64 -o "$TEMP_DIRECTORY/publish_x64" "${DOTNET_COMMON_ARGS[@]}" src/Ryujinx.Ava +dotnet build -c "$CONFIGURATION" src/Ryujinx +dotnet publish -c "$CONFIGURATION" -r osx-arm64 -o "$TEMP_DIRECTORY/publish_arm64" "${DOTNET_COMMON_ARGS[@]}" src/Ryujinx +dotnet publish -c "$CONFIGURATION" -r osx-x64 -o "$TEMP_DIRECTORY/publish_x64" "${DOTNET_COMMON_ARGS[@]}" src/Ryujinx # Get rid of the support library for ARMeilleure for x64 (that's only for arm64) rm -rf "$TEMP_DIRECTORY/publish_x64/libarmeilleure-jitsupport.dylib" @@ -108,6 +108,13 @@ tar --exclude "Ryujinx.app/Contents/MacOS/Ryujinx" -cvf "$RELEASE_TAR_FILE_NAME" python3 "$BASE_DIR/distribution/misc/add_tar_exec.py" "$RELEASE_TAR_FILE_NAME" "Ryujinx.app/Contents/MacOS/Ryujinx" "Ryujinx.app/Contents/MacOS/Ryujinx" gzip -9 < "$RELEASE_TAR_FILE_NAME" > "$RELEASE_TAR_FILE_NAME.gz" rm "$RELEASE_TAR_FILE_NAME" + +# Create legacy update package for Avalonia to not left behind old testers. +if [ "$VERSION" != "1.1.0" ]; +then + cp $RELEASE_TAR_FILE_NAME.gz test-ava-ryujinx-$VERSION-macos_universal.app.tar.gz +fi + popd echo "Done" \ No newline at end of file diff --git a/src/Ryujinx.Ava/Program.cs b/src/Ryujinx.Ava/Program.cs deleted file mode 100644 index aecc585fc..000000000 --- a/src/Ryujinx.Ava/Program.cs +++ /dev/null @@ -1,237 +0,0 @@ -using Avalonia; -using Avalonia.Threading; -using Ryujinx.Ava.UI.Helpers; -using Ryujinx.Ava.UI.Windows; -using Ryujinx.Common; -using Ryujinx.Common.Configuration; -using Ryujinx.Common.GraphicsDriver; -using Ryujinx.Common.Logging; -using Ryujinx.Common.SystemInterop; -using Ryujinx.Modules; -using Ryujinx.SDL2.Common; -using Ryujinx.UI.Common; -using Ryujinx.UI.Common.Configuration; -using Ryujinx.UI.Common.Helper; -using Ryujinx.UI.Common.SystemInfo; -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Ryujinx.Ava -{ - internal partial class Program - { - public static double WindowScaleFactor { get; set; } - public static double DesktopScaleFactor { get; set; } = 1.0; - public static string Version { get; private set; } - public static string ConfigurationPath { get; private set; } - public static bool PreviewerDetached { get; private set; } - - [LibraryImport("user32.dll", SetLastError = true)] - public static partial int MessageBoxA(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type); - - private const uint MbIconwarning = 0x30; - - public static void Main(string[] args) - { - Version = ReleaseInformation.Version; - - if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134)) - { - _ = MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconwarning); - } - - PreviewerDetached = true; - - Initialize(args); - - LoggerAdapter.Register(); - - BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); - } - - public static AppBuilder BuildAvaloniaApp() - { - return AppBuilder.Configure() - .UsePlatformDetect() - .With(new X11PlatformOptions - { - EnableMultiTouch = true, - EnableIme = true, - EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope", - RenderingMode = new[] { X11RenderingMode.Glx, X11RenderingMode.Software }, - }) - .With(new Win32PlatformOptions - { - WinUICompositionBackdropCornerRadius = 8.0f, - RenderingMode = new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software }, - }) - .UseSkia(); - } - - private static void Initialize(string[] args) - { - // Parse arguments - CommandLineState.ParseArguments(args); - - // Delete backup files after updating. - Task.Run(Updater.CleanupUpdate); - - Console.Title = $"Ryujinx Console {Version}"; - - // Hook unhandled exception and process exit events. - AppDomain.CurrentDomain.UnhandledException += (sender, e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); - AppDomain.CurrentDomain.ProcessExit += (sender, e) => Exit(); - - // Setup base data directory. - AppDataManager.Initialize(CommandLineState.BaseDirPathArg); - - // Initialize the configuration. - ConfigurationState.Initialize(); - - // Initialize the logger system. - LoggerModule.Initialize(); - - // Initialize Discord integration. - DiscordIntegrationModule.Initialize(); - - // Initialize SDL2 driver - SDL2Driver.MainThreadDispatcher = action => Dispatcher.UIThread.InvokeAsync(action, DispatcherPriority.Input); - - ReloadConfig(); - - WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); - - // Logging system information. - PrintSystemInfo(); - - // Enable OGL multithreading on the driver, when available. - DriverUtilities.ToggleOGLThreading(ConfigurationState.Instance.Graphics.BackendThreading == BackendThreading.Off); - - // Check if keys exists. - if (!File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys"))) - { - if (!(AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys")))) - { - MainWindow.ShowKeyErrorOnLoad = true; - } - } - - if (CommandLineState.LaunchPathArg != null) - { - MainWindow.DeferLoadApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg); - } - } - - public static void ReloadConfig() - { - string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.ConfigName); - string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.ConfigName); - - // Now load the configuration as the other subsystems are now registered - if (File.Exists(localConfigurationPath)) - { - ConfigurationPath = localConfigurationPath; - } - else if (File.Exists(appDataConfigurationPath)) - { - ConfigurationPath = appDataConfigurationPath; - } - - if (ConfigurationPath == null) - { - // No configuration, we load the default values and save it to disk - ConfigurationPath = appDataConfigurationPath; - - ConfigurationState.Instance.LoadDefault(); - ConfigurationState.Instance.ToFileFormat().SaveConfig(ConfigurationPath); - } - else - { - if (ConfigurationFileFormat.TryLoad(ConfigurationPath, out ConfigurationFileFormat configurationFileFormat)) - { - ConfigurationState.Instance.Load(configurationFileFormat, ConfigurationPath); - } - else - { - ConfigurationState.Instance.LoadDefault(); - - Logger.Warning?.PrintMsg(LogClass.Application, $"Failed to load config! Loading the default config instead.\nFailed config location {ConfigurationPath}"); - } - } - - // Check if graphics backend was overridden - if (CommandLineState.OverrideGraphicsBackend != null) - { - if (CommandLineState.OverrideGraphicsBackend.ToLower() == "opengl") - { - ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.OpenGl; - } - else if (CommandLineState.OverrideGraphicsBackend.ToLower() == "vulkan") - { - ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.Vulkan; - } - } - - // Check if docked mode was overriden. - if (CommandLineState.OverrideDockedMode.HasValue) - { - ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value; - } - - // Check if HideCursor was overridden. - if (CommandLineState.OverrideHideCursor is not null) - { - ConfigurationState.Instance.HideCursor.Value = CommandLineState.OverrideHideCursor!.ToLower() switch - { - "never" => HideCursorMode.Never, - "onidle" => HideCursorMode.OnIdle, - "always" => HideCursorMode.Always, - _ => ConfigurationState.Instance.HideCursor.Value, - }; - } - } - - private static void PrintSystemInfo() - { - Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}"); - SystemInfo.Gather().Print(); - - Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "" : string.Join(", ", Logger.GetEnabledLevels()))}"); - - if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom) - { - Logger.Notice.Print(LogClass.Application, $"Launch Mode: Custom Path {AppDataManager.BaseDirPath}"); - } - else - { - Logger.Notice.Print(LogClass.Application, $"Launch Mode: {AppDataManager.Mode}"); - } - } - - private static void ProcessUnhandledException(Exception ex, bool isTerminating) - { - string message = $"Unhandled exception caught: {ex}"; - - Logger.Error?.PrintMsg(LogClass.Application, message); - - if (Logger.Error == null) - { - Logger.Notice.PrintMsg(LogClass.Application, message); - } - - if (isTerminating) - { - Exit(); - } - } - - public static void Exit() - { - DiscordIntegrationModule.Exit(); - - Logger.Shutdown(); - } - } -} diff --git a/src/Ryujinx.Ava/Ryujinx.Ava.csproj b/src/Ryujinx.Ava/Ryujinx.Ava.csproj deleted file mode 100644 index 91c2744f0..000000000 --- a/src/Ryujinx.Ava/Ryujinx.Ava.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - net8.0 - win-x64;osx-x64;linux-x64 - Exe - true - 1.0.0-dirty - $(DefineConstants);$(ExtraDefineConstants) - - - Ryujinx.Ava - Ryujinx.ico - true - true - app.manifest - - - - - - - - true - false - true - partial - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Always - alsoft.ini - - - Always - THIRDPARTY.md - - - Always - LICENSE.txt - - - - - - Always - - - Always - mime\Ryujinx.xml - - - - - - Designer - - - - MSBuild:Compile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Ryujinx/Input/GTK3/GTK3Keyboard.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3Keyboard.cs similarity index 100% rename from src/Ryujinx/Input/GTK3/GTK3Keyboard.cs rename to src/Ryujinx.Gtk3/Input/GTK3/GTK3Keyboard.cs diff --git a/src/Ryujinx/Input/GTK3/GTK3KeyboardDriver.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs similarity index 100% rename from src/Ryujinx/Input/GTK3/GTK3KeyboardDriver.cs rename to src/Ryujinx.Gtk3/Input/GTK3/GTK3KeyboardDriver.cs diff --git a/src/Ryujinx/Input/GTK3/GTK3MappingHelper.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3MappingHelper.cs similarity index 100% rename from src/Ryujinx/Input/GTK3/GTK3MappingHelper.cs rename to src/Ryujinx.Gtk3/Input/GTK3/GTK3MappingHelper.cs diff --git a/src/Ryujinx/Input/GTK3/GTK3Mouse.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3Mouse.cs similarity index 100% rename from src/Ryujinx/Input/GTK3/GTK3Mouse.cs rename to src/Ryujinx.Gtk3/Input/GTK3/GTK3Mouse.cs diff --git a/src/Ryujinx/Input/GTK3/GTK3MouseDriver.cs b/src/Ryujinx.Gtk3/Input/GTK3/GTK3MouseDriver.cs similarity index 100% rename from src/Ryujinx/Input/GTK3/GTK3MouseDriver.cs rename to src/Ryujinx.Gtk3/Input/GTK3/GTK3MouseDriver.cs diff --git a/src/Ryujinx/Modules/Updater/UpdateDialog.cs b/src/Ryujinx.Gtk3/Modules/Updater/UpdateDialog.cs similarity index 93% rename from src/Ryujinx/Modules/Updater/UpdateDialog.cs rename to src/Ryujinx.Gtk3/Modules/Updater/UpdateDialog.cs index ec24cdc89..43bde9420 100644 --- a/src/Ryujinx/Modules/Updater/UpdateDialog.cs +++ b/src/Ryujinx.Gtk3/Modules/Updater/UpdateDialog.cs @@ -25,7 +25,7 @@ namespace Ryujinx.Modules private readonly string _buildUrl; private bool _restartQuery; - public UpdateDialog(MainWindow mainWindow, Version newVersion, string buildUrl) : this(new Builder("Ryujinx.Modules.Updater.UpdateDialog.glade"), mainWindow, newVersion, buildUrl) { } + public UpdateDialog(MainWindow mainWindow, Version newVersion, string buildUrl) : this(new Builder("Ryujinx.Gtk3.Modules.Updater.UpdateDialog.glade"), mainWindow, newVersion, buildUrl) { } private UpdateDialog(Builder builder, MainWindow mainWindow, Version newVersion, string buildUrl) : base(builder.GetRawOwnedObject("UpdateDialog")) { @@ -34,7 +34,7 @@ namespace Ryujinx.Modules _mainWindow = mainWindow; _buildUrl = buildUrl; - Icon = new Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.UI.Common.Resources.Logo_Ryujinx.png"); + Icon = new Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Gtk3.UI.Common.Resources.Logo_Ryujinx.png"); MainText.Text = "Do you want to update Ryujinx to the latest version?"; SecondaryText.Text = $"{Program.Version} -> {newVersion}"; diff --git a/src/Ryujinx/Modules/Updater/UpdateDialog.glade b/src/Ryujinx.Gtk3/Modules/Updater/UpdateDialog.glade similarity index 100% rename from src/Ryujinx/Modules/Updater/UpdateDialog.glade rename to src/Ryujinx.Gtk3/Modules/Updater/UpdateDialog.glade diff --git a/src/Ryujinx.Ava/Modules/Updater/Updater.cs b/src/Ryujinx.Gtk3/Modules/Updater/Updater.cs similarity index 50% rename from src/Ryujinx.Ava/Modules/Updater/Updater.cs rename to src/Ryujinx.Gtk3/Modules/Updater/Updater.cs index 5795f34f0..8b006f63f 100644 --- a/src/Ryujinx.Ava/Modules/Updater/Updater.cs +++ b/src/Ryujinx.Gtk3/Modules/Updater/Updater.cs @@ -1,75 +1,93 @@ -using Avalonia.Controls; -using Avalonia.Threading; -using FluentAvalonia.UI.Controls; +using Gtk; using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Zip; -using Ryujinx.Ava; -using Ryujinx.Ava.Common.Locale; -using Ryujinx.Ava.UI.Helpers; using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; -using Ryujinx.UI.Common.Helper; +using Ryujinx.UI; using Ryujinx.UI.Common.Models.Github; +using Ryujinx.UI.Widgets; using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.NetworkInformation; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Ryujinx.Modules { - internal static class Updater + public static class Updater { private const string GitHubApiUrl = "https://api.github.com"; - private static readonly GithubReleasesJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); + private const int ConnectionCount = 4; + + internal static bool Running; private static readonly string _homeDir = AppDomain.CurrentDomain.BaseDirectory; private static readonly string _updateDir = Path.Combine(Path.GetTempPath(), "Ryujinx", "update"); private static readonly string _updatePublishDir = Path.Combine(_updateDir, "publish"); - private const int ConnectionCount = 4; private static string _buildVer; private static string _platformExt; private static string _buildUrl; private static long _buildSize; - private static bool _updateSuccessful; - private static bool _running; - private static readonly string[] _windowsDependencyDirs = Array.Empty(); + private static readonly GithubReleasesJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); - public static async Task BeginParse(Window mainWindow, bool showVersionUpToDate) + // On Windows, GtkSharp.Dependencies adds these extra dirs that must be cleaned during updates. + private static readonly string[] _windowsDependencyDirs = { "bin", "etc", "lib", "share" }; + + private static HttpClient ConstructHttpClient() { - if (_running) + HttpClient result = new(); + + // Required by GitHub to interact with APIs. + result.DefaultRequestHeaders.Add("User-Agent", "Ryujinx-Updater/1.0.0"); + + return result; + } + + public static async Task BeginParse(MainWindow mainWindow, bool showVersionUpToDate) + { + if (Running) { return; } - _running = true; + Running = true; + mainWindow.UpdateMenuItem.Sensitive = false; + + int artifactIndex = -1; // Detect current platform if (OperatingSystem.IsMacOS()) { - _platformExt = "macos_universal.app.tar.gz"; + _platformExt = "osx_x64.zip"; + artifactIndex = 1; } else if (OperatingSystem.IsWindows()) { _platformExt = "win_x64.zip"; + artifactIndex = 2; } else if (OperatingSystem.IsLinux()) { var arch = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "arm64" : "x64"; _platformExt = $"linux_{arch}.tar.gz"; + artifactIndex = 0; + } + + if (artifactIndex == -1) + { + GtkDialog.CreateErrorDialog("Your platform is not supported!"); + + return; } Version newVersion; @@ -81,14 +99,9 @@ namespace Ryujinx.Modules } catch { + GtkDialog.CreateWarningDialog("Failed to convert the current Ryujinx version.", "Cancelling Update!"); Logger.Error?.Print(LogClass.Application, "Failed to convert the current Ryujinx version!"); - await ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedMessage], - LocaleManager.Instance[LocaleKeys.DialogUpdaterCancelUpdateMessage]); - - _running = false; - return; } @@ -96,15 +109,16 @@ namespace Ryujinx.Modules try { using HttpClient jsonClient = ConstructHttpClient(); - string buildInfoUrl = $"{GitHubApiUrl}/repos/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}/releases/latest"; + + // Fetch latest build information string fetchedJson = await jsonClient.GetStringAsync(buildInfoUrl); var fetched = JsonHelper.Deserialize(fetchedJson, _serializerContext.GithubReleasesJsonResponse); _buildVer = fetched.Name; foreach (var asset in fetched.Assets) { - if (asset.Name.StartsWith("test-ava-ryujinx") && asset.Name.EndsWith(_platformExt)) + if (asset.Name.StartsWith("gtk-ryujinx") && asset.Name.EndsWith(_platformExt)) { _buildUrl = asset.BrowserDownloadUrl; @@ -112,13 +126,9 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - await ContentDialogHelper.CreateUpdaterInfoDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], - ""); + GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); } - _running = false; - return; } @@ -126,29 +136,20 @@ namespace Ryujinx.Modules } } - // If build not done, assume no new update are available. - if (_buildUrl is null) + if (_buildUrl == null) { if (showVersionUpToDate) { - await ContentDialogHelper.CreateUpdaterInfoDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], - ""); + GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); } - _running = false; - return; } } catch (Exception exception) { Logger.Error?.Print(LogClass.Application, exception.Message); - - await ContentDialogHelper.CreateErrorDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterFailedToGetVersionMessage]); - - _running = false; + GtkDialog.CreateErrorDialog("An error occurred when trying to get release information from GitHub Release. This can be caused if a new release is being compiled by GitHub Actions. Try again in a few minutes."); return; } @@ -159,13 +160,8 @@ namespace Ryujinx.Modules } catch { - Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from Github!"); - - await ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedGithubMessage], - LocaleManager.Instance[LocaleKeys.DialogUpdaterCancelUpdateMessage]); - - _running = false; + GtkDialog.CreateWarningDialog("Failed to convert the received Ryujinx version from GitHub Release.", "Cancelling Update!"); + Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from GitHub Release!"); return; } @@ -174,12 +170,11 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - await ContentDialogHelper.CreateUpdaterInfoDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], - ""); + GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); } - _running = false; + Running = false; + mainWindow.UpdateMenuItem.Sensitive = true; return; } @@ -202,39 +197,13 @@ namespace Ryujinx.Modules _buildSize = -1; } - await Dispatcher.UIThread.InvokeAsync(async () => - { - // Show a message asking the user if they want to update - var shouldUpdate = await ContentDialogHelper.CreateChoiceDialog( - LocaleManager.Instance[LocaleKeys.RyujinxUpdater], - LocaleManager.Instance[LocaleKeys.RyujinxUpdaterMessage], - $"{Program.Version} -> {newVersion}"); - - if (shouldUpdate) - { - await UpdateRyujinx(mainWindow, _buildUrl); - } - else - { - _running = false; - } - }); + // Show a message asking the user if they want to update + UpdateDialog updateDialog = new(mainWindow, newVersion, _buildUrl); + updateDialog.Show(); } - private static HttpClient ConstructHttpClient() + public static void UpdateRyujinx(UpdateDialog updateDialog, string downloadUrl) { - HttpClient result = new(); - - // Required by GitHub to interact with APIs. - result.DefaultRequestHeaders.Add("User-Agent", "Ryujinx-Updater/1.0.0"); - - return result; - } - - private static async Task UpdateRyujinx(Window parent, string downloadUrl) - { - _updateSuccessful = false; - // Empty update dir, although it shouldn't ever have anything inside it if (Directory.Exists(_updateDir)) { @@ -245,93 +214,22 @@ namespace Ryujinx.Modules string updateFile = Path.Combine(_updateDir, "update.bin"); - TaskDialog taskDialog = new() + // Download the update .zip + updateDialog.MainText.Text = "Downloading Update..."; + updateDialog.ProgressBar.Value = 0; + updateDialog.ProgressBar.MaxValue = 100; + + if (_buildSize >= 0) { - Header = LocaleManager.Instance[LocaleKeys.RyujinxUpdater], - SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading], - IconSource = new SymbolIconSource { Symbol = Symbol.Download }, - ShowProgressBar = true, - XamlRoot = parent, - }; - - taskDialog.Opened += (s, e) => + DoUpdateWithMultipleThreads(updateDialog, downloadUrl, updateFile); + } + else { - if (_buildSize >= 0) - { - DoUpdateWithMultipleThreads(taskDialog, downloadUrl, updateFile); - } - else - { - DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); - } - }; - - await taskDialog.ShowAsync(true); - - if (_updateSuccessful) - { - bool shouldRestart = true; - - if (!OperatingSystem.IsMacOS()) - { - shouldRestart = await ContentDialogHelper.CreateChoiceDialog(LocaleManager.Instance[LocaleKeys.RyujinxUpdater], - LocaleManager.Instance[LocaleKeys.DialogUpdaterCompleteMessage], - LocaleManager.Instance[LocaleKeys.DialogUpdaterRestartMessage]); - } - - if (shouldRestart) - { - List arguments = CommandLineState.Arguments.ToList(); - string executableDirectory = AppDomain.CurrentDomain.BaseDirectory; - - // On macOS we perform the update at relaunch. - if (OperatingSystem.IsMacOS()) - { - string baseBundlePath = Path.GetFullPath(Path.Combine(executableDirectory, "..", "..")); - string newBundlePath = Path.Combine(_updateDir, "Ryujinx.app"); - string updaterScriptPath = Path.Combine(newBundlePath, "Contents", "Resources", "updater.sh"); - string currentPid = Environment.ProcessId.ToString(); - - arguments.InsertRange(0, new List { updaterScriptPath, baseBundlePath, newBundlePath, currentPid }); - Process.Start("/bin/bash", arguments); - } - else - { - // Find the process name. - string ryuName = Path.GetFileName(Environment.ProcessPath); - - // Some operating systems can see the renamed executable, so strip off the .ryuold if found. - if (ryuName.EndsWith(".ryuold")) - { - ryuName = ryuName[..^7]; - } - - // Fallback if the executable could not be found. - if (!Path.Exists(Path.Combine(executableDirectory, ryuName))) - { - ryuName = OperatingSystem.IsWindows() ? "Ryujinx.Ava.exe" : "Ryujinx.Ava"; - } - - ProcessStartInfo processStart = new(ryuName) - { - UseShellExecute = true, - WorkingDirectory = executableDirectory, - }; - - foreach (string argument in CommandLineState.Arguments) - { - processStart.ArgumentList.Add(argument); - } - - Process.Start(processStart); - } - - Environment.Exit(0); - } + DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); } } - private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile) + private static void DoUpdateWithMultipleThreads(UpdateDialog updateDialog, string downloadUrl, string updateFile) { // Multi-Threaded Updater long chunkSize = _buildSize / ConnectionCount; @@ -355,7 +253,6 @@ namespace Ryujinx.Modules // TODO: WebClient is obsolete and need to be replaced with a more complex logic using HttpClient. using WebClient client = new(); #pragma warning restore SYSLIB0014 - webClients.Add(client); if (i == ConnectionCount - 1) @@ -375,7 +272,7 @@ namespace Ryujinx.Modules Interlocked.Exchange(ref progressPercentage[index], args.ProgressPercentage); Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage); - taskDialog.SetProgressBarState(totalProgressPercentage / ConnectionCount, TaskDialogProgressState.Normal); + updateDialog.ProgressBar.Value = totalProgressPercentage / ConnectionCount; }; client.DownloadDataCompleted += (_, args) => @@ -386,8 +283,6 @@ namespace Ryujinx.Modules { webClients[index].Dispose(); - taskDialog.Hide(); - return; } @@ -405,24 +300,18 @@ namespace Ryujinx.Modules File.WriteAllBytes(updateFile, mergedFileBytes); - // On macOS, ensure that we remove the quarantine bit to prevent Gatekeeper from blocking execution. - if (OperatingSystem.IsMacOS()) - { - using Process xattrProcess = Process.Start("xattr", new List { "-d", "com.apple.quarantine", updateFile }); - - xattrProcess.WaitForExit(); - } - try { - InstallUpdate(taskDialog, updateFile); + InstallUpdate(updateDialog, updateFile); } catch (Exception e) { Logger.Warning?.Print(LogClass.Application, e.Message); Logger.Warning?.Print(LogClass.Application, "Multi-Threaded update failed, falling back to single-threaded updater."); - DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); + DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); + + return; } } }; @@ -441,14 +330,14 @@ namespace Ryujinx.Modules webClient.CancelAsync(); } - DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); + DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); return; } } } - private static void DoUpdateWithSingleThreadWorker(TaskDialog taskDialog, string downloadUrl, string updateFile) + private static void DoUpdateWithSingleThreadWorker(UpdateDialog updateDialog, string downloadUrl, string updateFile) { using HttpClient client = new(); // We do not want to timeout while downloading @@ -474,118 +363,101 @@ namespace Ryujinx.Modules byteWritten += readSize; - taskDialog.SetProgressBarState(GetPercentage(byteWritten, totalBytes), TaskDialogProgressState.Normal); - + updateDialog.ProgressBar.Value = ((double)byteWritten / totalBytes) * 100; updateFileStream.Write(buffer, 0, readSize); } - InstallUpdate(taskDialog, updateFile); + InstallUpdate(updateDialog, updateFile); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static double GetPercentage(double value, double max) + private static void DoUpdateWithSingleThread(UpdateDialog updateDialog, string downloadUrl, string updateFile) { - return max == 0 ? 0 : value / max * 100; - } - - private static void DoUpdateWithSingleThread(TaskDialog taskDialog, string downloadUrl, string updateFile) - { - Thread worker = new(() => DoUpdateWithSingleThreadWorker(taskDialog, downloadUrl, updateFile)) + Thread worker = new(() => DoUpdateWithSingleThreadWorker(updateDialog, downloadUrl, updateFile)) { Name = "Updater.SingleThreadWorker", }; - worker.Start(); } - [SupportedOSPlatform("linux")] - [SupportedOSPlatform("macos")] - private static void ExtractTarGzipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) - { - using Stream inStream = File.OpenRead(archivePath); - using GZipInputStream gzipStream = new(inStream); - using TarInputStream tarStream = new(gzipStream, Encoding.ASCII); - - TarEntry tarEntry; - - while ((tarEntry = tarStream.GetNextEntry()) is not null) - { - if (tarEntry.IsDirectory) - { - continue; - } - - string outPath = Path.Combine(outputDirectoryPath, tarEntry.Name); - - Directory.CreateDirectory(Path.GetDirectoryName(outPath)); - - using FileStream outStream = File.OpenWrite(outPath); - tarStream.CopyEntryContents(outStream); - - File.SetUnixFileMode(outPath, (UnixFileMode)tarEntry.TarHeader.Mode); - File.SetLastWriteTime(outPath, DateTime.SpecifyKind(tarEntry.ModTime, DateTimeKind.Utc)); - - Dispatcher.UIThread.Post(() => - { - if (tarEntry is null) - { - return; - } - - taskDialog.SetProgressBarState(GetPercentage(tarEntry.Size, inStream.Length), TaskDialogProgressState.Normal); - }); - } - } - - private static void ExtractZipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) - { - using Stream inStream = File.OpenRead(archivePath); - using ZipFile zipFile = new(inStream); - - double count = 0; - foreach (ZipEntry zipEntry in zipFile) - { - count++; - if (zipEntry.IsDirectory) - { - continue; - } - - string outPath = Path.Combine(outputDirectoryPath, zipEntry.Name); - - Directory.CreateDirectory(Path.GetDirectoryName(outPath)); - - using Stream zipStream = zipFile.GetInputStream(zipEntry); - using FileStream outStream = File.OpenWrite(outPath); - - zipStream.CopyTo(outStream); - - File.SetLastWriteTime(outPath, DateTime.SpecifyKind(zipEntry.DateTime, DateTimeKind.Utc)); - - Dispatcher.UIThread.Post(() => - { - taskDialog.SetProgressBarState(GetPercentage(count, zipFile.Count), TaskDialogProgressState.Normal); - }); - } - } - - private static void InstallUpdate(TaskDialog taskDialog, string updateFile) + private static async void InstallUpdate(UpdateDialog updateDialog, string updateFile) { // Extract Update - taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterExtracting]; - taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); + updateDialog.MainText.Text = "Extracting Update..."; + updateDialog.ProgressBar.Value = 0; - if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) + if (OperatingSystem.IsLinux()) { - ExtractTarGzipFile(taskDialog, updateFile, _updateDir); - } - else if (OperatingSystem.IsWindows()) - { - ExtractZipFile(taskDialog, updateFile, _updateDir); + using Stream inStream = File.OpenRead(updateFile); + using Stream gzipStream = new GZipInputStream(inStream); + using TarInputStream tarStream = new(gzipStream, Encoding.ASCII); + updateDialog.ProgressBar.MaxValue = inStream.Length; + + await Task.Run(() => + { + TarEntry tarEntry; + + if (!OperatingSystem.IsWindows()) + { + while ((tarEntry = tarStream.GetNextEntry()) != null) + { + if (tarEntry.IsDirectory) + { + continue; + } + + string outPath = Path.Combine(_updateDir, tarEntry.Name); + + Directory.CreateDirectory(Path.GetDirectoryName(outPath)); + + using FileStream outStream = File.OpenWrite(outPath); + tarStream.CopyEntryContents(outStream); + + File.SetUnixFileMode(outPath, (UnixFileMode)tarEntry.TarHeader.Mode); + File.SetLastWriteTime(outPath, DateTime.SpecifyKind(tarEntry.ModTime, DateTimeKind.Utc)); + + TarEntry entry = tarEntry; + + Application.Invoke(delegate + { + updateDialog.ProgressBar.Value += entry.Size; + }); + } + } + }); + + updateDialog.ProgressBar.Value = inStream.Length; } else { - throw new NotSupportedException(); + using Stream inStream = File.OpenRead(updateFile); + using ZipFile zipFile = new(inStream); + updateDialog.ProgressBar.MaxValue = zipFile.Count; + + await Task.Run(() => + { + foreach (ZipEntry zipEntry in zipFile) + { + if (zipEntry.IsDirectory) + { + continue; + } + + string outPath = Path.Combine(_updateDir, zipEntry.Name); + + Directory.CreateDirectory(Path.GetDirectoryName(outPath)); + + using Stream zipStream = zipFile.GetInputStream(zipEntry); + using FileStream outStream = File.OpenWrite(outPath); + zipStream.CopyTo(outStream); + + File.SetLastWriteTime(outPath, DateTime.SpecifyKind(zipEntry.DateTime, DateTimeKind.Utc)); + + Application.Invoke(delegate + { + updateDialog.ProgressBar.Value++; + }); + } + }); } // Delete downloaded zip @@ -593,46 +465,49 @@ namespace Ryujinx.Modules List allFiles = EnumerateFilesToDelete().ToList(); - taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterRenaming]; - taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); + updateDialog.MainText.Text = "Renaming Old Files..."; + updateDialog.ProgressBar.Value = 0; + updateDialog.ProgressBar.MaxValue = allFiles.Count; - // NOTE: On macOS, replacement is delayed to the restart phase. - if (!OperatingSystem.IsMacOS()) + // Replace old files + await Task.Run(() => { - // Replace old files - double count = 0; foreach (string file in allFiles) { - count++; try { File.Move(file, file + ".ryuold"); - Dispatcher.UIThread.InvokeAsync(() => + Application.Invoke(delegate { - taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), TaskDialogProgressState.Normal); + updateDialog.ProgressBar.Value++; }); } catch { - Logger.Warning?.Print(LogClass.Application, LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.UpdaterRenameFailed, file)); + Logger.Warning?.Print(LogClass.Application, "Updater was unable to rename file: " + file); } } - Dispatcher.UIThread.InvokeAsync(() => + Application.Invoke(delegate { - taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterAddingFiles]; - taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); + updateDialog.MainText.Text = "Adding New Files..."; + updateDialog.ProgressBar.Value = 0; + updateDialog.ProgressBar.MaxValue = Directory.GetFiles(_updatePublishDir, "*", SearchOption.AllDirectories).Length; }); - MoveAllFilesOver(_updatePublishDir, _homeDir, taskDialog); + MoveAllFilesOver(_updatePublishDir, _homeDir, updateDialog); + }); - Directory.Delete(_updateDir, true); - } + Directory.Delete(_updateDir, true); - _updateSuccessful = true; + updateDialog.MainText.Text = "Update Complete!"; + updateDialog.SecondaryText.Text = "Do you want to restart Ryujinx now?"; + updateDialog.Modal = true; - taskDialog.Hide(); + updateDialog.ProgressBar.Hide(); + updateDialog.YesButton.Show(); + updateDialog.NoButton.Show(); } public static bool CanUpdate(bool showWarnings) @@ -642,11 +517,7 @@ namespace Ryujinx.Modules { if (showWarnings) { - Dispatcher.UIThread.InvokeAsync(() => - ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterNoInternetMessage], - LocaleManager.Instance[LocaleKeys.DialogUpdaterNoInternetSubMessage]) - ); + GtkDialog.CreateWarningDialog("You are not connected to the Internet!", "Please verify that you have a working Internet connection!"); } return false; @@ -656,11 +527,7 @@ namespace Ryujinx.Modules { if (showWarnings) { - Dispatcher.UIThread.InvokeAsync(() => - ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildMessage], - LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildSubMessage]) - ); + GtkDialog.CreateWarningDialog("You cannot update a Dirty build of Ryujinx!", "Please download Ryujinx at https://ryujinx.org/ if you are looking for a supported version."); } return false; @@ -672,19 +539,11 @@ namespace Ryujinx.Modules { if (ReleaseInformation.IsFlatHubBuild) { - Dispatcher.UIThread.InvokeAsync(() => - ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], - LocaleManager.Instance[LocaleKeys.DialogUpdaterFlatpakNotSupportedMessage]) - ); + GtkDialog.CreateWarningDialog("Updater Disabled!", "Please update Ryujinx via FlatHub."); } else { - Dispatcher.UIThread.InvokeAsync(() => - ContentDialogHelper.CreateWarningDialog( - LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], - LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildSubMessage]) - ); + GtkDialog.CreateWarningDialog("Updater Disabled!", "Please download Ryujinx at https://ryujinx.org/ if you are looking for a supported version."); } } @@ -698,7 +557,7 @@ namespace Ryujinx.Modules var files = Directory.EnumerateFiles(_homeDir); // All files directly in base dir. // Determine and exclude user files only when the updater is running, not when cleaning old files - if (_running && !OperatingSystem.IsMacOS()) + if (Running) { // Compare the loose files in base directory against the loose files from the incoming update, and store foreign ones in a user list. var oldFiles = Directory.EnumerateFiles(_homeDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); @@ -724,9 +583,8 @@ namespace Ryujinx.Modules return files.Where(f => !new FileInfo(f).Attributes.HasFlag(FileAttributes.Hidden | FileAttributes.System)); } - private static void MoveAllFilesOver(string root, string dest, TaskDialog taskDialog) + private static void MoveAllFilesOver(string root, string dest, UpdateDialog dialog) { - int total = Directory.GetFiles(root, "*", SearchOption.AllDirectories).Length; foreach (string directory in Directory.GetDirectories(root)) { string dirName = Path.GetFileName(directory); @@ -736,28 +594,28 @@ namespace Ryujinx.Modules Directory.CreateDirectory(Path.Combine(dest, dirName)); } - MoveAllFilesOver(directory, Path.Combine(dest, dirName), taskDialog); + MoveAllFilesOver(directory, Path.Combine(dest, dirName), dialog); } - double count = 0; foreach (string file in Directory.GetFiles(root)) { - count++; - File.Move(file, Path.Combine(dest, Path.GetFileName(file)), true); - Dispatcher.UIThread.InvokeAsync(() => + Application.Invoke(delegate { - taskDialog.SetProgressBarState(GetPercentage(count, total), TaskDialogProgressState.Normal); + dialog.ProgressBar.Value++; }); } } public static void CleanupUpdate() { - foreach (string file in Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories)) + foreach (string file in EnumerateFilesToDelete()) { - File.Delete(file); + if (Path.GetExtension(file).EndsWith(".ryuold")) + { + File.Delete(file); + } } } } diff --git a/src/Ryujinx.Gtk3/Program.cs b/src/Ryujinx.Gtk3/Program.cs new file mode 100644 index 000000000..1845c512e --- /dev/null +++ b/src/Ryujinx.Gtk3/Program.cs @@ -0,0 +1,378 @@ +using Gtk; +using Ryujinx.Common; +using Ryujinx.Common.Configuration; +using Ryujinx.Common.GraphicsDriver; +using Ryujinx.Common.Logging; +using Ryujinx.Common.SystemInterop; +using Ryujinx.Modules; +using Ryujinx.SDL2.Common; +using Ryujinx.UI; +using Ryujinx.UI.Common; +using Ryujinx.UI.Common.Configuration; +using Ryujinx.UI.Common.Helper; +using Ryujinx.UI.Common.SystemInfo; +using Ryujinx.UI.Widgets; +using SixLabors.ImageSharp.Formats.Jpeg; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace Ryujinx +{ + partial class Program + { + public static double WindowScaleFactor { get; private set; } + + public static string Version { get; private set; } + + public static string ConfigurationPath { get; set; } + + public static string CommandLineProfile { get; set; } + + private const string X11LibraryName = "libX11"; + + [LibraryImport(X11LibraryName)] + private static partial int XInitThreads(); + + [LibraryImport("user32.dll", SetLastError = true)] + public static partial int MessageBoxA(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type); + + [LibraryImport("libc", SetLastError = true)] + private static partial int setenv([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string value, int overwrite); + + private const uint MbIconWarning = 0x30; + + static Program() + { + if (OperatingSystem.IsLinux()) + { + NativeLibrary.SetDllImportResolver(typeof(Program).Assembly, (name, assembly, path) => + { + if (name != X11LibraryName) + { + return IntPtr.Zero; + } + + if (!NativeLibrary.TryLoad("libX11.so.6", assembly, path, out IntPtr result)) + { + if (!NativeLibrary.TryLoad("libX11.so", assembly, path, out result)) + { + return IntPtr.Zero; + } + } + + return result; + }); + } + } + + static void Main(string[] args) + { + Version = ReleaseInformation.Version; + + if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134)) + { + MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconWarning); + } + + // Parse arguments + CommandLineState.ParseArguments(args); + + // Hook unhandled exception and process exit events. + GLib.ExceptionManager.UnhandledException += (GLib.UnhandledExceptionArgs e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); + AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); + AppDomain.CurrentDomain.ProcessExit += (object sender, EventArgs e) => Exit(); + + // Make process DPI aware for proper window sizing on high-res screens. + ForceDpiAware.Windows(); + WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); + + // Delete backup files after updating. + Task.Run(Updater.CleanupUpdate); + + Console.Title = $"Ryujinx Console {Version}"; + + // NOTE: GTK3 doesn't init X11 in a multi threaded way. + // This ends up causing race condition and abort of XCB when a context is created by SPB (even if SPB do call XInitThreads). + if (OperatingSystem.IsLinux()) + { + if (XInitThreads() == 0) + { + throw new NotSupportedException("Failed to initialize multi-threading support."); + } + + Environment.SetEnvironmentVariable("GDK_BACKEND", "x11"); + setenv("GDK_BACKEND", "x11", 1); + } + + if (OperatingSystem.IsMacOS()) + { + string baseDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); + string resourcesDataDir; + + if (Path.GetFileName(baseDirectory) == "MacOS") + { + resourcesDataDir = Path.Combine(Directory.GetParent(baseDirectory).FullName, "Resources"); + } + else + { + resourcesDataDir = baseDirectory; + } + + static void SetEnvironmentVariableNoCaching(string key, string value) + { + int res = setenv(key, value, 1); + Debug.Assert(res != -1); + } + + // On macOS, GTK3 needs XDG_DATA_DIRS to be set, otherwise it will try searching for "gschemas.compiled" in system directories. + SetEnvironmentVariableNoCaching("XDG_DATA_DIRS", Path.Combine(resourcesDataDir, "share")); + + // On macOS, GTK3 needs GDK_PIXBUF_MODULE_FILE to be set, otherwise it will try searching for "loaders.cache" in system directories. + SetEnvironmentVariableNoCaching("GDK_PIXBUF_MODULE_FILE", Path.Combine(resourcesDataDir, "lib", "gdk-pixbuf-2.0", "2.10.0", "loaders.cache")); + + SetEnvironmentVariableNoCaching("GTK_IM_MODULE_FILE", Path.Combine(resourcesDataDir, "lib", "gtk-3.0", "3.0.0", "immodules.cache")); + } + + string systemPath = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine); + Environment.SetEnvironmentVariable("Path", $"{Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin")};{systemPath}"); + + // Setup base data directory. + AppDataManager.Initialize(CommandLineState.BaseDirPathArg); + + // Initialize the configuration. + ConfigurationState.Initialize(); + + // Initialize the logger system. + LoggerModule.Initialize(); + + // Initialize Discord integration. + DiscordIntegrationModule.Initialize(); + + // Initialize SDL2 driver + SDL2Driver.MainThreadDispatcher = action => + { + Application.Invoke(delegate + { + action(); + }); + }; + + // Sets ImageSharp Jpeg Encoder Quality. + SixLabors.ImageSharp.Configuration.Default.ImageFormatsManager.SetEncoder(JpegFormat.Instance, new JpegEncoder() + { + Quality = 100, + }); + + string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.ConfigName); + string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.ConfigName); + + // Now load the configuration as the other subsystems are now registered + ConfigurationPath = File.Exists(localConfigurationPath) + ? localConfigurationPath + : File.Exists(appDataConfigurationPath) + ? appDataConfigurationPath + : null; + + if (ConfigurationPath == null) + { + // No configuration, we load the default values and save it to disk + ConfigurationPath = appDataConfigurationPath; + + ConfigurationState.Instance.LoadDefault(); + ConfigurationState.Instance.ToFileFormat().SaveConfig(ConfigurationPath); + } + else + { + if (ConfigurationFileFormat.TryLoad(ConfigurationPath, out ConfigurationFileFormat configurationFileFormat)) + { + ConfigurationState.Instance.Load(configurationFileFormat, ConfigurationPath); + } + else + { + ConfigurationState.Instance.LoadDefault(); + + Logger.Warning?.PrintMsg(LogClass.Application, $"Failed to load config! Loading the default config instead.\nFailed config location {ConfigurationPath}"); + } + } + + // Check if graphics backend was overridden. + if (CommandLineState.OverrideGraphicsBackend != null) + { + if (CommandLineState.OverrideGraphicsBackend.ToLower() == "opengl") + { + ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.OpenGl; + } + else if (CommandLineState.OverrideGraphicsBackend.ToLower() == "vulkan") + { + ConfigurationState.Instance.Graphics.GraphicsBackend.Value = GraphicsBackend.Vulkan; + } + } + + // Check if HideCursor was overridden. + if (CommandLineState.OverrideHideCursor is not null) + { + ConfigurationState.Instance.HideCursor.Value = CommandLineState.OverrideHideCursor!.ToLower() switch + { + "never" => HideCursorMode.Never, + "onidle" => HideCursorMode.OnIdle, + "always" => HideCursorMode.Always, + _ => ConfigurationState.Instance.HideCursor.Value, + }; + } + + // Check if docked mode was overridden. + if (CommandLineState.OverrideDockedMode.HasValue) + { + ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value; + } + + // Logging system information. + PrintSystemInfo(); + + // Enable OGL multithreading on the driver, when available. + BackendThreading threadingMode = ConfigurationState.Instance.Graphics.BackendThreading; + DriverUtilities.ToggleOGLThreading(threadingMode == BackendThreading.Off); + + // Initialize Gtk. + Application.Init(); + + // Check if keys exists. + bool hasSystemProdKeys = File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys")); + bool hasCommonProdKeys = AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys")); + if (!hasSystemProdKeys && !hasCommonProdKeys) + { + UserErrorDialog.CreateUserErrorDialog(UserError.NoKeys); + } + + // Show the main window UI. + MainWindow mainWindow = new(); + mainWindow.Show(); + + if (OperatingSystem.IsLinux()) + { + int currentVmMaxMapCount = LinuxHelper.VmMaxMapCount; + + if (LinuxHelper.VmMaxMapCount < LinuxHelper.RecommendedVmMaxMapCount) + { + Logger.Warning?.Print(LogClass.Application, $"The value of vm.max_map_count is lower than {LinuxHelper.RecommendedVmMaxMapCount}. ({currentVmMaxMapCount})"); + + if (LinuxHelper.PkExecPath is not null) + { + var buttonTexts = new Dictionary() + { + { 0, "Yes, until the next restart" }, + { 1, "Yes, permanently" }, + { 2, "No" }, + }; + + ResponseType response = GtkDialog.CreateCustomDialog( + "Ryujinx - Low limit for memory mappings detected", + $"Would you like to increase the value of vm.max_map_count to {LinuxHelper.RecommendedVmMaxMapCount}?", + "Some games might try to create more memory mappings than currently allowed. " + + "Ryujinx will crash as soon as this limit gets exceeded.", + buttonTexts, + MessageType.Question); + + int rc; + + switch ((int)response) + { + case 0: + rc = LinuxHelper.RunPkExec($"echo {LinuxHelper.RecommendedVmMaxMapCount} > {LinuxHelper.VmMaxMapCountPath}"); + if (rc == 0) + { + Logger.Info?.Print(LogClass.Application, $"vm.max_map_count set to {LinuxHelper.VmMaxMapCount} until the next restart."); + } + else + { + Logger.Error?.Print(LogClass.Application, $"Unable to change vm.max_map_count. Process exited with code: {rc}"); + } + break; + case 1: + rc = LinuxHelper.RunPkExec($"echo \"vm.max_map_count = {LinuxHelper.RecommendedVmMaxMapCount}\" > {LinuxHelper.SysCtlConfigPath} && sysctl -p {LinuxHelper.SysCtlConfigPath}"); + if (rc == 0) + { + Logger.Info?.Print(LogClass.Application, $"vm.max_map_count set to {LinuxHelper.VmMaxMapCount}. Written to config: {LinuxHelper.SysCtlConfigPath}"); + } + else + { + Logger.Error?.Print(LogClass.Application, $"Unable to write new value for vm.max_map_count to config. Process exited with code: {rc}"); + } + break; + } + } + else + { + GtkDialog.CreateWarningDialog( + "Max amount of memory mappings is lower than recommended.", + $"The current value of vm.max_map_count ({currentVmMaxMapCount}) is lower than {LinuxHelper.RecommendedVmMaxMapCount}." + + "Some games might try to create more memory mappings than currently allowed. " + + "Ryujinx will crash as soon as this limit gets exceeded.\n\n" + + "You might want to either manually increase the limit or install pkexec, which allows Ryujinx to assist with that."); + } + } + } + + if (CommandLineState.LaunchPathArg != null) + { + mainWindow.RunApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg); + } + + if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false)) + { + Updater.BeginParse(mainWindow, false).ContinueWith(task => + { + Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}"); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + Application.Run(); + } + + private static void PrintSystemInfo() + { + Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}"); + SystemInfo.Gather().Print(); + + var enabledLogs = Logger.GetEnabledLevels(); + Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogs.Count == 0 ? "" : string.Join(", ", enabledLogs))}"); + + if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom) + { + Logger.Notice.Print(LogClass.Application, $"Launch Mode: Custom Path {AppDataManager.BaseDirPath}"); + } + else + { + Logger.Notice.Print(LogClass.Application, $"Launch Mode: {AppDataManager.Mode}"); + } + } + + private static void ProcessUnhandledException(Exception ex, bool isTerminating) + { + string message = $"Unhandled exception caught: {ex}"; + + Logger.Error?.PrintMsg(LogClass.Application, message); + + if (Logger.Error == null) + { + Logger.Notice.PrintMsg(LogClass.Application, message); + } + + if (isTerminating) + { + Exit(); + } + } + + public static void Exit() + { + DiscordIntegrationModule.Exit(); + + Logger.Shutdown(); + } + } +} diff --git a/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj b/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj new file mode 100644 index 000000000..68bf98981 --- /dev/null +++ b/src/Ryujinx.Gtk3/Ryujinx.Gtk3.csproj @@ -0,0 +1,104 @@ + + + + net8.0 + win-x64;osx-x64;linux-x64 + Exe + true + 1.0.0-dirty + $(DefineConstants);$(ExtraDefineConstants) + + true + true + + + + true + false + true + partial + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Always + alsoft.ini + + + Always + THIRDPARTY.md + + + Always + LICENSE.txt + + + + + + Always + + + Always + mime\Ryujinx.xml + + + + + + false + Ryujinx.ico + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ryujinx.Ava/Ryujinx.ico b/src/Ryujinx.Gtk3/Ryujinx.ico similarity index 100% rename from src/Ryujinx.Ava/Ryujinx.ico rename to src/Ryujinx.Gtk3/Ryujinx.ico diff --git a/src/Ryujinx/UI/Applet/ErrorAppletDialog.cs b/src/Ryujinx.Gtk3/UI/Applet/ErrorAppletDialog.cs similarity index 91% rename from src/Ryujinx/UI/Applet/ErrorAppletDialog.cs rename to src/Ryujinx.Gtk3/UI/Applet/ErrorAppletDialog.cs index 7f8cc0e95..cb8103cae 100644 --- a/src/Ryujinx/UI/Applet/ErrorAppletDialog.cs +++ b/src/Ryujinx.Gtk3/UI/Applet/ErrorAppletDialog.cs @@ -8,7 +8,7 @@ namespace Ryujinx.UI.Applet { public ErrorAppletDialog(Window parentWindow, DialogFlags dialogFlags, MessageType messageType, string[] buttons) : base(parentWindow, dialogFlags, messageType, ButtonsType.None, null) { - Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.UI.Common.Resources.Logo_Ryujinx.png"); + Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Gtk3.UI.Common.Resources.Logo_Ryujinx.png"); int responseId = 0; diff --git a/src/Ryujinx/UI/Applet/GtkDynamicTextInputHandler.cs b/src/Ryujinx.Gtk3/UI/Applet/GtkDynamicTextInputHandler.cs similarity index 100% rename from src/Ryujinx/UI/Applet/GtkDynamicTextInputHandler.cs rename to src/Ryujinx.Gtk3/UI/Applet/GtkDynamicTextInputHandler.cs diff --git a/src/Ryujinx/UI/Applet/GtkHostUIHandler.cs b/src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs similarity index 100% rename from src/Ryujinx/UI/Applet/GtkHostUIHandler.cs rename to src/Ryujinx.Gtk3/UI/Applet/GtkHostUIHandler.cs diff --git a/src/Ryujinx/UI/Applet/GtkHostUITheme.cs b/src/Ryujinx.Gtk3/UI/Applet/GtkHostUITheme.cs similarity index 100% rename from src/Ryujinx/UI/Applet/GtkHostUITheme.cs rename to src/Ryujinx.Gtk3/UI/Applet/GtkHostUITheme.cs diff --git a/src/Ryujinx/UI/Applet/SwkbdAppletDialog.cs b/src/Ryujinx.Gtk3/UI/Applet/SwkbdAppletDialog.cs similarity index 100% rename from src/Ryujinx/UI/Applet/SwkbdAppletDialog.cs rename to src/Ryujinx.Gtk3/UI/Applet/SwkbdAppletDialog.cs diff --git a/src/Ryujinx/UI/Helper/MetalHelper.cs b/src/Ryujinx.Gtk3/UI/Helper/MetalHelper.cs similarity index 100% rename from src/Ryujinx/UI/Helper/MetalHelper.cs rename to src/Ryujinx.Gtk3/UI/Helper/MetalHelper.cs diff --git a/src/Ryujinx/UI/Helper/SortHelper.cs b/src/Ryujinx.Gtk3/UI/Helper/SortHelper.cs similarity index 100% rename from src/Ryujinx/UI/Helper/SortHelper.cs rename to src/Ryujinx.Gtk3/UI/Helper/SortHelper.cs diff --git a/src/Ryujinx/UI/Helper/ThemeHelper.cs b/src/Ryujinx.Gtk3/UI/Helper/ThemeHelper.cs similarity index 100% rename from src/Ryujinx/UI/Helper/ThemeHelper.cs rename to src/Ryujinx.Gtk3/UI/Helper/ThemeHelper.cs diff --git a/src/Ryujinx/UI/MainWindow.cs b/src/Ryujinx.Gtk3/UI/MainWindow.cs similarity index 99% rename from src/Ryujinx/UI/MainWindow.cs rename to src/Ryujinx.Gtk3/UI/MainWindow.cs index 2908f1a8d..d1ca6ce6a 100644 --- a/src/Ryujinx/UI/MainWindow.cs +++ b/src/Ryujinx.Gtk3/UI/MainWindow.cs @@ -143,7 +143,7 @@ namespace Ryujinx.UI #pragma warning restore CS0649, IDE0044, CS0169, IDE0051 - public MainWindow() : this(new Builder("Ryujinx.UI.MainWindow.glade")) { } + public MainWindow() : this(new Builder("Ryujinx.Gtk3.UI.MainWindow.glade")) { } private MainWindow(Builder builder) : base(builder.GetRawOwnedObject("_mainWin")) { diff --git a/src/Ryujinx/UI/MainWindow.glade b/src/Ryujinx.Gtk3/UI/MainWindow.glade similarity index 100% rename from src/Ryujinx/UI/MainWindow.glade rename to src/Ryujinx.Gtk3/UI/MainWindow.glade diff --git a/src/Ryujinx/UI/OpenGLRenderer.cs b/src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs similarity index 100% rename from src/Ryujinx/UI/OpenGLRenderer.cs rename to src/Ryujinx.Gtk3/UI/OpenGLRenderer.cs diff --git a/src/Ryujinx/UI/OpenToolkitBindingsContext.cs b/src/Ryujinx.Gtk3/UI/OpenToolkitBindingsContext.cs similarity index 100% rename from src/Ryujinx/UI/OpenToolkitBindingsContext.cs rename to src/Ryujinx.Gtk3/UI/OpenToolkitBindingsContext.cs diff --git a/src/Ryujinx/UI/RendererWidgetBase.cs b/src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs similarity index 100% rename from src/Ryujinx/UI/RendererWidgetBase.cs rename to src/Ryujinx.Gtk3/UI/RendererWidgetBase.cs diff --git a/src/Ryujinx/UI/SPBOpenGLContext.cs b/src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs similarity index 100% rename from src/Ryujinx/UI/SPBOpenGLContext.cs rename to src/Ryujinx.Gtk3/UI/SPBOpenGLContext.cs diff --git a/src/Ryujinx/UI/StatusUpdatedEventArgs.cs b/src/Ryujinx.Gtk3/UI/StatusUpdatedEventArgs.cs similarity index 100% rename from src/Ryujinx/UI/StatusUpdatedEventArgs.cs rename to src/Ryujinx.Gtk3/UI/StatusUpdatedEventArgs.cs diff --git a/src/Ryujinx/UI/VulkanRenderer.cs b/src/Ryujinx.Gtk3/UI/VulkanRenderer.cs similarity index 100% rename from src/Ryujinx/UI/VulkanRenderer.cs rename to src/Ryujinx.Gtk3/UI/VulkanRenderer.cs diff --git a/src/Ryujinx/UI/Widgets/GameTableContextMenu.Designer.cs b/src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.Designer.cs similarity index 100% rename from src/Ryujinx/UI/Widgets/GameTableContextMenu.Designer.cs rename to src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.Designer.cs diff --git a/src/Ryujinx/UI/Widgets/GameTableContextMenu.cs b/src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.cs similarity index 99% rename from src/Ryujinx/UI/Widgets/GameTableContextMenu.cs rename to src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.cs index dc0dd4c50..c8236223a 100644 --- a/src/Ryujinx/UI/Widgets/GameTableContextMenu.cs +++ b/src/Ryujinx.Gtk3/UI/Widgets/GameTableContextMenu.cs @@ -189,7 +189,7 @@ namespace Ryujinx.UI.Widgets _dialog = new MessageDialog(null, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Cancel, null) { Title = "Ryujinx - NCA Section Extractor", - Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.UI.Common.Resources.Logo_Ryujinx.png"), + Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Gtk3.UI.Common.Resources.Logo_Ryujinx.png"), SecondaryText = $"Extracting {ncaSectionType} section from {System.IO.Path.GetFileName(_titleFilePath)}...", WindowPosition = WindowPosition.Center, }; diff --git a/src/Ryujinx/UI/Widgets/GtkDialog.cs b/src/Ryujinx.Gtk3/UI/Widgets/GtkDialog.cs similarity index 100% rename from src/Ryujinx/UI/Widgets/GtkDialog.cs rename to src/Ryujinx.Gtk3/UI/Widgets/GtkDialog.cs diff --git a/src/Ryujinx/UI/Widgets/GtkInputDialog.cs b/src/Ryujinx.Gtk3/UI/Widgets/GtkInputDialog.cs similarity index 100% rename from src/Ryujinx/UI/Widgets/GtkInputDialog.cs rename to src/Ryujinx.Gtk3/UI/Widgets/GtkInputDialog.cs diff --git a/src/Ryujinx/UI/Widgets/ProfileDialog.cs b/src/Ryujinx.Gtk3/UI/Widgets/ProfileDialog.cs similarity index 94% rename from src/Ryujinx/UI/Widgets/ProfileDialog.cs rename to src/Ryujinx.Gtk3/UI/Widgets/ProfileDialog.cs index f8aa6345f..3b3e2fbbe 100644 --- a/src/Ryujinx/UI/Widgets/ProfileDialog.cs +++ b/src/Ryujinx.Gtk3/UI/Widgets/ProfileDialog.cs @@ -15,7 +15,7 @@ namespace Ryujinx.UI.Widgets [GUI] Label _errorMessage; #pragma warning restore CS0649, IDE0044 - public ProfileDialog() : this(new Builder("Ryujinx.UI.Widgets.ProfileDialog.glade")) { } + public ProfileDialog() : this(new Builder("Ryujinx.Gtk3.UI.Widgets.ProfileDialog.glade")) { } private ProfileDialog(Builder builder) : base(builder.GetRawOwnedObject("_profileDialog")) { diff --git a/src/Ryujinx/UI/Widgets/ProfileDialog.glade b/src/Ryujinx.Gtk3/UI/Widgets/ProfileDialog.glade similarity index 100% rename from src/Ryujinx/UI/Widgets/ProfileDialog.glade rename to src/Ryujinx.Gtk3/UI/Widgets/ProfileDialog.glade diff --git a/src/Ryujinx/UI/Widgets/RawInputToTextEntry.cs b/src/Ryujinx.Gtk3/UI/Widgets/RawInputToTextEntry.cs similarity index 100% rename from src/Ryujinx/UI/Widgets/RawInputToTextEntry.cs rename to src/Ryujinx.Gtk3/UI/Widgets/RawInputToTextEntry.cs diff --git a/src/Ryujinx/UI/Widgets/UserErrorDialog.cs b/src/Ryujinx.Gtk3/UI/Widgets/UserErrorDialog.cs similarity index 100% rename from src/Ryujinx/UI/Widgets/UserErrorDialog.cs rename to src/Ryujinx.Gtk3/UI/Widgets/UserErrorDialog.cs diff --git a/src/Ryujinx/UI/Windows/AboutWindow.Designer.cs b/src/Ryujinx.Gtk3/UI/Windows/AboutWindow.Designer.cs similarity index 100% rename from src/Ryujinx/UI/Windows/AboutWindow.Designer.cs rename to src/Ryujinx.Gtk3/UI/Windows/AboutWindow.Designer.cs diff --git a/src/Ryujinx/UI/Windows/AboutWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/AboutWindow.cs similarity index 100% rename from src/Ryujinx/UI/Windows/AboutWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/AboutWindow.cs diff --git a/src/Ryujinx/UI/Windows/AmiiboWindow.Designer.cs b/src/Ryujinx.Gtk3/UI/Windows/AmiiboWindow.Designer.cs similarity index 100% rename from src/Ryujinx/UI/Windows/AmiiboWindow.Designer.cs rename to src/Ryujinx.Gtk3/UI/Windows/AmiiboWindow.Designer.cs diff --git a/src/Ryujinx/UI/Windows/AmiiboWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/AmiiboWindow.cs similarity index 100% rename from src/Ryujinx/UI/Windows/AmiiboWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/AmiiboWindow.cs diff --git a/src/Ryujinx/UI/Windows/AvatarWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/AvatarWindow.cs similarity index 100% rename from src/Ryujinx/UI/Windows/AvatarWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/AvatarWindow.cs diff --git a/src/Ryujinx/UI/Windows/CheatWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/CheatWindow.cs similarity index 98% rename from src/Ryujinx/UI/Windows/CheatWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/CheatWindow.cs index 73ee870cd..96ed0723e 100644 --- a/src/Ryujinx/UI/Windows/CheatWindow.cs +++ b/src/Ryujinx.Gtk3/UI/Windows/CheatWindow.cs @@ -22,7 +22,7 @@ namespace Ryujinx.UI.Windows [GUI] Button _saveButton; #pragma warning restore CS0649, IDE0044 - public CheatWindow(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName, string titlePath) : this(new Builder("Ryujinx.UI.Windows.CheatWindow.glade"), virtualFileSystem, titleId, titleName, titlePath) { } + public CheatWindow(VirtualFileSystem virtualFileSystem, ulong titleId, string titleName, string titlePath) : this(new Builder("Ryujinx.Gtk3.UI.Windows.CheatWindow.glade"), virtualFileSystem, titleId, titleName, titlePath) { } private CheatWindow(Builder builder, VirtualFileSystem virtualFileSystem, ulong titleId, string titleName, string titlePath) : base(builder.GetRawOwnedObject("_cheatWindow")) { diff --git a/src/Ryujinx/UI/Windows/CheatWindow.glade b/src/Ryujinx.Gtk3/UI/Windows/CheatWindow.glade similarity index 100% rename from src/Ryujinx/UI/Windows/CheatWindow.glade rename to src/Ryujinx.Gtk3/UI/Windows/CheatWindow.glade diff --git a/src/Ryujinx/UI/Windows/ControllerWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/ControllerWindow.cs similarity index 99% rename from src/Ryujinx/UI/Windows/ControllerWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/ControllerWindow.cs index 954113443..6712657f8 100644 --- a/src/Ryujinx/UI/Windows/ControllerWindow.cs +++ b/src/Ryujinx.Gtk3/UI/Windows/ControllerWindow.cs @@ -117,7 +117,7 @@ namespace Ryujinx.UI.Windows private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); - public ControllerWindow(MainWindow mainWindow, PlayerIndex controllerId) : this(mainWindow, new Builder("Ryujinx.UI.Windows.ControllerWindow.glade"), controllerId) { } + public ControllerWindow(MainWindow mainWindow, PlayerIndex controllerId) : this(mainWindow, new Builder("Ryujinx.Gtk3.UI.Windows.ControllerWindow.glade"), controllerId) { } private ControllerWindow(MainWindow mainWindow, Builder builder, PlayerIndex controllerId) : base(builder.GetRawOwnedObject("_controllerWin")) { diff --git a/src/Ryujinx/UI/Windows/ControllerWindow.glade b/src/Ryujinx.Gtk3/UI/Windows/ControllerWindow.glade similarity index 100% rename from src/Ryujinx/UI/Windows/ControllerWindow.glade rename to src/Ryujinx.Gtk3/UI/Windows/ControllerWindow.glade diff --git a/src/Ryujinx/UI/Windows/DlcWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/DlcWindow.cs similarity index 98% rename from src/Ryujinx/UI/Windows/DlcWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/DlcWindow.cs index aed1a015d..388f11089 100644 --- a/src/Ryujinx/UI/Windows/DlcWindow.cs +++ b/src/Ryujinx.Gtk3/UI/Windows/DlcWindow.cs @@ -32,7 +32,7 @@ namespace Ryujinx.UI.Windows [GUI] TreeSelection _dlcTreeSelection; #pragma warning restore CS0649, IDE0044 - public DlcWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName) : this(new Builder("Ryujinx.UI.Windows.DlcWindow.glade"), virtualFileSystem, titleId, titleName) { } + public DlcWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName) : this(new Builder("Ryujinx.Gtk3.UI.Windows.DlcWindow.glade"), virtualFileSystem, titleId, titleName) { } private DlcWindow(Builder builder, VirtualFileSystem virtualFileSystem, string titleId, string titleName) : base(builder.GetRawOwnedObject("_dlcWindow")) { diff --git a/src/Ryujinx/UI/Windows/DlcWindow.glade b/src/Ryujinx.Gtk3/UI/Windows/DlcWindow.glade similarity index 100% rename from src/Ryujinx/UI/Windows/DlcWindow.glade rename to src/Ryujinx.Gtk3/UI/Windows/DlcWindow.glade diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/SettingsWindow.cs similarity index 99% rename from src/Ryujinx/UI/Windows/SettingsWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/SettingsWindow.cs index 270a8ad4a..dc467c0f2 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.cs +++ b/src/Ryujinx.Gtk3/UI/Windows/SettingsWindow.cs @@ -120,7 +120,7 @@ namespace Ryujinx.UI.Windows #pragma warning restore CS0649, IDE0044 - public SettingsWindow(MainWindow parent, VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this(parent, new Builder("Ryujinx.UI.Windows.SettingsWindow.glade"), virtualFileSystem, contentManager) { } + public SettingsWindow(MainWindow parent, VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this(parent, new Builder("Ryujinx.Gtk3.UI.Windows.SettingsWindow.glade"), virtualFileSystem, contentManager) { } private SettingsWindow(MainWindow parent, Builder builder, VirtualFileSystem virtualFileSystem, ContentManager contentManager) : base(builder.GetRawOwnedObject("_settingsWin")) { diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.glade b/src/Ryujinx.Gtk3/UI/Windows/SettingsWindow.glade similarity index 100% rename from src/Ryujinx/UI/Windows/SettingsWindow.glade rename to src/Ryujinx.Gtk3/UI/Windows/SettingsWindow.glade diff --git a/src/Ryujinx/UI/Windows/TitleUpdateWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.cs similarity index 98% rename from src/Ryujinx/UI/Windows/TitleUpdateWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.cs index 1df929336..74b2330ee 100644 --- a/src/Ryujinx/UI/Windows/TitleUpdateWindow.cs +++ b/src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.cs @@ -38,7 +38,7 @@ namespace Ryujinx.UI.Windows [GUI] RadioButton _noUpdateRadioButton; #pragma warning restore CS0649, IDE0044 - public TitleUpdateWindow(MainWindow parent, VirtualFileSystem virtualFileSystem, string titleId, string titleName) : this(new Builder("Ryujinx.UI.Windows.TitleUpdateWindow.glade"), parent, virtualFileSystem, titleId, titleName) { } + public TitleUpdateWindow(MainWindow parent, VirtualFileSystem virtualFileSystem, string titleId, string titleName) : this(new Builder("Ryujinx.Gtk3.UI.Windows.TitleUpdateWindow.glade"), parent, virtualFileSystem, titleId, titleName) { } private TitleUpdateWindow(Builder builder, MainWindow parent, VirtualFileSystem virtualFileSystem, string titleId, string titleName) : base(builder.GetRawOwnedObject("_titleUpdateWindow")) { diff --git a/src/Ryujinx/UI/Windows/TitleUpdateWindow.glade b/src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.glade similarity index 100% rename from src/Ryujinx/UI/Windows/TitleUpdateWindow.glade rename to src/Ryujinx.Gtk3/UI/Windows/TitleUpdateWindow.glade diff --git a/src/Ryujinx/UI/Windows/UserProfilesManagerWindow.Designer.cs b/src/Ryujinx.Gtk3/UI/Windows/UserProfilesManagerWindow.Designer.cs similarity index 100% rename from src/Ryujinx/UI/Windows/UserProfilesManagerWindow.Designer.cs rename to src/Ryujinx.Gtk3/UI/Windows/UserProfilesManagerWindow.Designer.cs diff --git a/src/Ryujinx/UI/Windows/UserProfilesManagerWindow.cs b/src/Ryujinx.Gtk3/UI/Windows/UserProfilesManagerWindow.cs similarity index 100% rename from src/Ryujinx/UI/Windows/UserProfilesManagerWindow.cs rename to src/Ryujinx.Gtk3/UI/Windows/UserProfilesManagerWindow.cs diff --git a/src/Ryujinx.Ava/App.axaml b/src/Ryujinx/App.axaml similarity index 100% rename from src/Ryujinx.Ava/App.axaml rename to src/Ryujinx/App.axaml diff --git a/src/Ryujinx.Ava/App.axaml.cs b/src/Ryujinx/App.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/App.axaml.cs rename to src/Ryujinx/App.axaml.cs diff --git a/src/Ryujinx.Ava/AppHost.cs b/src/Ryujinx/AppHost.cs similarity index 100% rename from src/Ryujinx.Ava/AppHost.cs rename to src/Ryujinx/AppHost.cs diff --git a/src/Ryujinx.Ava/Assets/Fonts/SegoeFluentIcons.ttf b/src/Ryujinx/Assets/Fonts/SegoeFluentIcons.ttf similarity index 100% rename from src/Ryujinx.Ava/Assets/Fonts/SegoeFluentIcons.ttf rename to src/Ryujinx/Assets/Fonts/SegoeFluentIcons.ttf diff --git a/src/Ryujinx.Ava/Assets/Icons/Controller_JoyConLeft.svg b/src/Ryujinx/Assets/Icons/Controller_JoyConLeft.svg similarity index 100% rename from src/Ryujinx.Ava/Assets/Icons/Controller_JoyConLeft.svg rename to src/Ryujinx/Assets/Icons/Controller_JoyConLeft.svg diff --git a/src/Ryujinx.Ava/Assets/Icons/Controller_JoyConPair.svg b/src/Ryujinx/Assets/Icons/Controller_JoyConPair.svg similarity index 100% rename from src/Ryujinx.Ava/Assets/Icons/Controller_JoyConPair.svg rename to src/Ryujinx/Assets/Icons/Controller_JoyConPair.svg diff --git a/src/Ryujinx.Ava/Assets/Icons/Controller_JoyConRight.svg b/src/Ryujinx/Assets/Icons/Controller_JoyConRight.svg similarity index 100% rename from src/Ryujinx.Ava/Assets/Icons/Controller_JoyConRight.svg rename to src/Ryujinx/Assets/Icons/Controller_JoyConRight.svg diff --git a/src/Ryujinx.Ava/Assets/Icons/Controller_ProCon.svg b/src/Ryujinx/Assets/Icons/Controller_ProCon.svg similarity index 100% rename from src/Ryujinx.Ava/Assets/Icons/Controller_ProCon.svg rename to src/Ryujinx/Assets/Icons/Controller_ProCon.svg diff --git a/src/Ryujinx.Ava/Assets/Locales/de_DE.json b/src/Ryujinx/Assets/Locales/de_DE.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/de_DE.json rename to src/Ryujinx/Assets/Locales/de_DE.json diff --git a/src/Ryujinx.Ava/Assets/Locales/el_GR.json b/src/Ryujinx/Assets/Locales/el_GR.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/el_GR.json rename to src/Ryujinx/Assets/Locales/el_GR.json diff --git a/src/Ryujinx.Ava/Assets/Locales/en_US.json b/src/Ryujinx/Assets/Locales/en_US.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/en_US.json rename to src/Ryujinx/Assets/Locales/en_US.json diff --git a/src/Ryujinx.Ava/Assets/Locales/es_ES.json b/src/Ryujinx/Assets/Locales/es_ES.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/es_ES.json rename to src/Ryujinx/Assets/Locales/es_ES.json diff --git a/src/Ryujinx.Ava/Assets/Locales/fr_FR.json b/src/Ryujinx/Assets/Locales/fr_FR.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/fr_FR.json rename to src/Ryujinx/Assets/Locales/fr_FR.json diff --git a/src/Ryujinx.Ava/Assets/Locales/he_IL.json b/src/Ryujinx/Assets/Locales/he_IL.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/he_IL.json rename to src/Ryujinx/Assets/Locales/he_IL.json diff --git a/src/Ryujinx.Ava/Assets/Locales/it_IT.json b/src/Ryujinx/Assets/Locales/it_IT.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/it_IT.json rename to src/Ryujinx/Assets/Locales/it_IT.json diff --git a/src/Ryujinx.Ava/Assets/Locales/ja_JP.json b/src/Ryujinx/Assets/Locales/ja_JP.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/ja_JP.json rename to src/Ryujinx/Assets/Locales/ja_JP.json diff --git a/src/Ryujinx.Ava/Assets/Locales/ko_KR.json b/src/Ryujinx/Assets/Locales/ko_KR.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/ko_KR.json rename to src/Ryujinx/Assets/Locales/ko_KR.json diff --git a/src/Ryujinx.Ava/Assets/Locales/pl_PL.json b/src/Ryujinx/Assets/Locales/pl_PL.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/pl_PL.json rename to src/Ryujinx/Assets/Locales/pl_PL.json diff --git a/src/Ryujinx.Ava/Assets/Locales/pt_BR.json b/src/Ryujinx/Assets/Locales/pt_BR.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/pt_BR.json rename to src/Ryujinx/Assets/Locales/pt_BR.json diff --git a/src/Ryujinx.Ava/Assets/Locales/ru_RU.json b/src/Ryujinx/Assets/Locales/ru_RU.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/ru_RU.json rename to src/Ryujinx/Assets/Locales/ru_RU.json diff --git a/src/Ryujinx.Ava/Assets/Locales/tr_TR.json b/src/Ryujinx/Assets/Locales/tr_TR.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/tr_TR.json rename to src/Ryujinx/Assets/Locales/tr_TR.json diff --git a/src/Ryujinx.Ava/Assets/Locales/uk_UA.json b/src/Ryujinx/Assets/Locales/uk_UA.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/uk_UA.json rename to src/Ryujinx/Assets/Locales/uk_UA.json diff --git a/src/Ryujinx.Ava/Assets/Locales/zh_CN.json b/src/Ryujinx/Assets/Locales/zh_CN.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/zh_CN.json rename to src/Ryujinx/Assets/Locales/zh_CN.json diff --git a/src/Ryujinx.Ava/Assets/Locales/zh_TW.json b/src/Ryujinx/Assets/Locales/zh_TW.json similarity index 100% rename from src/Ryujinx.Ava/Assets/Locales/zh_TW.json rename to src/Ryujinx/Assets/Locales/zh_TW.json diff --git a/src/Ryujinx.Ava/Assets/Styles/Styles.xaml b/src/Ryujinx/Assets/Styles/Styles.xaml similarity index 100% rename from src/Ryujinx.Ava/Assets/Styles/Styles.xaml rename to src/Ryujinx/Assets/Styles/Styles.xaml diff --git a/src/Ryujinx.Ava/Assets/Styles/Themes.xaml b/src/Ryujinx/Assets/Styles/Themes.xaml similarity index 100% rename from src/Ryujinx.Ava/Assets/Styles/Themes.xaml rename to src/Ryujinx/Assets/Styles/Themes.xaml diff --git a/src/Ryujinx.Ava/Common/ApplicationHelper.cs b/src/Ryujinx/Common/ApplicationHelper.cs similarity index 100% rename from src/Ryujinx.Ava/Common/ApplicationHelper.cs rename to src/Ryujinx/Common/ApplicationHelper.cs diff --git a/src/Ryujinx.Ava/Common/ApplicationSort.cs b/src/Ryujinx/Common/ApplicationSort.cs similarity index 100% rename from src/Ryujinx.Ava/Common/ApplicationSort.cs rename to src/Ryujinx/Common/ApplicationSort.cs diff --git a/src/Ryujinx.Ava/Common/KeyboardHotkeyState.cs b/src/Ryujinx/Common/KeyboardHotkeyState.cs similarity index 100% rename from src/Ryujinx.Ava/Common/KeyboardHotkeyState.cs rename to src/Ryujinx/Common/KeyboardHotkeyState.cs diff --git a/src/Ryujinx.Ava/Common/Locale/LocaleExtension.cs b/src/Ryujinx/Common/Locale/LocaleExtension.cs similarity index 100% rename from src/Ryujinx.Ava/Common/Locale/LocaleExtension.cs rename to src/Ryujinx/Common/Locale/LocaleExtension.cs diff --git a/src/Ryujinx.Ava/Common/Locale/LocaleManager.cs b/src/Ryujinx/Common/Locale/LocaleManager.cs similarity index 99% rename from src/Ryujinx.Ava/Common/Locale/LocaleManager.cs rename to src/Ryujinx/Common/Locale/LocaleManager.cs index b2f3e7ab9..e973fcc06 100644 --- a/src/Ryujinx.Ava/Common/Locale/LocaleManager.cs +++ b/src/Ryujinx/Common/Locale/LocaleManager.cs @@ -143,7 +143,7 @@ namespace Ryujinx.Ava.Common.Locale private static Dictionary LoadJsonLanguage(string languageCode = DefaultLanguageCode) { var localeStrings = new Dictionary(); - string languageJson = EmbeddedResources.ReadAllText($"Ryujinx.Ava/Assets/Locales/{languageCode}.json"); + string languageJson = EmbeddedResources.ReadAllText($"Ryujinx/Assets/Locales/{languageCode}.json"); var strings = JsonHelper.Deserialize(languageJson, CommonJsonContext.Default.StringDictionary); foreach (var item in strings) diff --git a/src/Ryujinx.Ava/Input/AvaloniaKeyboard.cs b/src/Ryujinx/Input/AvaloniaKeyboard.cs similarity index 100% rename from src/Ryujinx.Ava/Input/AvaloniaKeyboard.cs rename to src/Ryujinx/Input/AvaloniaKeyboard.cs diff --git a/src/Ryujinx.Ava/Input/AvaloniaKeyboardDriver.cs b/src/Ryujinx/Input/AvaloniaKeyboardDriver.cs similarity index 100% rename from src/Ryujinx.Ava/Input/AvaloniaKeyboardDriver.cs rename to src/Ryujinx/Input/AvaloniaKeyboardDriver.cs diff --git a/src/Ryujinx.Ava/Input/AvaloniaKeyboardMappingHelper.cs b/src/Ryujinx/Input/AvaloniaKeyboardMappingHelper.cs similarity index 100% rename from src/Ryujinx.Ava/Input/AvaloniaKeyboardMappingHelper.cs rename to src/Ryujinx/Input/AvaloniaKeyboardMappingHelper.cs diff --git a/src/Ryujinx.Ava/Input/AvaloniaMouse.cs b/src/Ryujinx/Input/AvaloniaMouse.cs similarity index 100% rename from src/Ryujinx.Ava/Input/AvaloniaMouse.cs rename to src/Ryujinx/Input/AvaloniaMouse.cs diff --git a/src/Ryujinx.Ava/Input/AvaloniaMouseDriver.cs b/src/Ryujinx/Input/AvaloniaMouseDriver.cs similarity index 100% rename from src/Ryujinx.Ava/Input/AvaloniaMouseDriver.cs rename to src/Ryujinx/Input/AvaloniaMouseDriver.cs diff --git a/src/Ryujinx/Modules/Updater/Updater.cs b/src/Ryujinx/Modules/Updater/Updater.cs index 6c0f9ccea..d8346c8eb 100644 --- a/src/Ryujinx/Modules/Updater/Updater.cs +++ b/src/Ryujinx/Modules/Updater/Updater.cs @@ -1,93 +1,75 @@ -using Gtk; +using Avalonia.Controls; +using Avalonia.Threading; +using FluentAvalonia.UI.Controls; using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Zip; +using Ryujinx.Ava; +using Ryujinx.Ava.Common.Locale; +using Ryujinx.Ava.UI.Helpers; using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.Common.Utilities; -using Ryujinx.UI; +using Ryujinx.UI.Common.Helper; using Ryujinx.UI.Common.Models.Github; -using Ryujinx.UI.Widgets; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.NetworkInformation; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Ryujinx.Modules { - public static class Updater + internal static class Updater { private const string GitHubApiUrl = "https://api.github.com"; - private const int ConnectionCount = 4; - - internal static bool Running; + private static readonly GithubReleasesJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); private static readonly string _homeDir = AppDomain.CurrentDomain.BaseDirectory; private static readonly string _updateDir = Path.Combine(Path.GetTempPath(), "Ryujinx", "update"); private static readonly string _updatePublishDir = Path.Combine(_updateDir, "publish"); + private const int ConnectionCount = 4; private static string _buildVer; private static string _platformExt; private static string _buildUrl; private static long _buildSize; + private static bool _updateSuccessful; + private static bool _running; - private static readonly GithubReleasesJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); + private static readonly string[] _windowsDependencyDirs = Array.Empty(); - // On Windows, GtkSharp.Dependencies adds these extra dirs that must be cleaned during updates. - private static readonly string[] _windowsDependencyDirs = { "bin", "etc", "lib", "share" }; - - private static HttpClient ConstructHttpClient() + public static async Task BeginParse(Window mainWindow, bool showVersionUpToDate) { - HttpClient result = new(); - - // Required by GitHub to interact with APIs. - result.DefaultRequestHeaders.Add("User-Agent", "Ryujinx-Updater/1.0.0"); - - return result; - } - - public static async Task BeginParse(MainWindow mainWindow, bool showVersionUpToDate) - { - if (Running) + if (_running) { return; } - Running = true; - mainWindow.UpdateMenuItem.Sensitive = false; - - int artifactIndex = -1; + _running = true; // Detect current platform if (OperatingSystem.IsMacOS()) { - _platformExt = "osx_x64.zip"; - artifactIndex = 1; + _platformExt = "macos_universal.app.tar.gz"; } else if (OperatingSystem.IsWindows()) { _platformExt = "win_x64.zip"; - artifactIndex = 2; } else if (OperatingSystem.IsLinux()) { var arch = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "arm64" : "x64"; _platformExt = $"linux_{arch}.tar.gz"; - artifactIndex = 0; - } - - if (artifactIndex == -1) - { - GtkDialog.CreateErrorDialog("Your platform is not supported!"); - - return; } Version newVersion; @@ -99,9 +81,14 @@ namespace Ryujinx.Modules } catch { - GtkDialog.CreateWarningDialog("Failed to convert the current Ryujinx version.", "Cancelling Update!"); Logger.Error?.Print(LogClass.Application, "Failed to convert the current Ryujinx version!"); + await ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedMessage], + LocaleManager.Instance[LocaleKeys.DialogUpdaterCancelUpdateMessage]); + + _running = false; + return; } @@ -109,9 +96,8 @@ namespace Ryujinx.Modules try { using HttpClient jsonClient = ConstructHttpClient(); - string buildInfoUrl = $"{GitHubApiUrl}/repos/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}/releases/latest"; - // Fetch latest build information + string buildInfoUrl = $"{GitHubApiUrl}/repos/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}/releases/latest"; string fetchedJson = await jsonClient.GetStringAsync(buildInfoUrl); var fetched = JsonHelper.Deserialize(fetchedJson, _serializerContext.GithubReleasesJsonResponse); _buildVer = fetched.Name; @@ -126,9 +112,13 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); + await ContentDialogHelper.CreateUpdaterInfoDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], + ""); } + _running = false; + return; } @@ -136,20 +126,29 @@ namespace Ryujinx.Modules } } - if (_buildUrl == null) + // If build not done, assume no new update are available. + if (_buildUrl is null) { if (showVersionUpToDate) { - GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); + await ContentDialogHelper.CreateUpdaterInfoDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], + ""); } + _running = false; + return; } } catch (Exception exception) { Logger.Error?.Print(LogClass.Application, exception.Message); - GtkDialog.CreateErrorDialog("An error occurred when trying to get release information from GitHub Release. This can be caused if a new release is being compiled by GitHub Actions. Try again in a few minutes."); + + await ContentDialogHelper.CreateErrorDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterFailedToGetVersionMessage]); + + _running = false; return; } @@ -160,8 +159,13 @@ namespace Ryujinx.Modules } catch { - GtkDialog.CreateWarningDialog("Failed to convert the received Ryujinx version from GitHub Release.", "Cancelling Update!"); - Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from GitHub Release!"); + Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from Github!"); + + await ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterConvertFailedGithubMessage], + LocaleManager.Instance[LocaleKeys.DialogUpdaterCancelUpdateMessage]); + + _running = false; return; } @@ -170,11 +174,12 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - GtkDialog.CreateUpdaterInfoDialog("You are already using the latest version of Ryujinx!", ""); + await ContentDialogHelper.CreateUpdaterInfoDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage], + ""); } - Running = false; - mainWindow.UpdateMenuItem.Sensitive = true; + _running = false; return; } @@ -197,13 +202,39 @@ namespace Ryujinx.Modules _buildSize = -1; } - // Show a message asking the user if they want to update - UpdateDialog updateDialog = new(mainWindow, newVersion, _buildUrl); - updateDialog.Show(); + await Dispatcher.UIThread.InvokeAsync(async () => + { + // Show a message asking the user if they want to update + var shouldUpdate = await ContentDialogHelper.CreateChoiceDialog( + LocaleManager.Instance[LocaleKeys.RyujinxUpdater], + LocaleManager.Instance[LocaleKeys.RyujinxUpdaterMessage], + $"{Program.Version} -> {newVersion}"); + + if (shouldUpdate) + { + await UpdateRyujinx(mainWindow, _buildUrl); + } + else + { + _running = false; + } + }); } - public static void UpdateRyujinx(UpdateDialog updateDialog, string downloadUrl) + private static HttpClient ConstructHttpClient() { + HttpClient result = new(); + + // Required by GitHub to interact with APIs. + result.DefaultRequestHeaders.Add("User-Agent", "Ryujinx-Updater/1.0.0"); + + return result; + } + + private static async Task UpdateRyujinx(Window parent, string downloadUrl) + { + _updateSuccessful = false; + // Empty update dir, although it shouldn't ever have anything inside it if (Directory.Exists(_updateDir)) { @@ -214,22 +245,93 @@ namespace Ryujinx.Modules string updateFile = Path.Combine(_updateDir, "update.bin"); - // Download the update .zip - updateDialog.MainText.Text = "Downloading Update..."; - updateDialog.ProgressBar.Value = 0; - updateDialog.ProgressBar.MaxValue = 100; + TaskDialog taskDialog = new() + { + Header = LocaleManager.Instance[LocaleKeys.RyujinxUpdater], + SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading], + IconSource = new SymbolIconSource { Symbol = Symbol.Download }, + ShowProgressBar = true, + XamlRoot = parent, + }; - if (_buildSize >= 0) + taskDialog.Opened += (s, e) => { - DoUpdateWithMultipleThreads(updateDialog, downloadUrl, updateFile); - } - else + if (_buildSize >= 0) + { + DoUpdateWithMultipleThreads(taskDialog, downloadUrl, updateFile); + } + else + { + DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); + } + }; + + await taskDialog.ShowAsync(true); + + if (_updateSuccessful) { - DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); + bool shouldRestart = true; + + if (!OperatingSystem.IsMacOS()) + { + shouldRestart = await ContentDialogHelper.CreateChoiceDialog(LocaleManager.Instance[LocaleKeys.RyujinxUpdater], + LocaleManager.Instance[LocaleKeys.DialogUpdaterCompleteMessage], + LocaleManager.Instance[LocaleKeys.DialogUpdaterRestartMessage]); + } + + if (shouldRestart) + { + List arguments = CommandLineState.Arguments.ToList(); + string executableDirectory = AppDomain.CurrentDomain.BaseDirectory; + + // On macOS we perform the update at relaunch. + if (OperatingSystem.IsMacOS()) + { + string baseBundlePath = Path.GetFullPath(Path.Combine(executableDirectory, "..", "..")); + string newBundlePath = Path.Combine(_updateDir, "Ryujinx.app"); + string updaterScriptPath = Path.Combine(newBundlePath, "Contents", "Resources", "updater.sh"); + string currentPid = Environment.ProcessId.ToString(); + + arguments.InsertRange(0, new List { updaterScriptPath, baseBundlePath, newBundlePath, currentPid }); + Process.Start("/bin/bash", arguments); + } + else + { + // Find the process name. + string ryuName = Path.GetFileName(Environment.ProcessPath); + + // Some operating systems can see the renamed executable, so strip off the .ryuold if found. + if (ryuName.EndsWith(".ryuold")) + { + ryuName = ryuName[..^7]; + } + + // Fallback if the executable could not be found. + if (!Path.Exists(Path.Combine(executableDirectory, ryuName))) + { + ryuName = OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx"; + } + + ProcessStartInfo processStart = new(ryuName) + { + UseShellExecute = true, + WorkingDirectory = executableDirectory, + }; + + foreach (string argument in CommandLineState.Arguments) + { + processStart.ArgumentList.Add(argument); + } + + Process.Start(processStart); + } + + Environment.Exit(0); + } } } - private static void DoUpdateWithMultipleThreads(UpdateDialog updateDialog, string downloadUrl, string updateFile) + private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile) { // Multi-Threaded Updater long chunkSize = _buildSize / ConnectionCount; @@ -253,6 +355,7 @@ namespace Ryujinx.Modules // TODO: WebClient is obsolete and need to be replaced with a more complex logic using HttpClient. using WebClient client = new(); #pragma warning restore SYSLIB0014 + webClients.Add(client); if (i == ConnectionCount - 1) @@ -272,7 +375,7 @@ namespace Ryujinx.Modules Interlocked.Exchange(ref progressPercentage[index], args.ProgressPercentage); Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage); - updateDialog.ProgressBar.Value = totalProgressPercentage / ConnectionCount; + taskDialog.SetProgressBarState(totalProgressPercentage / ConnectionCount, TaskDialogProgressState.Normal); }; client.DownloadDataCompleted += (_, args) => @@ -283,6 +386,8 @@ namespace Ryujinx.Modules { webClients[index].Dispose(); + taskDialog.Hide(); + return; } @@ -300,18 +405,24 @@ namespace Ryujinx.Modules File.WriteAllBytes(updateFile, mergedFileBytes); + // On macOS, ensure that we remove the quarantine bit to prevent Gatekeeper from blocking execution. + if (OperatingSystem.IsMacOS()) + { + using Process xattrProcess = Process.Start("xattr", new List { "-d", "com.apple.quarantine", updateFile }); + + xattrProcess.WaitForExit(); + } + try { - InstallUpdate(updateDialog, updateFile); + InstallUpdate(taskDialog, updateFile); } catch (Exception e) { Logger.Warning?.Print(LogClass.Application, e.Message); Logger.Warning?.Print(LogClass.Application, "Multi-Threaded update failed, falling back to single-threaded updater."); - DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); - - return; + DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); } } }; @@ -330,14 +441,14 @@ namespace Ryujinx.Modules webClient.CancelAsync(); } - DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile); + DoUpdateWithSingleThread(taskDialog, downloadUrl, updateFile); return; } } } - private static void DoUpdateWithSingleThreadWorker(UpdateDialog updateDialog, string downloadUrl, string updateFile) + private static void DoUpdateWithSingleThreadWorker(TaskDialog taskDialog, string downloadUrl, string updateFile) { using HttpClient client = new(); // We do not want to timeout while downloading @@ -363,101 +474,118 @@ namespace Ryujinx.Modules byteWritten += readSize; - updateDialog.ProgressBar.Value = ((double)byteWritten / totalBytes) * 100; + taskDialog.SetProgressBarState(GetPercentage(byteWritten, totalBytes), TaskDialogProgressState.Normal); + updateFileStream.Write(buffer, 0, readSize); } - InstallUpdate(updateDialog, updateFile); + InstallUpdate(taskDialog, updateFile); } - private static void DoUpdateWithSingleThread(UpdateDialog updateDialog, string downloadUrl, string updateFile) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static double GetPercentage(double value, double max) { - Thread worker = new(() => DoUpdateWithSingleThreadWorker(updateDialog, downloadUrl, updateFile)) + return max == 0 ? 0 : value / max * 100; + } + + private static void DoUpdateWithSingleThread(TaskDialog taskDialog, string downloadUrl, string updateFile) + { + Thread worker = new(() => DoUpdateWithSingleThreadWorker(taskDialog, downloadUrl, updateFile)) { Name = "Updater.SingleThreadWorker", }; + worker.Start(); } - private static async void InstallUpdate(UpdateDialog updateDialog, string updateFile) + [SupportedOSPlatform("linux")] + [SupportedOSPlatform("macos")] + private static void ExtractTarGzipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) + { + using Stream inStream = File.OpenRead(archivePath); + using GZipInputStream gzipStream = new(inStream); + using TarInputStream tarStream = new(gzipStream, Encoding.ASCII); + + TarEntry tarEntry; + + while ((tarEntry = tarStream.GetNextEntry()) is not null) + { + if (tarEntry.IsDirectory) + { + continue; + } + + string outPath = Path.Combine(outputDirectoryPath, tarEntry.Name); + + Directory.CreateDirectory(Path.GetDirectoryName(outPath)); + + using FileStream outStream = File.OpenWrite(outPath); + tarStream.CopyEntryContents(outStream); + + File.SetUnixFileMode(outPath, (UnixFileMode)tarEntry.TarHeader.Mode); + File.SetLastWriteTime(outPath, DateTime.SpecifyKind(tarEntry.ModTime, DateTimeKind.Utc)); + + Dispatcher.UIThread.Post(() => + { + if (tarEntry is null) + { + return; + } + + taskDialog.SetProgressBarState(GetPercentage(tarEntry.Size, inStream.Length), TaskDialogProgressState.Normal); + }); + } + } + + private static void ExtractZipFile(TaskDialog taskDialog, string archivePath, string outputDirectoryPath) + { + using Stream inStream = File.OpenRead(archivePath); + using ZipFile zipFile = new(inStream); + + double count = 0; + foreach (ZipEntry zipEntry in zipFile) + { + count++; + if (zipEntry.IsDirectory) + { + continue; + } + + string outPath = Path.Combine(outputDirectoryPath, zipEntry.Name); + + Directory.CreateDirectory(Path.GetDirectoryName(outPath)); + + using Stream zipStream = zipFile.GetInputStream(zipEntry); + using FileStream outStream = File.OpenWrite(outPath); + + zipStream.CopyTo(outStream); + + File.SetLastWriteTime(outPath, DateTime.SpecifyKind(zipEntry.DateTime, DateTimeKind.Utc)); + + Dispatcher.UIThread.Post(() => + { + taskDialog.SetProgressBarState(GetPercentage(count, zipFile.Count), TaskDialogProgressState.Normal); + }); + } + } + + private static void InstallUpdate(TaskDialog taskDialog, string updateFile) { // Extract Update - updateDialog.MainText.Text = "Extracting Update..."; - updateDialog.ProgressBar.Value = 0; + taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterExtracting]; + taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); - if (OperatingSystem.IsLinux()) + if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) { - using Stream inStream = File.OpenRead(updateFile); - using Stream gzipStream = new GZipInputStream(inStream); - using TarInputStream tarStream = new(gzipStream, Encoding.ASCII); - updateDialog.ProgressBar.MaxValue = inStream.Length; - - await Task.Run(() => - { - TarEntry tarEntry; - - if (!OperatingSystem.IsWindows()) - { - while ((tarEntry = tarStream.GetNextEntry()) != null) - { - if (tarEntry.IsDirectory) - { - continue; - } - - string outPath = Path.Combine(_updateDir, tarEntry.Name); - - Directory.CreateDirectory(Path.GetDirectoryName(outPath)); - - using FileStream outStream = File.OpenWrite(outPath); - tarStream.CopyEntryContents(outStream); - - File.SetUnixFileMode(outPath, (UnixFileMode)tarEntry.TarHeader.Mode); - File.SetLastWriteTime(outPath, DateTime.SpecifyKind(tarEntry.ModTime, DateTimeKind.Utc)); - - TarEntry entry = tarEntry; - - Application.Invoke(delegate - { - updateDialog.ProgressBar.Value += entry.Size; - }); - } - } - }); - - updateDialog.ProgressBar.Value = inStream.Length; + ExtractTarGzipFile(taskDialog, updateFile, _updateDir); + } + else if (OperatingSystem.IsWindows()) + { + ExtractZipFile(taskDialog, updateFile, _updateDir); } else { - using Stream inStream = File.OpenRead(updateFile); - using ZipFile zipFile = new(inStream); - updateDialog.ProgressBar.MaxValue = zipFile.Count; - - await Task.Run(() => - { - foreach (ZipEntry zipEntry in zipFile) - { - if (zipEntry.IsDirectory) - { - continue; - } - - string outPath = Path.Combine(_updateDir, zipEntry.Name); - - Directory.CreateDirectory(Path.GetDirectoryName(outPath)); - - using Stream zipStream = zipFile.GetInputStream(zipEntry); - using FileStream outStream = File.OpenWrite(outPath); - zipStream.CopyTo(outStream); - - File.SetLastWriteTime(outPath, DateTime.SpecifyKind(zipEntry.DateTime, DateTimeKind.Utc)); - - Application.Invoke(delegate - { - updateDialog.ProgressBar.Value++; - }); - } - }); + throw new NotSupportedException(); } // Delete downloaded zip @@ -465,49 +593,46 @@ namespace Ryujinx.Modules List allFiles = EnumerateFilesToDelete().ToList(); - updateDialog.MainText.Text = "Renaming Old Files..."; - updateDialog.ProgressBar.Value = 0; - updateDialog.ProgressBar.MaxValue = allFiles.Count; + taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterRenaming]; + taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); - // Replace old files - await Task.Run(() => + // NOTE: On macOS, replacement is delayed to the restart phase. + if (!OperatingSystem.IsMacOS()) { + // Replace old files + double count = 0; foreach (string file in allFiles) { + count++; try { File.Move(file, file + ".ryuold"); - Application.Invoke(delegate + Dispatcher.UIThread.InvokeAsync(() => { - updateDialog.ProgressBar.Value++; + taskDialog.SetProgressBarState(GetPercentage(count, allFiles.Count), TaskDialogProgressState.Normal); }); } catch { - Logger.Warning?.Print(LogClass.Application, "Updater was unable to rename file: " + file); + Logger.Warning?.Print(LogClass.Application, LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.UpdaterRenameFailed, file)); } } - Application.Invoke(delegate + Dispatcher.UIThread.InvokeAsync(() => { - updateDialog.MainText.Text = "Adding New Files..."; - updateDialog.ProgressBar.Value = 0; - updateDialog.ProgressBar.MaxValue = Directory.GetFiles(_updatePublishDir, "*", SearchOption.AllDirectories).Length; + taskDialog.SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterAddingFiles]; + taskDialog.SetProgressBarState(0, TaskDialogProgressState.Normal); }); - MoveAllFilesOver(_updatePublishDir, _homeDir, updateDialog); - }); + MoveAllFilesOver(_updatePublishDir, _homeDir, taskDialog); - Directory.Delete(_updateDir, true); + Directory.Delete(_updateDir, true); + } - updateDialog.MainText.Text = "Update Complete!"; - updateDialog.SecondaryText.Text = "Do you want to restart Ryujinx now?"; - updateDialog.Modal = true; + _updateSuccessful = true; - updateDialog.ProgressBar.Hide(); - updateDialog.YesButton.Show(); - updateDialog.NoButton.Show(); + taskDialog.Hide(); } public static bool CanUpdate(bool showWarnings) @@ -517,7 +642,11 @@ namespace Ryujinx.Modules { if (showWarnings) { - GtkDialog.CreateWarningDialog("You are not connected to the Internet!", "Please verify that you have a working Internet connection!"); + Dispatcher.UIThread.InvokeAsync(() => + ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterNoInternetMessage], + LocaleManager.Instance[LocaleKeys.DialogUpdaterNoInternetSubMessage]) + ); } return false; @@ -527,7 +656,11 @@ namespace Ryujinx.Modules { if (showWarnings) { - GtkDialog.CreateWarningDialog("You cannot update a Dirty build of Ryujinx!", "Please download Ryujinx at https://ryujinx.org/ if you are looking for a supported version."); + Dispatcher.UIThread.InvokeAsync(() => + ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildMessage], + LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildSubMessage]) + ); } return false; @@ -539,11 +672,19 @@ namespace Ryujinx.Modules { if (ReleaseInformation.IsFlatHubBuild) { - GtkDialog.CreateWarningDialog("Updater Disabled!", "Please update Ryujinx via FlatHub."); + Dispatcher.UIThread.InvokeAsync(() => + ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], + LocaleManager.Instance[LocaleKeys.DialogUpdaterFlatpakNotSupportedMessage]) + ); } else { - GtkDialog.CreateWarningDialog("Updater Disabled!", "Please download Ryujinx at https://ryujinx.org/ if you are looking for a supported version."); + Dispatcher.UIThread.InvokeAsync(() => + ContentDialogHelper.CreateWarningDialog( + LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], + LocaleManager.Instance[LocaleKeys.DialogUpdaterDirtyBuildSubMessage]) + ); } } @@ -557,7 +698,7 @@ namespace Ryujinx.Modules var files = Directory.EnumerateFiles(_homeDir); // All files directly in base dir. // Determine and exclude user files only when the updater is running, not when cleaning old files - if (Running) + if (_running && !OperatingSystem.IsMacOS()) { // Compare the loose files in base directory against the loose files from the incoming update, and store foreign ones in a user list. var oldFiles = Directory.EnumerateFiles(_homeDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); @@ -583,8 +724,9 @@ namespace Ryujinx.Modules return files.Where(f => !new FileInfo(f).Attributes.HasFlag(FileAttributes.Hidden | FileAttributes.System)); } - private static void MoveAllFilesOver(string root, string dest, UpdateDialog dialog) + private static void MoveAllFilesOver(string root, string dest, TaskDialog taskDialog) { + int total = Directory.GetFiles(root, "*", SearchOption.AllDirectories).Length; foreach (string directory in Directory.GetDirectories(root)) { string dirName = Path.GetFileName(directory); @@ -594,28 +736,28 @@ namespace Ryujinx.Modules Directory.CreateDirectory(Path.Combine(dest, dirName)); } - MoveAllFilesOver(directory, Path.Combine(dest, dirName), dialog); + MoveAllFilesOver(directory, Path.Combine(dest, dirName), taskDialog); } + double count = 0; foreach (string file in Directory.GetFiles(root)) { + count++; + File.Move(file, Path.Combine(dest, Path.GetFileName(file)), true); - Application.Invoke(delegate + Dispatcher.UIThread.InvokeAsync(() => { - dialog.ProgressBar.Value++; + taskDialog.SetProgressBarState(GetPercentage(count, total), TaskDialogProgressState.Normal); }); } } public static void CleanupUpdate() { - foreach (string file in EnumerateFilesToDelete()) + foreach (string file in Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories)) { - if (Path.GetExtension(file).EndsWith(".ryuold")) - { - File.Delete(file); - } + File.Delete(file); } } } diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 1845c512e..aecc585fc 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -1,4 +1,7 @@ -using Gtk; +using Avalonia; +using Avalonia.Threading; +using Ryujinx.Ava.UI.Helpers; +using Ryujinx.Ava.UI.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.GraphicsDriver; @@ -6,139 +9,80 @@ using Ryujinx.Common.Logging; using Ryujinx.Common.SystemInterop; using Ryujinx.Modules; using Ryujinx.SDL2.Common; -using Ryujinx.UI; using Ryujinx.UI.Common; using Ryujinx.UI.Common.Configuration; using Ryujinx.UI.Common.Helper; using Ryujinx.UI.Common.SystemInfo; -using Ryujinx.UI.Widgets; -using SixLabors.ImageSharp.Formats.Jpeg; using System; -using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; -namespace Ryujinx +namespace Ryujinx.Ava { - partial class Program + internal partial class Program { - public static double WindowScaleFactor { get; private set; } - + public static double WindowScaleFactor { get; set; } + public static double DesktopScaleFactor { get; set; } = 1.0; public static string Version { get; private set; } - - public static string ConfigurationPath { get; set; } - - public static string CommandLineProfile { get; set; } - - private const string X11LibraryName = "libX11"; - - [LibraryImport(X11LibraryName)] - private static partial int XInitThreads(); + public static string ConfigurationPath { get; private set; } + public static bool PreviewerDetached { get; private set; } [LibraryImport("user32.dll", SetLastError = true)] public static partial int MessageBoxA(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type); - [LibraryImport("libc", SetLastError = true)] - private static partial int setenv([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string value, int overwrite); + private const uint MbIconwarning = 0x30; - private const uint MbIconWarning = 0x30; - - static Program() - { - if (OperatingSystem.IsLinux()) - { - NativeLibrary.SetDllImportResolver(typeof(Program).Assembly, (name, assembly, path) => - { - if (name != X11LibraryName) - { - return IntPtr.Zero; - } - - if (!NativeLibrary.TryLoad("libX11.so.6", assembly, path, out IntPtr result)) - { - if (!NativeLibrary.TryLoad("libX11.so", assembly, path, out result)) - { - return IntPtr.Zero; - } - } - - return result; - }); - } - } - - static void Main(string[] args) + public static void Main(string[] args) { Version = ReleaseInformation.Version; if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134)) { - MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconWarning); + _ = MessageBoxA(IntPtr.Zero, "You are running an outdated version of Windows.\n\nStarting on June 1st 2022, Ryujinx will only support Windows 10 1803 and newer.\n", $"Ryujinx {Version}", MbIconwarning); } + PreviewerDetached = true; + + Initialize(args); + + LoggerAdapter.Register(); + + BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + } + + public static AppBuilder BuildAvaloniaApp() + { + return AppBuilder.Configure() + .UsePlatformDetect() + .With(new X11PlatformOptions + { + EnableMultiTouch = true, + EnableIme = true, + EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope", + RenderingMode = new[] { X11RenderingMode.Glx, X11RenderingMode.Software }, + }) + .With(new Win32PlatformOptions + { + WinUICompositionBackdropCornerRadius = 8.0f, + RenderingMode = new[] { Win32RenderingMode.AngleEgl, Win32RenderingMode.Software }, + }) + .UseSkia(); + } + + private static void Initialize(string[] args) + { // Parse arguments CommandLineState.ParseArguments(args); - // Hook unhandled exception and process exit events. - GLib.ExceptionManager.UnhandledException += (GLib.UnhandledExceptionArgs e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); - AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); - AppDomain.CurrentDomain.ProcessExit += (object sender, EventArgs e) => Exit(); - - // Make process DPI aware for proper window sizing on high-res screens. - ForceDpiAware.Windows(); - WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); - // Delete backup files after updating. Task.Run(Updater.CleanupUpdate); Console.Title = $"Ryujinx Console {Version}"; - // NOTE: GTK3 doesn't init X11 in a multi threaded way. - // This ends up causing race condition and abort of XCB when a context is created by SPB (even if SPB do call XInitThreads). - if (OperatingSystem.IsLinux()) - { - if (XInitThreads() == 0) - { - throw new NotSupportedException("Failed to initialize multi-threading support."); - } - - Environment.SetEnvironmentVariable("GDK_BACKEND", "x11"); - setenv("GDK_BACKEND", "x11", 1); - } - - if (OperatingSystem.IsMacOS()) - { - string baseDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); - string resourcesDataDir; - - if (Path.GetFileName(baseDirectory) == "MacOS") - { - resourcesDataDir = Path.Combine(Directory.GetParent(baseDirectory).FullName, "Resources"); - } - else - { - resourcesDataDir = baseDirectory; - } - - static void SetEnvironmentVariableNoCaching(string key, string value) - { - int res = setenv(key, value, 1); - Debug.Assert(res != -1); - } - - // On macOS, GTK3 needs XDG_DATA_DIRS to be set, otherwise it will try searching for "gschemas.compiled" in system directories. - SetEnvironmentVariableNoCaching("XDG_DATA_DIRS", Path.Combine(resourcesDataDir, "share")); - - // On macOS, GTK3 needs GDK_PIXBUF_MODULE_FILE to be set, otherwise it will try searching for "loaders.cache" in system directories. - SetEnvironmentVariableNoCaching("GDK_PIXBUF_MODULE_FILE", Path.Combine(resourcesDataDir, "lib", "gdk-pixbuf-2.0", "2.10.0", "loaders.cache")); - - SetEnvironmentVariableNoCaching("GTK_IM_MODULE_FILE", Path.Combine(resourcesDataDir, "lib", "gtk-3.0", "3.0.0", "immodules.cache")); - } - - string systemPath = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine); - Environment.SetEnvironmentVariable("Path", $"{Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin")};{systemPath}"); + // Hook unhandled exception and process exit events. + AppDomain.CurrentDomain.UnhandledException += (sender, e) => ProcessUnhandledException(e.ExceptionObject as Exception, e.IsTerminating); + AppDomain.CurrentDomain.ProcessExit += (sender, e) => Exit(); // Setup base data directory. AppDataManager.Initialize(CommandLineState.BaseDirPathArg); @@ -153,29 +97,47 @@ namespace Ryujinx DiscordIntegrationModule.Initialize(); // Initialize SDL2 driver - SDL2Driver.MainThreadDispatcher = action => + SDL2Driver.MainThreadDispatcher = action => Dispatcher.UIThread.InvokeAsync(action, DispatcherPriority.Input); + + ReloadConfig(); + + WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); + + // Logging system information. + PrintSystemInfo(); + + // Enable OGL multithreading on the driver, when available. + DriverUtilities.ToggleOGLThreading(ConfigurationState.Instance.Graphics.BackendThreading == BackendThreading.Off); + + // Check if keys exists. + if (!File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys"))) { - Application.Invoke(delegate + if (!(AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys")))) { - action(); - }); - }; + MainWindow.ShowKeyErrorOnLoad = true; + } + } - // Sets ImageSharp Jpeg Encoder Quality. - SixLabors.ImageSharp.Configuration.Default.ImageFormatsManager.SetEncoder(JpegFormat.Instance, new JpegEncoder() + if (CommandLineState.LaunchPathArg != null) { - Quality = 100, - }); + MainWindow.DeferLoadApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg); + } + } + public static void ReloadConfig() + { string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.ConfigName); string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.ConfigName); // Now load the configuration as the other subsystems are now registered - ConfigurationPath = File.Exists(localConfigurationPath) - ? localConfigurationPath - : File.Exists(appDataConfigurationPath) - ? appDataConfigurationPath - : null; + if (File.Exists(localConfigurationPath)) + { + ConfigurationPath = localConfigurationPath; + } + else if (File.Exists(appDataConfigurationPath)) + { + ConfigurationPath = appDataConfigurationPath; + } if (ConfigurationPath == null) { @@ -199,7 +161,7 @@ namespace Ryujinx } } - // Check if graphics backend was overridden. + // Check if graphics backend was overridden if (CommandLineState.OverrideGraphicsBackend != null) { if (CommandLineState.OverrideGraphicsBackend.ToLower() == "opengl") @@ -212,6 +174,12 @@ namespace Ryujinx } } + // Check if docked mode was overriden. + if (CommandLineState.OverrideDockedMode.HasValue) + { + ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value; + } + // Check if HideCursor was overridden. if (CommandLineState.OverrideHideCursor is not null) { @@ -223,114 +191,6 @@ namespace Ryujinx _ => ConfigurationState.Instance.HideCursor.Value, }; } - - // Check if docked mode was overridden. - if (CommandLineState.OverrideDockedMode.HasValue) - { - ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value; - } - - // Logging system information. - PrintSystemInfo(); - - // Enable OGL multithreading on the driver, when available. - BackendThreading threadingMode = ConfigurationState.Instance.Graphics.BackendThreading; - DriverUtilities.ToggleOGLThreading(threadingMode == BackendThreading.Off); - - // Initialize Gtk. - Application.Init(); - - // Check if keys exists. - bool hasSystemProdKeys = File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys")); - bool hasCommonProdKeys = AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys")); - if (!hasSystemProdKeys && !hasCommonProdKeys) - { - UserErrorDialog.CreateUserErrorDialog(UserError.NoKeys); - } - - // Show the main window UI. - MainWindow mainWindow = new(); - mainWindow.Show(); - - if (OperatingSystem.IsLinux()) - { - int currentVmMaxMapCount = LinuxHelper.VmMaxMapCount; - - if (LinuxHelper.VmMaxMapCount < LinuxHelper.RecommendedVmMaxMapCount) - { - Logger.Warning?.Print(LogClass.Application, $"The value of vm.max_map_count is lower than {LinuxHelper.RecommendedVmMaxMapCount}. ({currentVmMaxMapCount})"); - - if (LinuxHelper.PkExecPath is not null) - { - var buttonTexts = new Dictionary() - { - { 0, "Yes, until the next restart" }, - { 1, "Yes, permanently" }, - { 2, "No" }, - }; - - ResponseType response = GtkDialog.CreateCustomDialog( - "Ryujinx - Low limit for memory mappings detected", - $"Would you like to increase the value of vm.max_map_count to {LinuxHelper.RecommendedVmMaxMapCount}?", - "Some games might try to create more memory mappings than currently allowed. " + - "Ryujinx will crash as soon as this limit gets exceeded.", - buttonTexts, - MessageType.Question); - - int rc; - - switch ((int)response) - { - case 0: - rc = LinuxHelper.RunPkExec($"echo {LinuxHelper.RecommendedVmMaxMapCount} > {LinuxHelper.VmMaxMapCountPath}"); - if (rc == 0) - { - Logger.Info?.Print(LogClass.Application, $"vm.max_map_count set to {LinuxHelper.VmMaxMapCount} until the next restart."); - } - else - { - Logger.Error?.Print(LogClass.Application, $"Unable to change vm.max_map_count. Process exited with code: {rc}"); - } - break; - case 1: - rc = LinuxHelper.RunPkExec($"echo \"vm.max_map_count = {LinuxHelper.RecommendedVmMaxMapCount}\" > {LinuxHelper.SysCtlConfigPath} && sysctl -p {LinuxHelper.SysCtlConfigPath}"); - if (rc == 0) - { - Logger.Info?.Print(LogClass.Application, $"vm.max_map_count set to {LinuxHelper.VmMaxMapCount}. Written to config: {LinuxHelper.SysCtlConfigPath}"); - } - else - { - Logger.Error?.Print(LogClass.Application, $"Unable to write new value for vm.max_map_count to config. Process exited with code: {rc}"); - } - break; - } - } - else - { - GtkDialog.CreateWarningDialog( - "Max amount of memory mappings is lower than recommended.", - $"The current value of vm.max_map_count ({currentVmMaxMapCount}) is lower than {LinuxHelper.RecommendedVmMaxMapCount}." + - "Some games might try to create more memory mappings than currently allowed. " + - "Ryujinx will crash as soon as this limit gets exceeded.\n\n" + - "You might want to either manually increase the limit or install pkexec, which allows Ryujinx to assist with that."); - } - } - } - - if (CommandLineState.LaunchPathArg != null) - { - mainWindow.RunApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg); - } - - if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false)) - { - Updater.BeginParse(mainWindow, false).ContinueWith(task => - { - Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}"); - }, TaskContinuationOptions.OnlyOnFaulted); - } - - Application.Run(); } private static void PrintSystemInfo() @@ -338,8 +198,7 @@ namespace Ryujinx Logger.Notice.Print(LogClass.Application, $"Ryujinx Version: {Version}"); SystemInfo.Gather().Print(); - var enabledLogs = Logger.GetEnabledLevels(); - Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogs.Count == 0 ? "" : string.Join(", ", enabledLogs))}"); + Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(Logger.GetEnabledLevels().Count == 0 ? "" : string.Join(", ", Logger.GetEnabledLevels()))}"); if (AppDataManager.Mode == AppDataManager.LaunchMode.Custom) { diff --git a/src/Ryujinx/Ryujinx.csproj b/src/Ryujinx/Ryujinx.csproj index 68bf98981..b3d312f62 100644 --- a/src/Ryujinx/Ryujinx.csproj +++ b/src/Ryujinx/Ryujinx.csproj @@ -1,5 +1,4 @@ - - + net8.0 win-x64;osx-x64;linux-x64 @@ -7,11 +6,17 @@ true 1.0.0-dirty $(DefineConstants);$(ExtraDefineConstants) - - true + - + Ryujinx.ico true + true + app.manifest + + + + true false @@ -19,33 +24,56 @@ partial + + + true + + - - - - - - + + + + + + + + + + - + + + + + + + + + + + - - + @@ -73,32 +101,66 @@ - - - false - Ryujinx.ico - - - - - - - - - - + + Designer + + + + MSBuild:Compile + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ryujinx.Ava/UI/Applet/AvaHostUIHandler.cs b/src/Ryujinx/UI/Applet/AvaHostUIHandler.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/AvaHostUIHandler.cs rename to src/Ryujinx/UI/Applet/AvaHostUIHandler.cs diff --git a/src/Ryujinx.Ava/UI/Applet/AvaloniaDynamicTextInputHandler.cs b/src/Ryujinx/UI/Applet/AvaloniaDynamicTextInputHandler.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/AvaloniaDynamicTextInputHandler.cs rename to src/Ryujinx/UI/Applet/AvaloniaDynamicTextInputHandler.cs diff --git a/src/Ryujinx.Ava/UI/Applet/AvaloniaHostUITheme.cs b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/AvaloniaHostUITheme.cs rename to src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs diff --git a/src/Ryujinx.Ava/UI/Applet/ControllerAppletDialog.axaml b/src/Ryujinx/UI/Applet/ControllerAppletDialog.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/ControllerAppletDialog.axaml rename to src/Ryujinx/UI/Applet/ControllerAppletDialog.axaml diff --git a/src/Ryujinx.Ava/UI/Applet/ControllerAppletDialog.axaml.cs b/src/Ryujinx/UI/Applet/ControllerAppletDialog.axaml.cs similarity index 91% rename from src/Ryujinx.Ava/UI/Applet/ControllerAppletDialog.axaml.cs rename to src/Ryujinx/UI/Applet/ControllerAppletDialog.axaml.cs index 279af07c3..5a98b1645 100644 --- a/src/Ryujinx.Ava/UI/Applet/ControllerAppletDialog.axaml.cs +++ b/src/Ryujinx/UI/Applet/ControllerAppletDialog.axaml.cs @@ -17,10 +17,10 @@ namespace Ryujinx.Ava.UI.Applet { internal partial class ControllerAppletDialog : UserControl { - private const string ProControllerResource = "Ryujinx.Ava/Assets/Icons/Controller_ProCon.svg"; - private const string JoyConPairResource = "Ryujinx.Ava/Assets/Icons/Controller_JoyConPair.svg"; - private const string JoyConLeftResource = "Ryujinx.Ava/Assets/Icons/Controller_JoyConLeft.svg"; - private const string JoyConRightResource = "Ryujinx.Ava/Assets/Icons/Controller_JoyConRight.svg"; + private const string ProControllerResource = "Ryujinx/Assets/Icons/Controller_ProCon.svg"; + private const string JoyConPairResource = "Ryujinx/Assets/Icons/Controller_JoyConPair.svg"; + private const string JoyConLeftResource = "Ryujinx/Assets/Icons/Controller_JoyConLeft.svg"; + private const string JoyConRightResource = "Ryujinx/Assets/Icons/Controller_JoyConRight.svg"; public static SvgImage ProControllerImage => GetResource(ProControllerResource); public static SvgImage JoyconPairImage => GetResource(JoyConPairResource); diff --git a/src/Ryujinx.Ava/UI/Applet/ErrorAppletWindow.axaml b/src/Ryujinx/UI/Applet/ErrorAppletWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/ErrorAppletWindow.axaml rename to src/Ryujinx/UI/Applet/ErrorAppletWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Applet/ErrorAppletWindow.axaml.cs b/src/Ryujinx/UI/Applet/ErrorAppletWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/ErrorAppletWindow.axaml.cs rename to src/Ryujinx/UI/Applet/ErrorAppletWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Applet/SwkbdAppletDialog.axaml b/src/Ryujinx/UI/Applet/SwkbdAppletDialog.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/SwkbdAppletDialog.axaml rename to src/Ryujinx/UI/Applet/SwkbdAppletDialog.axaml diff --git a/src/Ryujinx.Ava/UI/Applet/SwkbdAppletDialog.axaml.cs b/src/Ryujinx/UI/Applet/SwkbdAppletDialog.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Applet/SwkbdAppletDialog.axaml.cs rename to src/Ryujinx/UI/Applet/SwkbdAppletDialog.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationContextMenu.axaml b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationContextMenu.axaml rename to src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationContextMenu.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationContextMenu.axaml.cs rename to src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml rename to src/Ryujinx/UI/Controls/ApplicationGridView.axaml diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml.cs rename to src/Ryujinx/UI/Controls/ApplicationGridView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationListView.axaml b/src/Ryujinx/UI/Controls/ApplicationListView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationListView.axaml rename to src/Ryujinx/UI/Controls/ApplicationListView.axaml diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationListView.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/ApplicationListView.axaml.cs rename to src/Ryujinx/UI/Controls/ApplicationListView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml b/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml rename to src/Ryujinx/UI/Controls/NavigationDialogHost.axaml diff --git a/src/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs b/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/NavigationDialogHost.axaml.cs rename to src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/SliderScroll.axaml.cs b/src/Ryujinx/UI/Controls/SliderScroll.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/SliderScroll.axaml.cs rename to src/Ryujinx/UI/Controls/SliderScroll.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml b/src/Ryujinx/UI/Controls/UpdateWaitWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml rename to src/Ryujinx/UI/Controls/UpdateWaitWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs b/src/Ryujinx/UI/Controls/UpdateWaitWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Controls/UpdateWaitWindow.axaml.cs rename to src/Ryujinx/UI/Controls/UpdateWaitWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/ApplicationOpenedEventArgs.cs b/src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/ApplicationOpenedEventArgs.cs rename to src/Ryujinx/UI/Helpers/ApplicationOpenedEventArgs.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/BitmapArrayValueConverter.cs b/src/Ryujinx/UI/Helpers/BitmapArrayValueConverter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/BitmapArrayValueConverter.cs rename to src/Ryujinx/UI/Helpers/BitmapArrayValueConverter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/ButtonKeyAssigner.cs b/src/Ryujinx/UI/Helpers/ButtonKeyAssigner.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/ButtonKeyAssigner.cs rename to src/Ryujinx/UI/Helpers/ButtonKeyAssigner.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs b/src/Ryujinx/UI/Helpers/ContentDialogHelper.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs rename to src/Ryujinx/UI/Helpers/ContentDialogHelper.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/Glyph.cs b/src/Ryujinx/UI/Helpers/Glyph.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/Glyph.cs rename to src/Ryujinx/UI/Helpers/Glyph.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/GlyphValueConverter.cs b/src/Ryujinx/UI/Helpers/GlyphValueConverter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/GlyphValueConverter.cs rename to src/Ryujinx/UI/Helpers/GlyphValueConverter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs b/src/Ryujinx/UI/Helpers/KeyValueConverter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs rename to src/Ryujinx/UI/Helpers/KeyValueConverter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/LocalizedNeverConverter.cs b/src/Ryujinx/UI/Helpers/LocalizedNeverConverter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/LocalizedNeverConverter.cs rename to src/Ryujinx/UI/Helpers/LocalizedNeverConverter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/LoggerAdapter.cs b/src/Ryujinx/UI/Helpers/LoggerAdapter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/LoggerAdapter.cs rename to src/Ryujinx/UI/Helpers/LoggerAdapter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/MiniCommand.cs b/src/Ryujinx/UI/Helpers/MiniCommand.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/MiniCommand.cs rename to src/Ryujinx/UI/Helpers/MiniCommand.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/NotificationHelper.cs b/src/Ryujinx/UI/Helpers/NotificationHelper.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/NotificationHelper.cs rename to src/Ryujinx/UI/Helpers/NotificationHelper.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/OffscreenTextBox.cs b/src/Ryujinx/UI/Helpers/OffscreenTextBox.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/OffscreenTextBox.cs rename to src/Ryujinx/UI/Helpers/OffscreenTextBox.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/TimeZoneConverter.cs b/src/Ryujinx/UI/Helpers/TimeZoneConverter.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/TimeZoneConverter.cs rename to src/Ryujinx/UI/Helpers/TimeZoneConverter.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/UserErrorDialog.cs b/src/Ryujinx/UI/Helpers/UserErrorDialog.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/UserErrorDialog.cs rename to src/Ryujinx/UI/Helpers/UserErrorDialog.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/UserResult.cs b/src/Ryujinx/UI/Helpers/UserResult.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/UserResult.cs rename to src/Ryujinx/UI/Helpers/UserResult.cs diff --git a/src/Ryujinx.Ava/UI/Helpers/Win32NativeInterop.cs b/src/Ryujinx/UI/Helpers/Win32NativeInterop.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Helpers/Win32NativeInterop.cs rename to src/Ryujinx/UI/Helpers/Win32NativeInterop.cs diff --git a/src/Ryujinx.Ava/UI/Models/CheatNode.cs b/src/Ryujinx/UI/Models/CheatNode.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/CheatNode.cs rename to src/Ryujinx/UI/Models/CheatNode.cs diff --git a/src/Ryujinx.Ava/UI/Models/ControllerModel.cs b/src/Ryujinx/UI/Models/ControllerModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/ControllerModel.cs rename to src/Ryujinx/UI/Models/ControllerModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/DeviceType.cs b/src/Ryujinx/UI/Models/DeviceType.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/DeviceType.cs rename to src/Ryujinx/UI/Models/DeviceType.cs diff --git a/src/Ryujinx.Ava/UI/Models/DownloadableContentModel.cs b/src/Ryujinx/UI/Models/DownloadableContentModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/DownloadableContentModel.cs rename to src/Ryujinx/UI/Models/DownloadableContentModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs b/src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/Generic/LastPlayedSortComparer.cs rename to src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs diff --git a/src/Ryujinx.Ava/UI/Models/Generic/TimePlayedSortComparer.cs b/src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/Generic/TimePlayedSortComparer.cs rename to src/Ryujinx/UI/Models/Generic/TimePlayedSortComparer.cs diff --git a/src/Ryujinx.Ava/UI/Models/InputConfiguration.cs b/src/Ryujinx/UI/Models/InputConfiguration.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/InputConfiguration.cs rename to src/Ryujinx/UI/Models/InputConfiguration.cs diff --git a/src/Ryujinx.Ava/UI/Models/ModModel.cs b/src/Ryujinx/UI/Models/ModModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/ModModel.cs rename to src/Ryujinx/UI/Models/ModModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/PlayerModel.cs b/src/Ryujinx/UI/Models/PlayerModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/PlayerModel.cs rename to src/Ryujinx/UI/Models/PlayerModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/ProfileImageModel.cs b/src/Ryujinx/UI/Models/ProfileImageModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/ProfileImageModel.cs rename to src/Ryujinx/UI/Models/ProfileImageModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/SaveModel.cs b/src/Ryujinx/UI/Models/SaveModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/SaveModel.cs rename to src/Ryujinx/UI/Models/SaveModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/StatusUpdatedEventArgs.cs b/src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/StatusUpdatedEventArgs.cs rename to src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs diff --git a/src/Ryujinx.Ava/UI/Models/TempProfile.cs b/src/Ryujinx/UI/Models/TempProfile.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/TempProfile.cs rename to src/Ryujinx/UI/Models/TempProfile.cs diff --git a/src/Ryujinx.Ava/UI/Models/TimeZone.cs b/src/Ryujinx/UI/Models/TimeZone.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/TimeZone.cs rename to src/Ryujinx/UI/Models/TimeZone.cs diff --git a/src/Ryujinx.Ava/UI/Models/TitleUpdateModel.cs b/src/Ryujinx/UI/Models/TitleUpdateModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/TitleUpdateModel.cs rename to src/Ryujinx/UI/Models/TitleUpdateModel.cs diff --git a/src/Ryujinx.Ava/UI/Models/UserProfile.cs b/src/Ryujinx/UI/Models/UserProfile.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Models/UserProfile.cs rename to src/Ryujinx/UI/Models/UserProfile.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/EmbeddedWindow.cs b/src/Ryujinx/UI/Renderer/EmbeddedWindow.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/EmbeddedWindow.cs rename to src/Ryujinx/UI/Renderer/EmbeddedWindow.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/EmbeddedWindowOpenGL.cs b/src/Ryujinx/UI/Renderer/EmbeddedWindowOpenGL.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/EmbeddedWindowOpenGL.cs rename to src/Ryujinx/UI/Renderer/EmbeddedWindowOpenGL.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/EmbeddedWindowVulkan.cs b/src/Ryujinx/UI/Renderer/EmbeddedWindowVulkan.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/EmbeddedWindowVulkan.cs rename to src/Ryujinx/UI/Renderer/EmbeddedWindowVulkan.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/OpenTKBindingsContext.cs b/src/Ryujinx/UI/Renderer/OpenTKBindingsContext.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/OpenTKBindingsContext.cs rename to src/Ryujinx/UI/Renderer/OpenTKBindingsContext.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/RendererHost.axaml b/src/Ryujinx/UI/Renderer/RendererHost.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/RendererHost.axaml rename to src/Ryujinx/UI/Renderer/RendererHost.axaml diff --git a/src/Ryujinx.Ava/UI/Renderer/RendererHost.axaml.cs b/src/Ryujinx/UI/Renderer/RendererHost.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/RendererHost.axaml.cs rename to src/Ryujinx/UI/Renderer/RendererHost.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Renderer/SPBOpenGLContext.cs b/src/Ryujinx/UI/Renderer/SPBOpenGLContext.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Renderer/SPBOpenGLContext.cs rename to src/Ryujinx/UI/Renderer/SPBOpenGLContext.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/AboutWindowViewModel.cs rename to src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/AmiiboWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/AmiiboWindowViewModel.cs rename to src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/BaseModel.cs b/src/Ryujinx/UI/ViewModels/BaseModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/BaseModel.cs rename to src/Ryujinx/UI/ViewModels/BaseModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/ControllerInputViewModel.cs b/src/Ryujinx/UI/ViewModels/ControllerInputViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/ControllerInputViewModel.cs rename to src/Ryujinx/UI/ViewModels/ControllerInputViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/DownloadableContentManagerViewModel.cs rename to src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs rename to src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/ModManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/ModManagerViewModel.cs rename to src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs b/src/Ryujinx/UI/ViewModels/MotionInputViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs rename to src/Ryujinx/UI/ViewModels/MotionInputViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs b/src/Ryujinx/UI/ViewModels/RumbleInputViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs rename to src/Ryujinx/UI/ViewModels/RumbleInputViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs rename to src/Ryujinx/UI/ViewModels/SettingsViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/TitleUpdateViewModel.cs rename to src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs b/src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs rename to src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/UserProfileImageSelectorViewModel.cs b/src/Ryujinx/UI/ViewModels/UserProfileImageSelectorViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/UserProfileImageSelectorViewModel.cs rename to src/Ryujinx/UI/ViewModels/UserProfileImageSelectorViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/UserProfileViewModel.cs b/src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/UserProfileViewModel.cs rename to src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs diff --git a/src/Ryujinx.Ava/UI/ViewModels/UserSaveManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs similarity index 100% rename from src/Ryujinx.Ava/UI/ViewModels/UserSaveManagerViewModel.cs rename to src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs diff --git a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml b/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml rename to src/Ryujinx/UI/Views/Input/ControllerInputView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml.cs rename to src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml b/src/Ryujinx/UI/Views/Input/MotionInputView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml rename to src/Ryujinx/UI/Views/Input/MotionInputView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/MotionInputView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/MotionInputView.axaml.cs rename to src/Ryujinx/UI/Views/Input/MotionInputView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml rename to src/Ryujinx/UI/Views/Input/RumbleInputView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Input/RumbleInputView.axaml.cs rename to src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml rename to src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs similarity index 99% rename from src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs rename to src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index 8dff50868..dc50ce265 100644 --- a/src/Ryujinx.Ava/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -55,7 +55,7 @@ namespace Ryujinx.Ava.UI.Views.Main { List menuItems = new(); - string localePath = "Ryujinx.Ava/Assets/Locales"; + string localePath = "Ryujinx/Assets/Locales"; string localeExt = ".json"; string[] localesPath = EmbeddedResources.GetAllAvailableResources(localePath, localeExt); diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainStatusBarView.axaml b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Main/MainStatusBarView.axaml rename to src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainStatusBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Main/MainStatusBarView.axaml.cs rename to src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainViewControls.axaml b/src/Ryujinx/UI/Views/Main/MainViewControls.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Main/MainViewControls.axaml rename to src/Ryujinx/UI/Views/Main/MainViewControls.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Main/MainViewControls.axaml.cs b/src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Main/MainViewControls.axaml.cs rename to src/Ryujinx/UI/Views/Main/MainViewControls.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsAudioView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsCPUView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsCPUView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsCPUView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsCPUView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsGraphicsView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsHotkeysView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsHotkeysView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsHotkeysView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsHotkeysView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsInputView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsLoggingView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsLoggingView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsLoggingView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsLoggingView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsNetworkView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsNetworkView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsNetworkView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsNetworkView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsUIView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsUIView.axaml rename to src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsUIView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/Settings/SettingsUIView.axaml.cs rename to src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml b/src/Ryujinx/UI/Views/User/UserEditorView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml rename to src/Ryujinx/UI/Views/User/UserEditorView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs b/src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserEditorView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml b/src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml rename to src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs b/src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml b/src/Ryujinx/UI/Views/User/UserProfileImageSelectorView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml rename to src/Ryujinx/UI/Views/User/UserProfileImageSelectorView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs b/src/Ryujinx/UI/Views/User/UserProfileImageSelectorView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserProfileImageSelectorView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml b/src/Ryujinx/UI/Views/User/UserRecovererView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml rename to src/Ryujinx/UI/Views/User/UserRecovererView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs b/src/Ryujinx/UI/Views/User/UserRecovererView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserRecovererView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml b/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml rename to src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs b/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml b/src/Ryujinx/UI/Views/User/UserSelectorView.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml rename to src/Ryujinx/UI/Views/User/UserSelectorView.axaml diff --git a/src/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs b/src/Ryujinx/UI/Views/User/UserSelectorView.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs rename to src/Ryujinx/UI/Views/User/UserSelectorView.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml b/src/Ryujinx/UI/Windows/AboutWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml rename to src/Ryujinx/UI/Windows/AboutWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs b/src/Ryujinx/UI/Windows/AboutWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/AboutWindow.axaml.cs rename to src/Ryujinx/UI/Windows/AboutWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml b/src/Ryujinx/UI/Windows/AmiiboWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml rename to src/Ryujinx/UI/Windows/AmiiboWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml.cs b/src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/AmiiboWindow.axaml.cs rename to src/Ryujinx/UI/Windows/AmiiboWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml b/src/Ryujinx/UI/Windows/CheatWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml rename to src/Ryujinx/UI/Windows/CheatWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml.cs b/src/Ryujinx/UI/Windows/CheatWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml.cs rename to src/Ryujinx/UI/Windows/CheatWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml b/src/Ryujinx/UI/Windows/ContentDialogOverlayWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml rename to src/Ryujinx/UI/Windows/ContentDialogOverlayWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs b/src/Ryujinx/UI/Windows/ContentDialogOverlayWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/ContentDialogOverlayWindow.axaml.cs rename to src/Ryujinx/UI/Windows/ContentDialogOverlayWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml rename to src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs b/src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/DownloadableContentManagerWindow.axaml.cs rename to src/Ryujinx/UI/Windows/DownloadableContentManagerWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/IconColorPicker.cs b/src/Ryujinx/UI/Windows/IconColorPicker.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/IconColorPicker.cs rename to src/Ryujinx/UI/Windows/IconColorPicker.cs diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml b/src/Ryujinx/UI/Windows/MainWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/MainWindow.axaml rename to src/Ryujinx/UI/Windows/MainWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs rename to src/Ryujinx/UI/Windows/MainWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/ModManagerWindow.axaml b/src/Ryujinx/UI/Windows/ModManagerWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/ModManagerWindow.axaml rename to src/Ryujinx/UI/Windows/ModManagerWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/ModManagerWindow.axaml.cs b/src/Ryujinx/UI/Windows/ModManagerWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/ModManagerWindow.axaml.cs rename to src/Ryujinx/UI/Windows/ModManagerWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml b/src/Ryujinx/UI/Windows/SettingsWindow.axaml similarity index 98% rename from src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml rename to src/Ryujinx/UI/Windows/SettingsWindow.axaml index 40cac90dd..de3c2291a 100644 --- a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml @@ -76,7 +76,7 @@ Tag="CpuPage"> diff --git a/src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/SettingsWindow.axaml.cs rename to src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs diff --git a/src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs b/src/Ryujinx/UI/Windows/StyleableWindow.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/StyleableWindow.cs rename to src/Ryujinx/UI/Windows/StyleableWindow.cs diff --git a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml rename to src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml diff --git a/src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs b/src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs similarity index 100% rename from src/Ryujinx.Ava/UI/Windows/TitleUpdateWindow.axaml.cs rename to src/Ryujinx/UI/Windows/TitleUpdateWindow.axaml.cs diff --git a/src/Ryujinx.Ava/app.manifest b/src/Ryujinx/app.manifest similarity index 100% rename from src/Ryujinx.Ava/app.manifest rename to src/Ryujinx/app.manifest