diff options
author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2024-07-19 18:00:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 19:00:15 +0200 |
commit | 2cb80f37d42261bb583e518eb729b62a442cdb15 (patch) | |
tree | 8630ea2fc8cfe68ee6a06385758c0d4d1f44b04b | |
parent | 827069e78428669833f220d47f08ec557fc20278 (diff) |
Ava UI: Auto select newly added updates & DLC (#7026)1.1.1354
* Fix DLC not being selected
* FIx conflicts
* Apply suggestions from code review
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
---------
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
-rw-r--r-- | src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs | 2 | ||||
-rw-r--r-- | src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs index 0f500513..6af40045 100644 --- a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs @@ -263,7 +263,7 @@ namespace Ryujinx.Ava.UI.ViewModels var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true); DownloadableContents.Add(content); - SelectedDownloadableContents.Add(content); + Dispatcher.UIThread.InvokeAsync(() => SelectedDownloadableContents.Add(content)); success = true; } diff --git a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs index 6c38edb3..6382e5ae 100644 --- a/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/TitleUpdateViewModel.cs @@ -169,7 +169,7 @@ namespace Ryujinx.Ava.UI.ViewModels } } - private void AddUpdate(string path, bool ignoreNotFound = false) + private void AddUpdate(string path, bool ignoreNotFound = false, bool selected = false) { if (!File.Exists(path) || TitleUpdates.Any(x => x.Path == path)) { @@ -204,7 +204,13 @@ namespace Ryujinx.Ava.UI.ViewModels controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure(); nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure(); - TitleUpdates.Add(new TitleUpdateModel(controlData, path)); + var update = new TitleUpdateModel(controlData, path); + TitleUpdates.Add(update); + + if (selected) + { + Dispatcher.UIThread.InvokeAsync(() => SelectedUpdate = update); + } } else { @@ -245,7 +251,7 @@ namespace Ryujinx.Ava.UI.ViewModels foreach (var file in result) { - AddUpdate(file.Path.LocalPath); + AddUpdate(file.Path.LocalPath, selected: true); } SortUpdates(); |