mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-12 21:59:12 +00:00
Check if game update exists before loading the application.
This commit is contained in:
parent
1e06b28b22
commit
cef2ad455b
3 changed files with 47 additions and 0 deletions
|
@ -928,6 +928,12 @@ namespace Ryujinx.Ui.App.Common
|
||||||
{
|
{
|
||||||
updatePath = JsonHelper.DeserializeFromFile(titleUpdateMetadataPath, _titleSerializerContext.TitleUpdateMetadata).Selected;
|
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))
|
if (File.Exists(updatePath))
|
||||||
{
|
{
|
||||||
FileStream file = new(updatePath, FileMode.Open, FileAccess.Read);
|
FileStream file = new(updatePath, FileMode.Open, FileAccess.Read);
|
||||||
|
|
|
@ -896,6 +896,11 @@ namespace Ryujinx.Ui
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!CheckGameUpdatesPresent())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PerformanceCheck();
|
PerformanceCheck();
|
||||||
|
|
||||||
Logger.RestartTime();
|
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()
|
private RendererWidgetBase CreateRendererWidget()
|
||||||
{
|
{
|
||||||
if (ConfigurationState.Instance.Graphics.GraphicsBackend == GraphicsBackend.Vulkan)
|
if (ConfigurationState.Instance.Graphics.GraphicsBackend == GraphicsBackend.Vulkan)
|
||||||
|
|
|
@ -86,6 +86,12 @@ namespace Ryujinx.Ui.Windows
|
||||||
|
|
||||||
private void AddUpdate(string path)
|
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))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
using FileStream file = new(path, FileMode.Open, FileAccess.Read);
|
using FileStream file = new(path, FileMode.Open, FileAccess.Read);
|
||||||
|
|
Loading…
Reference in a new issue