mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2026-01-12 02:31:08 +00:00
Updated LoadAndSaveMetadata to return Optional type (but for real this time)
- fixed a typo i found - awaiting dialog on invalid unpacked error -
This commit is contained in:
parent
34190c9184
commit
2274a32813
6 changed files with 17 additions and 10 deletions
|
|
@ -1059,7 +1059,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
}
|
||||
}
|
||||
|
||||
public static bool AreKeysAlredyPresent(string pathToCheck)
|
||||
public static bool AreKeysAlreadyPresent(string pathToCheck)
|
||||
{
|
||||
string[] fileNames = ["prod.keys", "title.keys", "console.keys", "dev.keys"];
|
||||
foreach (string file in fileNames)
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ namespace Ryujinx.Ava.Systems
|
|||
|
||||
if (!Device.LoadCart(ApplicationPath, romFsFiles[0]))
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(
|
||||
await ContentDialogHelper.CreateErrorDialog(
|
||||
"Please specify an unpacked game directory with a valid exefs or NSO/NRO.");
|
||||
Device.Dispose();
|
||||
|
||||
|
|
@ -816,7 +816,7 @@ namespace Ryujinx.Ava.Systems
|
|||
Logger.Info?.Print(LogClass.Application, "Loading as cart WITHOUT RomFS.");
|
||||
if (!Device.LoadCart(ApplicationPath))
|
||||
{
|
||||
ContentDialogHelper.CreateErrorDialog(
|
||||
await ContentDialogHelper.CreateErrorDialog(
|
||||
"Please specify an unpacked game directory with a valid exefs or NSO/NRO.");
|
||||
Device.Dispose();
|
||||
cts.Cancel();
|
||||
|
|
|
|||
|
|
@ -849,7 +849,8 @@ namespace Ryujinx.Ava.Systems.AppLibrary
|
|||
|
||||
foreach (ApplicationData installedApplication in Applications.Items)
|
||||
{
|
||||
temporary += LoadAndSaveMetaData(installedApplication.IdString).TimePlayed;
|
||||
// this should always exist... should...
|
||||
temporary += LoadAndSaveMetaData(installedApplication.IdString).Value.TimePlayed;
|
||||
}
|
||||
|
||||
TotalTimePlayed = temporary;
|
||||
|
|
@ -1159,9 +1160,8 @@ namespace Ryujinx.Ava.Systems.AppLibrary
|
|||
ApplicationCountUpdated?.Invoke(null, e);
|
||||
}
|
||||
|
||||
public static ApplicationMetadata? LoadAndSaveMetaData(string titleId, Action<ApplicationMetadata> modifyFunction = null)
|
||||
public static Gommon.Optional<ApplicationMetadata> LoadAndSaveMetaData(string titleId, Action<ApplicationMetadata> modifyFunction = null)
|
||||
{
|
||||
|
||||
if (titleId is null)
|
||||
{
|
||||
Logger.Warning?.PrintMsg(LogClass.Application, "Cannot save metadata because title ID is invalid.");
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace Ryujinx.Ava.Systems
|
|||
|
||||
public static void Use(Optional<string> titleId)
|
||||
{
|
||||
if (titleId.TryGet(out string tid))
|
||||
if (titleId.TryGet(out string tid) && Switch.Shared.Processes.ActiveApplication is not null)
|
||||
SwitchToPlayingState(
|
||||
ApplicationLibrary.LoadAndSaveMetaData(tid),
|
||||
Switch.Shared.Processes.ActiveApplication
|
||||
|
|
|
|||
|
|
@ -57,8 +57,15 @@ namespace Ryujinx.Ava.UI.Models
|
|||
}
|
||||
else
|
||||
{
|
||||
ApplicationMetadata appMetadata = ApplicationLibrary.LoadAndSaveMetaData(TitleIdString);
|
||||
Title = appMetadata.Title ?? TitleIdString;
|
||||
Gommon.Optional<ApplicationMetadata> appMetadata = ApplicationLibrary.LoadAndSaveMetaData(TitleIdString);
|
||||
if (appMetadata != null)
|
||||
{
|
||||
Title = appMetadata.Value.Title ?? TitleIdString;
|
||||
}
|
||||
else
|
||||
{
|
||||
Title = "<INVALID>";
|
||||
}
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
|
|
|
|||
|
|
@ -1029,7 +1029,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
string dialogMessage =
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogKeysInstallerKeysInstallMessage);
|
||||
|
||||
if (ContentManager.AreKeysAlredyPresent(systemDirectory))
|
||||
if (ContentManager.AreKeysAlreadyPresent(systemDirectory))
|
||||
{
|
||||
dialogMessage +=
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys
|
||||
|
|
|
|||
Loading…
Reference in a new issue