Make sure to dispose the Discord module and use GTK quit method
Also update Discord Precense when closing a game.
This commit is contained in:
parent
34d98d7da0
commit
d5eec13284
3 changed files with 22 additions and 2 deletions
|
@ -161,7 +161,6 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
TimeManager.Instance.InitializeTimeZone(device);
|
TimeManager.Instance.InitializeTimeZone(device);
|
||||||
device.System.Font.Initialize(this);
|
device.System.Font.Initialize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,5 +88,23 @@ namespace Ryujinx.Configuration
|
||||||
|
|
||||||
DiscordClient?.SetPresence(DiscordPresence);
|
DiscordClient?.SetPresence(DiscordPresence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SwitchToMainMenu()
|
||||||
|
{
|
||||||
|
DiscordPresence.Details = "Main Menu";
|
||||||
|
DiscordPresence.State = "Idling";
|
||||||
|
DiscordPresence.Assets.LargeImageKey = "ryujinx";
|
||||||
|
DiscordPresence.Assets.LargeImageText = LargeDescription;
|
||||||
|
DiscordPresence.Assets.SmallImageKey = null;
|
||||||
|
DiscordPresence.Assets.SmallImageText = null;
|
||||||
|
DiscordPresence.Timestamps = new Timestamps(DateTime.UtcNow);
|
||||||
|
|
||||||
|
DiscordClient?.SetPresence(DiscordPresence);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Exit()
|
||||||
|
{
|
||||||
|
DiscordClient?.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,6 +335,8 @@ namespace Ryujinx.Ui
|
||||||
_screen = null;
|
_screen = null;
|
||||||
_gameLoaded = false;
|
_gameLoaded = false;
|
||||||
|
|
||||||
|
DiscordIntegrationModule.SwitchToMainMenu();
|
||||||
|
|
||||||
Application.Invoke(delegate
|
Application.Invoke(delegate
|
||||||
{
|
{
|
||||||
_stopEmulation.Sensitive = false;
|
_stopEmulation.Sensitive = false;
|
||||||
|
@ -373,8 +375,9 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
Profile.FinishProfiling();
|
Profile.FinishProfiling();
|
||||||
device?.Dispose();
|
device?.Dispose();
|
||||||
|
DiscordIntegrationModule.Exit();
|
||||||
Logger.Shutdown();
|
Logger.Shutdown();
|
||||||
Environment.Exit(0);
|
Application.Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IRenderer InitializeRenderer()
|
private static IRenderer InitializeRenderer()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue