From bf5c2371a270b65b434f3af2428207f9613c77c7 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 15 Oct 2019 14:39:26 -0400 Subject: [PATCH] qt: Add question when booting XCI to import archives Adds convenience. --- src/yuzu/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d6bb18d24a..89df1a612d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -897,6 +897,23 @@ bool GMainWindow::LoadROM(const QString& filename) { "wiki. This message will not be shown again.")); } + const auto no_imported = + system.GetFileSystemController().GetSysdataImportedDirectory()->GetFiles().empty(); + + if (result == Core::System::ResultStatus::Success && + system.GetAppLoader().GetFileType() == Loader::FileType::XCI && no_imported) { + if (QMessageBox::question(this, tr("Import System Archives"), + tr("The game type you are using includes additional system files " + "that may improve yuzu's compatibility with this and other " + "games. Would you like to import these files?")) == + QMessageBox::Yes) { + const auto game = Core::GetGameFileFromPath(vfs, filename.toStdString()); + FileSys::XCI xci{game}; + FileSys::SystemArchive::ImportXCISystemUpdate( + system.GetFileSystemController().GetSysdataImportedDirectory(), xci); + } + } + if (result != Core::System::ResultStatus::Success) { switch (result) { case Core::System::ResultStatus::ErrorGetLoader: