diff --git a/src/d_main.cpp b/src/d_main.cpp index 2b111673a..1ba819f30 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -295,6 +295,15 @@ CVAR (Bool, autoloadwidescreen, true, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOB CVAR (Bool, r_debug_disable_vis_filter, false, 0) CVAR(Bool, vid_fps, false, 0) CVAR(Int, vid_showpalette, 0, 0) +CUSTOM_CVAR (Bool, i_discordrpc, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +{ + I_UpdateWindowTitle(); +} +CUSTOM_CVAR(Int, I_FriendlyWindowTitle, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL) +{ + I_UpdateWindowTitle(); +} + bool hud_toggled = false; bool wantToRestart; @@ -3777,11 +3786,6 @@ DEFINE_FIELD_X(InputEventData, event_t, data3) DEFINE_FIELD_X(InputEventData, event_t, x) DEFINE_FIELD_X(InputEventData, event_t, y) -CUSTOM_CVAR(Int, I_FriendlyWindowTitle, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL) -{ - I_UpdateWindowTitle(); -} - void I_UpdateWindowTitle() { FString titlestr; @@ -3828,6 +3832,9 @@ void I_UpdateWindowTitle() } } *dstp = 0; - I_UpdateDiscordPresence(true, copy.Data(), GameStartupInfo.DiscordAppId.GetChars(), GameStartupInfo.SteamAppId.GetChars()); + if (i_discordrpc) + I_UpdateDiscordPresence(true, copy.Data(), GameStartupInfo.DiscordAppId.GetChars(), GameStartupInfo.SteamAppId.GetChars()); + else + I_UpdateDiscordPresence(false, nullptr, nullptr, nullptr); I_SetWindowTitle(copy.Data()); } diff --git a/src/richpresence.cpp b/src/richpresence.cpp index bb53e9d5b..7a081adac 100644 --- a/src/richpresence.cpp +++ b/src/richpresence.cpp @@ -90,6 +90,9 @@ void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const cha if (appid && appid[0] != '\0') curappid = appid; + if (!didInit && !SendPresence) + return; // we haven't initted, there's nothing to do here, just exit + if (!didInit) { didInit = true;