AutoLoad DLC/updates (#12)

* Add hooks to ApplicationLibrary for loading DLC/updates

* Trigger DLC/update load on games refresh

* Initial moving of DLC/updates to UI.Common

* Use new models in ApplicationLibrary

* Make dlc/updates records; use ApplicationLibrary for loading logic

* Fix a bug with DLC window; rework some logic

* Auto-load bundled DLC on startup

* Autoload DLC

* Add setting for autoloading dlc/updates

* Remove dead code; bind to AppLibrary apps directly in mainwindow

* Stub out bulk dlc menu item

* Add localization; stub out bulk load updates

* Set autoload dirs explicitly

* Begin extracting updates to match DLC refactors

* Add title update autoloading

* Reduce size of settings sections

* Better cache lookup for apps

* Dont reload entire library on game version change

* Remove ApplicationAdded event; always enumerate nsp when autoloading
This commit is contained in:
Jimmy Reichley
2024-10-07 21:08:41 -04:00
committed by GitHub
parent 9a1863c752
commit 565acec468
30 changed files with 1509 additions and 459 deletions

View File

@ -3,11 +3,10 @@ using Avalonia.Interactivity;
using Avalonia.Styling;
using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.HLE.FileSystem;
using Ryujinx.UI.App.Common;
using Ryujinx.UI.Common.Helper;
using Ryujinx.UI.Common.Models;
using System.Threading.Tasks;
namespace Ryujinx.Ava.UI.Windows
@ -23,21 +22,21 @@ namespace Ryujinx.Ava.UI.Windows
InitializeComponent();
}
public DownloadableContentManagerWindow(VirtualFileSystem virtualFileSystem, ApplicationData applicationData)
public DownloadableContentManagerWindow(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{
DataContext = ViewModel = new DownloadableContentManagerViewModel(virtualFileSystem, applicationData);
DataContext = ViewModel = new DownloadableContentManagerViewModel(applicationLibrary, applicationData);
InitializeComponent();
}
public static async Task Show(VirtualFileSystem virtualFileSystem, ApplicationData applicationData)
public static async Task Show(ApplicationLibrary applicationLibrary, ApplicationData applicationData)
{
ContentDialog contentDialog = new()
{
PrimaryButtonText = "",
SecondaryButtonText = "",
CloseButtonText = "",
Content = new DownloadableContentManagerWindow(virtualFileSystem, applicationData),
Content = new DownloadableContentManagerWindow(applicationLibrary, applicationData),
Title = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowTitle], applicationData.Name, applicationData.IdBaseString),
};
@ -88,12 +87,7 @@ namespace Ryujinx.Ava.UI.Windows
{
if (content is DownloadableContentModel model)
{
var index = ViewModel.DownloadableContents.IndexOf(model);
if (index != -1)
{
ViewModel.DownloadableContents[index].Enabled = true;
}
ViewModel.Enable(model);
}
}
@ -101,12 +95,7 @@ namespace Ryujinx.Ava.UI.Windows
{
if (content is DownloadableContentModel model)
{
var index = ViewModel.DownloadableContents.IndexOf(model);
if (index != -1)
{
ViewModel.DownloadableContents[index].Enabled = false;
}
ViewModel.Disable(model);
}
}
}