misc: Refactor Discord integration to listen on TitleIDs.CurrentApplication changes instead of waiting to be directly told when to change states.

This commit is contained in:
Evan Husted 2024-12-29 03:27:05 -06:00
parent 1dd69912b1
commit f463ea1c5d
6 changed files with 45 additions and 9 deletions

View file

@ -8,7 +8,20 @@ namespace Ryujinx.Common
{
public static class TitleIDs
{
public static Optional<string> CurrentApplication { get; set; }
private static string _currentApplication;
public static Optional<string> CurrentApplication
{
get => _currentApplication;
set
{
_currentApplication = value.OrElse(null);
CurrentApplicationChanged?.Invoke(_currentApplication);
}
}
public static event Action<Optional<string>> CurrentApplicationChanged;
public static GraphicsBackend SelectGraphicsBackend(string titleId, GraphicsBackend currentBackend)
{