don't update discord rich presence from retroachievements when paused

This commit is contained in:
Jamiras 2020-09-27 14:35:17 -06:00
parent edf8fd99c7
commit 8bc02e2df2
2 changed files with 10 additions and 3 deletions

View File

@ -29,7 +29,6 @@ enum discord_presence
DISCORD_PRESENCE_MENU,
DISCORD_PRESENCE_GAME,
DISCORD_PRESENCE_GAME_PAUSED,
DISCORD_PRESENCE_CHEEVO_UNLOCKED,
DISCORD_PRESENCE_NETPLAY_HOSTING,
DISCORD_PRESENCE_NETPLAY_CLIENT,
DISCORD_PRESENCE_NETPLAY_NETPLAY_STOPPED,

View File

@ -8995,7 +8995,7 @@ void discord_update(enum discord_presence presence)
discord_st->presence.details = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED);
discord_st->pause_time = time(0);
discord_st->elapsed_time = difftime(time(0),
discord_st->elapsed_time = difftime(discord_st->pause_time,
discord_st->start_time);
discord_st->presence.startTimestamp = discord_st->pause_time;
break;
@ -9045,7 +9045,12 @@ void discord_update(enum discord_presence presence)
discord_st->presence.smallImageText = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING);
discord_st->presence.startTimestamp = discord_st->start_time;
discord_st->presence.details = msg_hash_to_str(
#ifdef HAVE_CHEEVOS
discord_st->presence.details = rcheevos_get_richpresence();
if (!discord_st->presence.details || !*discord_st->presence.details)
#endif
discord_st->presence.details = msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
discord_st->presence.state = label;
@ -9116,6 +9121,9 @@ void discord_update(enum discord_presence presence)
break;
#ifdef HAVE_CHEEVOS
case DISCORD_PRESENCE_RETROACHIEVEMENTS:
if (discord_st->pause_time)
return;
discord_st->presence.details = rcheevos_get_richpresence();
presence = DISCORD_PRESENCE_GAME;
break;