mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
discord: added additional discord events and other improvements
This commit is contained in:
parent
f130b261f4
commit
a0cf6b6b5e
@ -2477,6 +2477,13 @@ TODO: Add a setting for these tweaks */
|
||||
|
||||
if (!is_idle)
|
||||
video_driver_cached_frame();
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
discord_userdata_t userdata;
|
||||
userdata.status = DISCORD_PRESENCE_GAME_PAUSED;
|
||||
|
||||
command_event(CMD_EVENT_DISCORD_UPDATE, &userdata);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -25,11 +25,15 @@
|
||||
|
||||
#include "../msg_hash.h"
|
||||
|
||||
static const char* APPLICATION_ID = "475456035851599874";
|
||||
//static const char* APPLICATION_ID = "475456035851599874";
|
||||
static const char* APPLICATION_ID = "479875712363528207";
|
||||
static int FrustrationLevel = 0;
|
||||
|
||||
static int64_t start_time = 0;
|
||||
static int64_t pause_time = 0;
|
||||
|
||||
static bool discord_ready = false;
|
||||
static bool in_menu = false;
|
||||
static unsigned discord_status = 0;
|
||||
|
||||
DiscordRichPresence discord_presence;
|
||||
@ -76,6 +80,9 @@ void discord_update(enum discord_presence presence)
|
||||
{
|
||||
rarch_system_info_t *system = runloop_get_system_info();
|
||||
core_info_t *core_info = NULL;
|
||||
bool skip = false;
|
||||
|
||||
core_info_get_current_core(&core_info);
|
||||
|
||||
if (!discord_ready)
|
||||
return;
|
||||
@ -85,25 +92,33 @@ void discord_update(enum discord_presence presence)
|
||||
(discord_status == presence))
|
||||
return;
|
||||
|
||||
RARCH_LOG("[Discord] updating (%d)\n", presence);
|
||||
|
||||
memset(&discord_presence, 0, sizeof(discord_presence));
|
||||
|
||||
switch (presence)
|
||||
{
|
||||
case DISCORD_PRESENCE_MENU:
|
||||
discord_presence.state = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU);
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU);
|
||||
discord_presence.largeImageKey = "base";
|
||||
discord_presence.largeImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
|
||||
discord_presence.instance = 0;
|
||||
discord_presence.startTimestamp = start_time;
|
||||
|
||||
in_menu = true;
|
||||
break;
|
||||
case DISCORD_PRESENCE_GAME_PAUSED:
|
||||
discord_presence.smallImageKey = "paused";
|
||||
discord_presence.smallImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED);
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED);
|
||||
|
||||
pause_time = time(0);
|
||||
skip = true;
|
||||
|
||||
if (in_menu)
|
||||
break;
|
||||
case DISCORD_PRESENCE_GAME:
|
||||
core_info_get_current_core(&core_info);
|
||||
|
||||
if (core_info)
|
||||
{
|
||||
const char *system_name = string_replace_substring(
|
||||
string_to_lower(core_info->core_name), " ", "_");
|
||||
const char *core_name = core_info->core_name ? core_info->core_name : "core";
|
||||
const char *system_name = string_replace_substring(string_to_lower((char *)core_name), " ", "_");
|
||||
|
||||
char *label = NULL;
|
||||
playlist_t *current_playlist = playlist_get_cached();
|
||||
@ -114,20 +129,69 @@ void discord_update(enum discord_presence presence)
|
||||
|
||||
if (!label)
|
||||
label = (char *)path_basename(path_get(RARCH_PATH_BASENAME));
|
||||
|
||||
start_time = time(0);
|
||||
discord_presence.state = core_info->display_name;
|
||||
discord_presence.details = label;
|
||||
#if 1
|
||||
RARCH_LOG("[Discord] system name: %s\n", system_name);
|
||||
RARCH_LOG("[Discord] current core: %s\n", system_name);
|
||||
RARCH_LOG("[Discord] current content: %s\n", label);
|
||||
#endif
|
||||
discord_presence.largeImageKey = system_name;
|
||||
discord_presence.smallImageKey = "base";
|
||||
discord_presence.instance = 0;
|
||||
discord_presence.startTimestamp = start_time;
|
||||
/*
|
||||
At the present time, there is no consistent or clean way to present what platform
|
||||
or core the user is playing on/with. If we were to present the platform as an icon,
|
||||
some cores have multiple platforms, such as Dolphin with the GC or Wii, or blueMSX
|
||||
with the MSX or MSX2. The libretro API has no way of determining what platform a
|
||||
selected content is associated with; it only knows what core it's playing under.
|
||||
The platform is determined by the core itself during initialization, not viewable
|
||||
by the libretro API. A solution to this problem would be associating the content
|
||||
with the first platform available in the core's information file, but that solution
|
||||
doesn't work when someone sees another users playing Super Mario Galaxy with a
|
||||
GameCube icon. It's not good enough. Another solution would be exposing what
|
||||
platform is associated with inside the core itself, visible through the libretro
|
||||
API, but this would require updating every libretro core to support this feature,
|
||||
and the support would be too slow and limited for it to really work as a solution.
|
||||
|
||||
If we were to present the core as an icon, there are a few options available, and
|
||||
none of them are desirable either. If we were to provide an icon for each core based
|
||||
on that core's logo or name, then we'd need new assets for every single libretro
|
||||
core available, AND each asset would need to be consistent with each other, in a
|
||||
similar vein to the XMB themes of RetroArch, which would be another massive
|
||||
undertaking. If we were to provide an icon for each core based on that core's
|
||||
platform, then we have the same issue as earlier, except this time we're additionally
|
||||
limited by the amount of assets a Discord RPC application is allowed to have: 150.
|
||||
There are currently 173 core information files available within RetroArch, which goes
|
||||
over that number by a bit. Now if that were determined by platform instead of core,
|
||||
that number goes significantly down as there are many cores with multiple platforms,
|
||||
but then we have the issue as described earlier.
|
||||
|
||||
Because of this dilemma, for now the provided icon for the In-Game status will be the
|
||||
standard/default "core" icon, at least we can come up with a solution that's clean
|
||||
and consistent. When such a time presents itself, the below line will be uncommented.
|
||||
*/
|
||||
|
||||
//discord_presence.largeImageKey = system_name;
|
||||
discord_presence.largeImageKey = "core";
|
||||
|
||||
if (core_info->display_name)
|
||||
discord_presence.largeImageText = core_info->display_name;
|
||||
|
||||
if (in_menu)
|
||||
start_time = time(0);
|
||||
else
|
||||
start_time = start_time + difftime(time(0), pause_time);
|
||||
|
||||
RARCH_LOG("%d\n", start_time);
|
||||
|
||||
if (!skip)
|
||||
{
|
||||
discord_presence.smallImageKey = "playing";
|
||||
discord_presence.smallImageText = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING);
|
||||
discord_presence.startTimestamp = start_time;
|
||||
discord_presence.details = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME);
|
||||
}
|
||||
|
||||
discord_presence.state = label;
|
||||
discord_presence.instance = 0;
|
||||
}
|
||||
|
||||
in_menu = false;
|
||||
break;
|
||||
case DISCORD_PRESENCE_NETPLAY_HOSTING:
|
||||
case DISCORD_PRESENCE_NETPLAY_CLIENT:
|
||||
@ -135,6 +199,12 @@ void discord_update(enum discord_presence presence)
|
||||
/* TODO/FIXME */
|
||||
break;
|
||||
}
|
||||
|
||||
if (in_menu && skip)
|
||||
return;
|
||||
|
||||
RARCH_LOG("[Discord] updating (%d)\n", presence);
|
||||
|
||||
Discord_UpdatePresence(&discord_presence);
|
||||
discord_status = presence;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ enum discord_presence
|
||||
{
|
||||
DISCORD_PRESENCE_MENU = 0,
|
||||
DISCORD_PRESENCE_GAME,
|
||||
DISCORD_PRESENCE_GAME_PAUSED,
|
||||
DISCORD_PRESENCE_CHEEVO_UNLOCKED,
|
||||
DISCORD_PRESENCE_NETPLAY_HOSTING,
|
||||
DISCORD_PRESENCE_NETPLAY_CLIENT
|
||||
|
@ -3517,6 +3517,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3301,6 +3301,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3293,6 +3293,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3403,6 +3403,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3168,6 +3168,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -6578,6 +6578,22 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"En-Menú"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"En-Juego"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"En-Juego (Pausado)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Jugando"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Pausado"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Activar Discord"
|
||||
|
@ -3327,6 +3327,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3387,6 +3387,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Cancella")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Abilita Discord"
|
||||
|
@ -3662,6 +3662,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"クリア")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Discordを有効"
|
||||
|
@ -3288,6 +3288,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -1545,6 +1545,14 @@ MSG_HASH(MENU_ENUM_LABEL_DEFERRED_QUICK_MENU_OVERRIDE_OPTIONS,
|
||||
"deferred_quick_menu_override_options")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DISCORD_IN_MENU,
|
||||
"discord_in_menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DISCORD_IN_GAME,
|
||||
"discord_in_game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DISCORD_IN_GAME_PAUSED,
|
||||
"discord_in_game_paused")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DISCORD_STATUS_PLAYING,
|
||||
"discord_status_playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DISCORD_STATUS_PAUSED,
|
||||
"discord_status_paused")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MIDI_INPUT,
|
||||
"midi_input")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MIDI_OUTPUT,
|
||||
|
@ -3170,6 +3170,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3586,6 +3586,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Oczyść")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"W Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"W Grze")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"W Grze (Wstrzymano)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Gra")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Wstrzymano")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Włącz Discord"
|
||||
|
@ -3724,6 +3724,14 @@ MSG_HASH(MENU_ENUM_SUBLABEL_ACHIEVEMENT_RESUME,
|
||||
"Continuar conquistas para a sessão atual (Esta ação desabilitará Estados de Jogos, Trapaças, Rebobinagem, Pausa e Câmera Lenta e reiniciará o jogo atual).")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"No Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"No Jogo")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"No Jogo (Pausado)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Jogando")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Pausado")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Habilitar o Discord"
|
||||
|
@ -3262,6 +3262,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3326,6 +3326,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Очистить")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Включить Discord")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_DISCORD_ALLOW,
|
||||
|
@ -3922,6 +3922,14 @@ MSG_HASH(MENU_ENUM_SUBLABEL_ACHIEVEMENT_RESUME,
|
||||
"Resume achievements for current session (This action will disable savestates, cheats, rewind, pause, and slow-motion and reset the current game).")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -3325,6 +3325,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_SEARCH_CLEAR,
|
||||
"Clear")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
"In-Menu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
"In-Game")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
"In-Game (Paused)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
"Playing")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
"Paused")
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_ALLOW,
|
||||
"Enable Discord"
|
||||
|
@ -29,6 +29,10 @@
|
||||
#include <wiiu/os/energy.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
#include "discord/discord.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
@ -458,11 +462,18 @@ bool menu_display_libretro(bool is_idle,
|
||||
input_driver_set_libretro_input_blocked();
|
||||
|
||||
core_run();
|
||||
|
||||
input_driver_unset_libretro_input_blocked();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
discord_userdata_t userdata;
|
||||
userdata.status = DISCORD_PRESENCE_GAME_PAUSED;
|
||||
|
||||
command_event(CMD_EVENT_DISCORD_UPDATE, &userdata);
|
||||
#endif
|
||||
|
||||
if (is_idle)
|
||||
return true; /* Maybe return false here
|
||||
for indication of idleness? */
|
||||
|
@ -426,6 +426,14 @@ enum msg_hash_enums
|
||||
|
||||
MENU_ENUM_LABEL_DISCORD_IN_MENU,
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_MENU,
|
||||
MENU_ENUM_LABEL_DISCORD_IN_GAME,
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME,
|
||||
MENU_ENUM_LABEL_DISCORD_IN_GAME_PAUSED,
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_IN_GAME_PAUSED,
|
||||
MENU_ENUM_LABEL_DISCORD_STATUS_PLAYING,
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PLAYING,
|
||||
MENU_ENUM_LABEL_DISCORD_STATUS_PAUSED,
|
||||
MENU_ENUM_LABEL_VALUE_DISCORD_STATUS_PAUSED,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_MIXER_ACTION_PLAY,
|
||||
MENU_ENUM_LABEL_VALUE_MIXER_ACTION_PLAY_LOOPED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user