mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 17:49:01 +00:00
Added INI setting for Discord Rich Presence
This commit is contained in:
parent
678f8da95b
commit
d9351a5b45
5 changed files with 27 additions and 0 deletions
|
@ -18,6 +18,9 @@ namespace Discord
|
|||
void Init()
|
||||
{
|
||||
#ifdef USE_DISCORD_PRESENCE
|
||||
if (!SConfig::GetInstance().bUseDiscordPresence)
|
||||
return;
|
||||
|
||||
DiscordEventHandlers handlers = {};
|
||||
// The number is the client ID for Dolphin, it's used for images and the appication name
|
||||
Discord_Initialize("450033159212630028", &handlers, 1, nullptr);
|
||||
|
@ -28,6 +31,9 @@ void Init()
|
|||
void UpdateDiscordPresence()
|
||||
{
|
||||
#ifdef USE_DISCORD_PRESENCE
|
||||
if (!SConfig::GetInstance().bUseDiscordPresence)
|
||||
return;
|
||||
|
||||
const std::string& title = SConfig::GetInstance().GetTitleDescription();
|
||||
|
||||
DiscordRichPresence discord_presence = {};
|
||||
|
@ -42,6 +48,9 @@ void UpdateDiscordPresence()
|
|||
void Shutdown()
|
||||
{
|
||||
#ifdef USE_DISCORD_PRESENCE
|
||||
if (!SConfig::GetInstance().bUseDiscordPresence)
|
||||
return;
|
||||
|
||||
Discord_Shutdown();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue