diff --git a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs index 33e6c4aad..9591880b0 100644 --- a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs @@ -928,6 +928,12 @@ namespace Ryujinx.Ui.App.Common { updatePath = JsonHelper.DeserializeFromFile(titleUpdateMetadataPath, _titleSerializerContext.TitleUpdateMetadata).Selected; + if (!string.IsNullOrWhiteSpace(updatePath) + && !File.Exists(updatePath)) + { + Logger.Warning?.Print(LogClass.Loader, $"Update file {updatePath} for titleId: {titleId} was not found! Game saves can become corrupted!"); + } + if (File.Exists(updatePath)) { FileStream file = new(updatePath, FileMode.Open, FileAccess.Read); diff --git a/src/Ryujinx/Ui/MainWindow.cs b/src/Ryujinx/Ui/MainWindow.cs index f4817277d..e20f96d15 100644 --- a/src/Ryujinx/Ui/MainWindow.cs +++ b/src/Ryujinx/Ui/MainWindow.cs @@ -896,6 +896,11 @@ namespace Ryujinx.Ui } else { + if (!CheckGameUpdatesPresent()) + { + return; + } + PerformanceCheck(); Logger.RestartTime(); @@ -959,6 +964,36 @@ namespace Ryujinx.Ui } } + private bool CheckGameUpdatesPresent() + { + bool gameUpdateStatusCheck = true; + + _gameTableSelection.GetSelected(out TreeIter treeIter); + string titleId = _tableStore.GetValue(treeIter, 2).ToString().Split("\n")[1].ToLower(); + + (Nca patchNca, _) = ApplicationLibrary.GetGameUpdateData(_virtualFileSystem, titleId, 0, out string updatePath); + + if (!string.IsNullOrWhiteSpace(updatePath) + && patchNca is null) + { + MessageDialog updateMissingWarningDialog = new(this, DialogFlags.Modal, MessageType.Warning, ButtonsType.YesNo, null) + { + Title = "Ryujinx - Warning", + Text = "Update file for this title was not found!", + SecondaryText = "Game saves may be incompatible with this version or become corrupted. Do you wish to load the application anyway?", + }; + + if (updateMissingWarningDialog.Run() == (int)ResponseType.No) + { + gameUpdateStatusCheck = false; + } + + updateMissingWarningDialog.Dispose(); + } + + return gameUpdateStatusCheck; + } + private RendererWidgetBase CreateRendererWidget() { if (ConfigurationState.Instance.Graphics.GraphicsBackend == GraphicsBackend.Vulkan) diff --git a/src/Ryujinx/Ui/Windows/TitleUpdateWindow.cs b/src/Ryujinx/Ui/Windows/TitleUpdateWindow.cs index 044f7e95a..c276186db 100644 --- a/src/Ryujinx/Ui/Windows/TitleUpdateWindow.cs +++ b/src/Ryujinx/Ui/Windows/TitleUpdateWindow.cs @@ -86,6 +86,12 @@ namespace Ryujinx.Ui.Windows private void AddUpdate(string path) { + if (!File.Exists(path)) + { + GtkDialog.CreateErrorDialog($"Update file {path} was not found! Current game saves can become corrupted!"); + return; + } + if (File.Exists(path)) { using FileStream file = new(path, FileMode.Open, FileAccess.Read);