From 1d0152b9617a8918c7db3d01873bbf46c546c969 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 4 Dec 2024 03:37:21 -0600 Subject: [PATCH] UI: Move Shader Compilation hint, graphics backend, and GPU manufacturer to the right side of the status bar, next to firmware version. Removed the "Game:" prefix in front of FPS. --- Directory.Packages.props | 2 +- .../LdnRyu/Proxy/P2pProxyServer.cs | 12 ++++- src/Ryujinx/AppHost.cs | 2 +- src/Ryujinx/Assets/Locales/ar_SA.json | 1 - src/Ryujinx/Assets/Locales/de_DE.json | 1 - src/Ryujinx/Assets/Locales/el_GR.json | 1 - src/Ryujinx/Assets/Locales/en_US.json | 1 - src/Ryujinx/Assets/Locales/es_ES.json | 1 - src/Ryujinx/Assets/Locales/fr_FR.json | 1 - src/Ryujinx/Assets/Locales/he_IL.json | 1 - src/Ryujinx/Assets/Locales/it_IT.json | 1 - src/Ryujinx/Assets/Locales/ja_JP.json | 1 - src/Ryujinx/Assets/Locales/ko_KR.json | 1 - src/Ryujinx/Assets/Locales/pl_PL.json | 1 - src/Ryujinx/Assets/Locales/pt_BR.json | 1 - src/Ryujinx/Assets/Locales/ru_RU.json | 1 - src/Ryujinx/Assets/Locales/th_TH.json | 1 - src/Ryujinx/Assets/Locales/tr_TR.json | 1 - src/Ryujinx/Assets/Locales/uk_UA.json | 1 - src/Ryujinx/Assets/Locales/zh_CN.json | 1 - src/Ryujinx/Assets/Locales/zh_TW.json | 1 - .../UI/ViewModels/MainWindowViewModel.cs | 10 ++--- .../UI/Views/Main/MainMenuBarView.axaml.cs | 3 +- .../UI/Views/Main/MainStatusBarView.axaml | 45 +++++++++++-------- src/Ryujinx/UI/Windows/MainWindow.axaml.cs | 7 ++- src/Ryujinx/Updater.cs | 11 +++-- 26 files changed, 52 insertions(+), 58 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ffb5f2ead..7059af0e0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs index 598fb654f..fbce5c10c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs @@ -1,3 +1,5 @@ +using Gommon; +using Humanizer; using NetCoreServer; using Open.Nat; using Ryujinx.Common.Logging; @@ -153,7 +155,10 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy if (_publicPort != 0) { - _ = Task.Delay(PortLeaseRenew * 1000, _disposedCancellation.Token).ContinueWith((task) => Task.Run(RefreshLease)); + _ = Executor.ExecuteAfterDelayAsync( + PortLeaseRenew.Seconds(), + _disposedCancellation.Token, + RefreshLease); } _natDevice = device; @@ -257,7 +262,10 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy } - _ = Task.Delay(PortLeaseRenew, _disposedCancellation.Token).ContinueWith((task) => Task.Run(RefreshLease)); + _ = Executor.ExecuteAfterDelayAsync( + PortLeaseRenew.Milliseconds(), + _disposedCancellation.Token, + RefreshLease); } public bool TryRegisterUser(P2pProxySession session, ExternalProxyConfig config) diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 5789737d6..9a7f82661 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -1137,7 +1137,7 @@ namespace Ryujinx.Ava LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%", dockedMode, ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(), - LocaleManager.Instance[LocaleKeys.Game] + $": {Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)", + $"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)", $"FIFO: {Device.Statistics.GetFifoPercent():00.00} %", _displayCount)); } diff --git a/src/Ryujinx/Assets/Locales/ar_SA.json b/src/Ryujinx/Assets/Locales/ar_SA.json index c1ee30f19..412695af6 100644 --- a/src/Ryujinx/Assets/Locales/ar_SA.json +++ b/src/Ryujinx/Assets/Locales/ar_SA.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "إضافة ملفات جديدة...", "UpdaterExtracting": "استخراج التحديث...", "UpdaterDownloading": "تحميل التحديث...", - "Game": "لعبة", "Docked": "تركيب بالمنصة", "Handheld": "محمول", "ConnectionError": "خطأ في الاتصال", diff --git a/src/Ryujinx/Assets/Locales/de_DE.json b/src/Ryujinx/Assets/Locales/de_DE.json index e3f6b1be1..76e8dfadd 100644 --- a/src/Ryujinx/Assets/Locales/de_DE.json +++ b/src/Ryujinx/Assets/Locales/de_DE.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Neue Dateien hinzufügen...", "UpdaterExtracting": "Update extrahieren...", "UpdaterDownloading": "Update herunterladen...", - "Game": "Spiel", "Docked": "Docked", "Handheld": "Handheld", "ConnectionError": "Verbindungsfehler.", diff --git a/src/Ryujinx/Assets/Locales/el_GR.json b/src/Ryujinx/Assets/Locales/el_GR.json index e93e9310a..0409297ac 100644 --- a/src/Ryujinx/Assets/Locales/el_GR.json +++ b/src/Ryujinx/Assets/Locales/el_GR.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Προσθήκη Νέων Αρχείων...", "UpdaterExtracting": "Εξαγωγή Ενημέρωσης...", "UpdaterDownloading": "Λήψη Ενημέρωσης...", - "Game": "Παιχνίδι", "Docked": "Προσκολλημένο", "Handheld": "Χειροκίνητο", "ConnectionError": "Σφάλμα Σύνδεσης.", diff --git a/src/Ryujinx/Assets/Locales/en_US.json b/src/Ryujinx/Assets/Locales/en_US.json index ee0d03171..ba183c8bd 100644 --- a/src/Ryujinx/Assets/Locales/en_US.json +++ b/src/Ryujinx/Assets/Locales/en_US.json @@ -730,7 +730,6 @@ "UpdaterAddingFiles": "Adding New Files...", "UpdaterExtracting": "Extracting Update...", "UpdaterDownloading": "Downloading Update...", - "Game": "Game", "Docked": "Docked", "Handheld": "Handheld", "ConnectionError": "Connection Error.", diff --git a/src/Ryujinx/Assets/Locales/es_ES.json b/src/Ryujinx/Assets/Locales/es_ES.json index 0a68d44c6..b473b1197 100644 --- a/src/Ryujinx/Assets/Locales/es_ES.json +++ b/src/Ryujinx/Assets/Locales/es_ES.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Añadiendo nuevos archivos...", "UpdaterExtracting": "Extrayendo actualización...", "UpdaterDownloading": "Descargando actualización...", - "Game": "Juego", "Docked": "Dock/TV", "Handheld": "Portátil", "ConnectionError": "Error de conexión.", diff --git a/src/Ryujinx/Assets/Locales/fr_FR.json b/src/Ryujinx/Assets/Locales/fr_FR.json index 471dfbe5e..0223e322e 100644 --- a/src/Ryujinx/Assets/Locales/fr_FR.json +++ b/src/Ryujinx/Assets/Locales/fr_FR.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Ajout des nouveaux fichiers...", "UpdaterExtracting": "Extraction de la mise à jour…", "UpdaterDownloading": "Téléchargement de la mise à jour...", - "Game": "Jeu", "Docked": "Mode station d'accueil", "Handheld": "Mode Portable", "ConnectionError": "Erreur de connexion.", diff --git a/src/Ryujinx/Assets/Locales/he_IL.json b/src/Ryujinx/Assets/Locales/he_IL.json index dbacf5ea1..318068bf3 100644 --- a/src/Ryujinx/Assets/Locales/he_IL.json +++ b/src/Ryujinx/Assets/Locales/he_IL.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "מוסיף קבצים חדשים...", "UpdaterExtracting": "מחלץ עדכון...", "UpdaterDownloading": "מוריד עדכון...", - "Game": "משחק", "Docked": "בתחנת עגינה", "Handheld": "נייד", "ConnectionError": "שגיאת חיבור", diff --git a/src/Ryujinx/Assets/Locales/it_IT.json b/src/Ryujinx/Assets/Locales/it_IT.json index 61ea2a355..5ca17bc2e 100644 --- a/src/Ryujinx/Assets/Locales/it_IT.json +++ b/src/Ryujinx/Assets/Locales/it_IT.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Aggiunta dei nuovi file...", "UpdaterExtracting": "Estrazione dell'aggiornamento...", "UpdaterDownloading": "Download dell'aggiornamento...", - "Game": "Gioco", "Docked": "TV", "Handheld": "Portatile", "ConnectionError": "Errore di connessione.", diff --git a/src/Ryujinx/Assets/Locales/ja_JP.json b/src/Ryujinx/Assets/Locales/ja_JP.json index 9acd1c486..ffa768c13 100644 --- a/src/Ryujinx/Assets/Locales/ja_JP.json +++ b/src/Ryujinx/Assets/Locales/ja_JP.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "新規ファイルを追加中...", "UpdaterExtracting": "アップデートを展開中...", "UpdaterDownloading": "アップデートをダウンロード中...", - "Game": "ゲーム", "Docked": "ドッキング", "Handheld": "携帯", "ConnectionError": "接続エラー.", diff --git a/src/Ryujinx/Assets/Locales/ko_KR.json b/src/Ryujinx/Assets/Locales/ko_KR.json index 86592aa69..6b7140b3c 100644 --- a/src/Ryujinx/Assets/Locales/ko_KR.json +++ b/src/Ryujinx/Assets/Locales/ko_KR.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "새 파일 추가...", "UpdaterExtracting": "업데이트 추출...", "UpdaterDownloading": "업데이트 내려받기 중...", - "Game": "게임", "Docked": "도킹", "Handheld": "휴대", "ConnectionError": "연결 오류가 발생했습니다.", diff --git a/src/Ryujinx/Assets/Locales/pl_PL.json b/src/Ryujinx/Assets/Locales/pl_PL.json index 1ed0988f9..d87453ef2 100644 --- a/src/Ryujinx/Assets/Locales/pl_PL.json +++ b/src/Ryujinx/Assets/Locales/pl_PL.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Dodawanie Nowych Plików...", "UpdaterExtracting": "Wypakowywanie Aktualizacji...", "UpdaterDownloading": "Pobieranie Aktualizacji...", - "Game": "Gra", "Docked": "Zadokowany", "Handheld": "Przenośny", "ConnectionError": "Błąd Połączenia.", diff --git a/src/Ryujinx/Assets/Locales/pt_BR.json b/src/Ryujinx/Assets/Locales/pt_BR.json index 676d89d96..c240bd804 100644 --- a/src/Ryujinx/Assets/Locales/pt_BR.json +++ b/src/Ryujinx/Assets/Locales/pt_BR.json @@ -717,7 +717,6 @@ "UpdaterAddingFiles": "Adicionando novos arquivos...", "UpdaterExtracting": "Extraíndo atualização...", "UpdaterDownloading": "Baixando atualização...", - "Game": "Jogo", "Docked": "TV", "Handheld": "Portátil", "ConnectionError": "Erro de conexão.", diff --git a/src/Ryujinx/Assets/Locales/ru_RU.json b/src/Ryujinx/Assets/Locales/ru_RU.json index ea4dcc8c8..1046208fb 100644 --- a/src/Ryujinx/Assets/Locales/ru_RU.json +++ b/src/Ryujinx/Assets/Locales/ru_RU.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Добавление новых файлов...", "UpdaterExtracting": "Извлечение обновления...", "UpdaterDownloading": "Загрузка обновления...", - "Game": "Игра", "Docked": "Стационарный режим", "Handheld": "Портативный режим", "ConnectionError": "Ошибка соединения", diff --git a/src/Ryujinx/Assets/Locales/th_TH.json b/src/Ryujinx/Assets/Locales/th_TH.json index fa4c1d334..e29004e10 100644 --- a/src/Ryujinx/Assets/Locales/th_TH.json +++ b/src/Ryujinx/Assets/Locales/th_TH.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "กำลังเพิ่มไฟล์ใหม่...", "UpdaterExtracting": "กำลังแยกการอัปเดต...", "UpdaterDownloading": "กำลังดาวน์โหลดอัปเดต...", - "Game": "เกมส์", "Docked": "ด็อก", "Handheld": "แฮนด์เฮลด์", "ConnectionError": "การเชื่อมต่อล้มเหลว", diff --git a/src/Ryujinx/Assets/Locales/tr_TR.json b/src/Ryujinx/Assets/Locales/tr_TR.json index 475086e44..101206210 100644 --- a/src/Ryujinx/Assets/Locales/tr_TR.json +++ b/src/Ryujinx/Assets/Locales/tr_TR.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Yeni Dosyalar Ekleniyor...", "UpdaterExtracting": "Güncelleme Ayrıştırılıyor...", "UpdaterDownloading": "Güncelleme İndiriliyor...", - "Game": "Oyun", "Docked": "Docked", "Handheld": "El tipi", "ConnectionError": "Bağlantı Hatası.", diff --git a/src/Ryujinx/Assets/Locales/uk_UA.json b/src/Ryujinx/Assets/Locales/uk_UA.json index 68679a9b2..89e565bf3 100644 --- a/src/Ryujinx/Assets/Locales/uk_UA.json +++ b/src/Ryujinx/Assets/Locales/uk_UA.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "Додавання нових файлів...", "UpdaterExtracting": "Видобування оновлення...", "UpdaterDownloading": "Завантаження оновлення...", - "Game": "Гра", "Docked": "Док-станція", "Handheld": "Портативний", "ConnectionError": "Помилка з'єднання.", diff --git a/src/Ryujinx/Assets/Locales/zh_CN.json b/src/Ryujinx/Assets/Locales/zh_CN.json index 741b5b370..66ac309de 100644 --- a/src/Ryujinx/Assets/Locales/zh_CN.json +++ b/src/Ryujinx/Assets/Locales/zh_CN.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "安装更新中...", "UpdaterExtracting": "正在提取更新...", "UpdaterDownloading": "下载更新中...", - "Game": "游戏", "Docked": "主机模式", "Handheld": "掌机模式", "ConnectionError": "连接错误。", diff --git a/src/Ryujinx/Assets/Locales/zh_TW.json b/src/Ryujinx/Assets/Locales/zh_TW.json index aaf8170c0..792ced42b 100644 --- a/src/Ryujinx/Assets/Locales/zh_TW.json +++ b/src/Ryujinx/Assets/Locales/zh_TW.json @@ -718,7 +718,6 @@ "UpdaterAddingFiles": "正在加入新檔案...", "UpdaterExtracting": "正在提取更新...", "UpdaterDownloading": "正在下載更新...", - "Game": "遊戲", "Docked": "底座模式", "Handheld": "手提模式", "ConnectionError": "連線錯誤。", diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index 3672f8c71..1bfcd439b 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -70,7 +70,7 @@ namespace Ryujinx.Ava.UI.ViewModels private string _gpuStatusText; private string _shaderCountText; private bool _isAmiiboRequested; - private bool _showRightmostSeparator; + private bool _showShaderCompilationHint; private bool _isGameRunning; private bool _isFullScreen; private int _progressMaximum; @@ -275,12 +275,12 @@ namespace Ryujinx.Ava.UI.ViewModels public bool ShowFirmwareStatus => !ShowLoadProgress; - public bool ShowRightmostSeparator + public bool ShowShaderCompilationHint { - get => _showRightmostSeparator; + get => _showShaderCompilationHint; set { - _showRightmostSeparator = value; + _showShaderCompilationHint = value; OnPropertyChanged(); } @@ -1497,7 +1497,7 @@ namespace Ryujinx.Ava.UI.ViewModels VolumeStatusText = args.VolumeStatus; FifoStatusText = args.FifoStatus; - ShaderCountText = (ShowRightmostSeparator = args.ShaderCount > 0) + ShaderCountText = (ShowShaderCompilationHint = args.ShaderCount > 0) ? $"{LocaleManager.Instance[LocaleKeys.CompilingShaders]}: {args.ShaderCount}" : string.Empty; diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index 41b27e9c1..a3aa58f2c 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -200,7 +200,6 @@ namespace Ryujinx.Ava.UI.Views.Main await Dispatcher.UIThread.InvokeAsync(() => { - ViewModel.WindowState = WindowState.Normal; Window.Arrange(new Rect(Window.Position.X, Window.Position.Y, windowWidthScaled, windowHeightScaled)); @@ -210,7 +209,7 @@ namespace Ryujinx.Ava.UI.Views.Main public async void CheckForUpdates(object sender, RoutedEventArgs e) { if (Updater.CanUpdate(true)) - await Window.BeginUpdateAsync(true); + await Updater.BeginUpdateAsync(true); } public async void OpenXCITrimmerWindow(object sender, RoutedEventArgs e) => await XCITrimmerWindow.Show(ViewModel); diff --git a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml index 597cf10e1..6e72a8b4b 100644 --- a/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml +++ b/src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml @@ -23,7 +23,7 @@ Background="{DynamicResource ThemeContentBackgroundColor}" DockPanel.Dock="Bottom" IsVisible="{Binding ShowMenuAndStatusBar}" - ColumnDefinitions="Auto,Auto,*,Auto"> + ColumnDefinitions="Auto,Auto,*,Auto,Auto"> + + + + IsVisible="{Binding ShowShaderCompilationHint}" /> + + - - - + IsVisible="{Binding IsGameRunning}" /> diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index 059f99a60..09c8b9448 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -7,6 +7,7 @@ using Avalonia.Threading; using DynamicData; using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Windowing; +using Gommon; using LibHac.Tools.FsSystem; using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; @@ -387,10 +388,8 @@ namespace Ryujinx.Ava.UI.Windows if (ConfigurationState.Instance.CheckUpdatesOnStart && !CommandLineState.HideAvailableUpdates && Updater.CanUpdate()) { - await this.BeginUpdateAsync() - .ContinueWith( - task => Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}"), - TaskContinuationOptions.OnlyOnFaulted); + await Updater.BeginUpdateAsync() + .Catch(task => Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}")); } } diff --git a/src/Ryujinx/Updater.cs b/src/Ryujinx/Updater.cs index bdb44d668..6a1701208 100644 --- a/src/Ryujinx/Updater.cs +++ b/src/Ryujinx/Updater.cs @@ -1,4 +1,3 @@ -using Avalonia.Controls; using Avalonia.Threading; using FluentAvalonia.UI.Controls; using Gommon; @@ -51,7 +50,7 @@ namespace Ryujinx.Ava private static readonly string[] _windowsDependencyDirs = []; - public static async Task BeginUpdateAsync(this Window mainWindow, bool showVersionUpToDate = false) + public static async Task BeginUpdateAsync(bool showVersionUpToDate = false) { if (_running) { @@ -225,7 +224,7 @@ namespace Ryujinx.Ava ? $"Canary {currentVersion} -> Canary {newVersion}" : $"{currentVersion} -> {newVersion}"; - RequestUserToUpdate: + RequestUserToUpdate: // Show a message asking the user if they want to update UserResult shouldUpdate = await ContentDialogHelper.CreateUpdaterChoiceDialog( LocaleManager.Instance[LocaleKeys.RyujinxUpdater], @@ -235,7 +234,7 @@ namespace Ryujinx.Ava switch (shouldUpdate) { case UserResult.Yes: - await UpdateRyujinx(mainWindow, _buildUrl); + await UpdateRyujinx(_buildUrl); break; // Secondary button maps to no, which in this case is the show changelog button. case UserResult.No: @@ -258,7 +257,7 @@ namespace Ryujinx.Ava return result; } - private static async Task UpdateRyujinx(Window parent, string downloadUrl) + private static async Task UpdateRyujinx(string downloadUrl) { _updateSuccessful = false; @@ -278,7 +277,7 @@ namespace Ryujinx.Ava SubHeader = LocaleManager.Instance[LocaleKeys.UpdaterDownloading], IconSource = new SymbolIconSource { Symbol = Symbol.Download }, ShowProgressBar = true, - XamlRoot = parent, + XamlRoot = App.MainWindow, }; taskDialog.Opened += (s, e) =>