make discord app id configurable
This commit is contained in:
parent
8c9e6a7c4e
commit
32c346a3e7
|
@ -811,4 +811,6 @@ static char buildbot_server_url[] = "";
|
||||||
|
|
||||||
static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/";
|
static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/";
|
||||||
|
|
||||||
|
static char default_discord_app_id[] = "475456035851599874";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
|
||||||
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, midi_input, true);
|
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, midi_input, true);
|
||||||
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, midi_output, true);
|
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, midi_output, true);
|
||||||
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
|
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
|
||||||
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
|
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, default_discord_app_id, true);
|
||||||
*size = count;
|
*size = count;
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
@ -1814,6 +1814,9 @@ void config_set_defaults(void)
|
||||||
*settings->paths.path_menu_xmb_font = '\0';
|
*settings->paths.path_menu_xmb_font = '\0';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
strlcpy(settings->arrays.discord_app_id,
|
||||||
|
default_discord_app_id, sizeof(settings->arrays.discord_app_id));
|
||||||
|
|
||||||
#ifdef HAVE_MATERIALUI
|
#ifdef HAVE_MATERIALUI
|
||||||
if (g_defaults.menu.materialui.menu_color_theme_enable)
|
if (g_defaults.menu.materialui.menu_color_theme_enable)
|
||||||
settings->uints.menu_materialui_color_theme = g_defaults.menu.materialui.menu_color_theme;
|
settings->uints.menu_materialui_color_theme = g_defaults.menu.materialui.menu_color_theme;
|
||||||
|
|
|
@ -482,6 +482,8 @@ typedef struct settings
|
||||||
|
|
||||||
char youtube_stream_key[PATH_MAX_LENGTH];
|
char youtube_stream_key[PATH_MAX_LENGTH];
|
||||||
char twitch_stream_key[PATH_MAX_LENGTH];
|
char twitch_stream_key[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
char discord_app_id[PATH_MAX_LENGTH];
|
||||||
} arrays;
|
} arrays;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "discord.h"
|
#include "discord.h"
|
||||||
|
|
||||||
#include "../retroarch.h"
|
#include "../retroarch.h"
|
||||||
|
#include "../configuration.h"
|
||||||
#include "../core.h"
|
#include "../core.h"
|
||||||
#include "../core_info.h"
|
#include "../core_info.h"
|
||||||
#include "../paths.h"
|
#include "../paths.h"
|
||||||
|
@ -35,7 +36,6 @@
|
||||||
#include "../cheevos/cheevos.h"
|
#include "../cheevos/cheevos.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char* APPLICATION_ID = "475456035851599874";
|
|
||||||
static int FrustrationLevel = 0;
|
static int FrustrationLevel = 0;
|
||||||
|
|
||||||
static int64_t start_time = 0;
|
static int64_t start_time = 0;
|
||||||
|
@ -211,6 +211,7 @@ void discord_update(enum discord_presence presence)
|
||||||
|
|
||||||
void discord_init(void)
|
void discord_init(void)
|
||||||
{
|
{
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
DiscordEventHandlers handlers;
|
DiscordEventHandlers handlers;
|
||||||
|
|
||||||
RARCH_LOG("[Discord] initializing ..\n");
|
RARCH_LOG("[Discord] initializing ..\n");
|
||||||
|
@ -224,7 +225,7 @@ void discord_init(void)
|
||||||
handlers.spectateGame = handle_discord_spectate;
|
handlers.spectateGame = handle_discord_spectate;
|
||||||
handlers.joinRequest = handle_discord_join_request;
|
handlers.joinRequest = handle_discord_join_request;
|
||||||
|
|
||||||
Discord_Initialize(APPLICATION_ID, &handlers, 1, NULL);
|
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 1, NULL);
|
||||||
|
|
||||||
discord_ready = true;
|
discord_ready = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue