- Discord RPC presence. Adds new IWADINFO and GAMEINFO keys: DiscordAppId - this should point to your AppId for your game. It will use a default GZDoom one if not found.
This commit is contained in:
parent
550e1212af
commit
85c432c699
90 changed files with 7344 additions and 3 deletions
|
|
@ -154,6 +154,7 @@ void M_SaveDefaultsFinal();
|
|||
void R_Shutdown();
|
||||
void I_ShutdownInput();
|
||||
void SetConsoleNotifyBuffer();
|
||||
void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const char* appid);
|
||||
|
||||
const FIWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
||||
|
||||
|
|
@ -1875,6 +1876,11 @@ static FString ParseGameInfo(TArray<FString> &pwads, const char *fn, const char
|
|||
sc.MustGetNumber();
|
||||
GameStartupInfo.LoadWidescreen = !!sc.Number;
|
||||
}
|
||||
else if (!nextKey.CompareNoCase("DISCORDAPPID"))
|
||||
{
|
||||
sc.MustGetString();
|
||||
GameStartupInfo.DiscordAppId = !!sc.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Silently ignore unknown properties
|
||||
|
|
@ -3696,6 +3702,7 @@ void D_Cleanup()
|
|||
GameStartupInfo.Name = "";
|
||||
GameStartupInfo.BkColor = GameStartupInfo.FgColor = GameStartupInfo.Type = 0;
|
||||
GameStartupInfo.LoadWidescreen = GameStartupInfo.LoadLights = GameStartupInfo.LoadBrightmaps = -1;
|
||||
GameStartupInfo.DiscordAppId = "";
|
||||
|
||||
GC::FullGC(); // clean up before taking down the object list.
|
||||
|
||||
|
|
@ -3785,6 +3792,7 @@ void I_UpdateWindowTitle()
|
|||
titlestr = GameStartupInfo.Name;
|
||||
break;
|
||||
default:
|
||||
I_UpdateDiscordPresence(false, NULL, GameStartupInfo.DiscordAppId.GetChars());
|
||||
I_SetWindowTitle(NULL);
|
||||
return;
|
||||
}
|
||||
|
|
@ -3814,5 +3822,6 @@ void I_UpdateWindowTitle()
|
|||
}
|
||||
}
|
||||
*dstp = 0;
|
||||
I_UpdateDiscordPresence(true, copy.Data(), GameStartupInfo.DiscordAppId.GetChars());
|
||||
I_SetWindowTitle(copy.Data());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue