Call EnsureApplicationSaveData when launching a game (#871)

* Workaround for the lack of a program registry

* Call EnsureApplicationSaveData when launching a game
This commit is contained in:
Alex Barney 2020-01-12 04:15:17 -07:00 committed by Thog
parent 9c8d48edff
commit e348f95495
5 changed files with 85 additions and 14 deletions

View file

@ -307,10 +307,10 @@ namespace Ryujinx.Ui
string titleNameSection = string.IsNullOrWhiteSpace(_device.System.TitleName) ? string.Empty
: " | " + _device.System.TitleName;
string titleIDSection = string.IsNullOrWhiteSpace(_device.System.TitleId) ? string.Empty
: " | " + _device.System.TitleId.ToUpper();
string titleIdSection = string.IsNullOrWhiteSpace(_device.System.TitleIdText) ? string.Empty
: " | " + _device.System.TitleIdText.ToUpper();
_newTitle = $"Ryujinx{titleNameSection}{titleIDSection} | Host FPS: {hostFps:0.0} | Game FPS: {gameFps:0.0} | " +
_newTitle = $"Ryujinx{titleNameSection}{titleIdSection} | Host FPS: {hostFps:0.0} | Game FPS: {gameFps:0.0} | " +
$"Game Vsync: {(_device.EnableDeviceVsync ? "On" : "Off")}";
_titleEvent = true;

View file

@ -305,9 +305,9 @@ namespace Ryujinx.Ui
_firmwareInstallFile.Sensitive = false;
_firmwareInstallDirectory.Sensitive = false;
DiscordIntegrationModule.SwitchToPlayingState(_device.System.TitleId, _device.System.TitleName);
DiscordIntegrationModule.SwitchToPlayingState(_device.System.TitleIdText, _device.System.TitleName);
ApplicationLibrary.LoadAndSaveMetaData(_device.System.TitleId, appMetadata =>
ApplicationLibrary.LoadAndSaveMetaData(_device.System.TitleIdText, appMetadata =>
{
appMetadata.LastPlayed = DateTime.UtcNow.ToString();
});
@ -337,7 +337,7 @@ namespace Ryujinx.Ui
if (_gameLoaded)
{
ApplicationLibrary.LoadAndSaveMetaData(_device.System.TitleId, appMetadata =>
ApplicationLibrary.LoadAndSaveMetaData(_device.System.TitleIdText, appMetadata =>
{
DateTime lastPlayedDateTime = DateTime.Parse(appMetadata.LastPlayed);
double sessionTimePlayed = DateTime.UtcNow.Subtract(lastPlayedDateTime).TotalSeconds;