mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 22:01:41 +00:00
- add steamappid field for DRPC
This commit is contained in:
parent
f5eab7d3e8
commit
8fe07f1449
5 changed files with 20 additions and 5 deletions
|
@ -12,6 +12,7 @@ struct FStartupInfo
|
|||
FString con;
|
||||
FString def;
|
||||
FString DiscordAppId = nullptr;
|
||||
FString SteamAppId = nullptr;
|
||||
int Type;
|
||||
int LoadLights = -1;
|
||||
int LoadBrightmaps = -1;
|
||||
|
|
|
@ -245,6 +245,12 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
|
|||
sc.MustGetString();
|
||||
iwad->DiscordAppId = sc.String;
|
||||
}
|
||||
else if (sc.Compare("SteamAppId"))
|
||||
{
|
||||
sc.MustGetStringName("=");
|
||||
sc.MustGetString();
|
||||
iwad->SteamAppId = sc.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
sc.ScriptError("Unknown keyword '%s'", sc.String);
|
||||
|
@ -838,6 +844,7 @@ const FIWADInfo *FIWadManager::FindIWAD(TArray<FString> &wadfiles, const char *i
|
|||
if (GameStartupInfo.Type == 0) GameStartupInfo.Type = iwad_info->StartupType;
|
||||
if (GameStartupInfo.Song.IsEmpty()) GameStartupInfo.Song = iwad_info->Song;
|
||||
if (GameStartupInfo.DiscordAppId.IsEmpty()) GameStartupInfo.DiscordAppId = iwad_info->DiscordAppId;
|
||||
if (GameStartupInfo.SteamAppId.IsEmpty()) GameStartupInfo.SteamAppId = iwad_info->SteamAppId;
|
||||
I_SetIWADInfo();
|
||||
return iwad_info;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ void M_SaveDefaultsFinal();
|
|||
void R_Shutdown();
|
||||
void I_ShutdownInput();
|
||||
void SetConsoleNotifyBuffer();
|
||||
void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const char* appid);
|
||||
void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const char* appid, const char* steamappid);
|
||||
|
||||
const FIWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
||||
|
||||
|
@ -1881,6 +1881,11 @@ static FString ParseGameInfo(TArray<FString> &pwads, const char *fn, const char
|
|||
sc.MustGetString();
|
||||
GameStartupInfo.DiscordAppId = !!sc.String;
|
||||
}
|
||||
else if (!nextKey.CompareNoCase("STEAMAPPID"))
|
||||
{
|
||||
sc.MustGetString();
|
||||
GameStartupInfo.SteamAppId = !!sc.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Silently ignore unknown properties
|
||||
|
@ -3703,6 +3708,7 @@ void D_Cleanup()
|
|||
GameStartupInfo.BkColor = GameStartupInfo.FgColor = GameStartupInfo.Type = 0;
|
||||
GameStartupInfo.LoadWidescreen = GameStartupInfo.LoadLights = GameStartupInfo.LoadBrightmaps = -1;
|
||||
GameStartupInfo.DiscordAppId = "";
|
||||
GameStartupInfo.SteamAppId = "";
|
||||
|
||||
GC::FullGC(); // clean up before taking down the object list.
|
||||
|
||||
|
@ -3792,7 +3798,7 @@ void I_UpdateWindowTitle()
|
|||
titlestr = GameStartupInfo.Name;
|
||||
break;
|
||||
default:
|
||||
I_UpdateDiscordPresence(false, NULL, GameStartupInfo.DiscordAppId.GetChars());
|
||||
I_UpdateDiscordPresence(false, NULL, GameStartupInfo.DiscordAppId.GetChars(), GameStartupInfo.SteamAppId.GetChars());
|
||||
I_SetWindowTitle(NULL);
|
||||
return;
|
||||
}
|
||||
|
@ -3822,6 +3828,6 @@ void I_UpdateWindowTitle()
|
|||
}
|
||||
}
|
||||
*dstp = 0;
|
||||
I_UpdateDiscordPresence(true, copy.Data(), GameStartupInfo.DiscordAppId.GetChars());
|
||||
I_UpdateDiscordPresence(true, copy.Data(), GameStartupInfo.DiscordAppId.GetChars(), GameStartupInfo.SteamAppId.GetChars());
|
||||
I_SetWindowTitle(copy.Data());
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ struct FIWADInfo
|
|||
int LoadBrightmaps = -1;
|
||||
int LoadLights = -1;
|
||||
FString DiscordAppId = nullptr;
|
||||
FString SteamAppId = nullptr;
|
||||
};
|
||||
|
||||
struct FFoundWadInfo
|
||||
|
|
|
@ -83,7 +83,7 @@ static void handleDiscordJoinRequest(const DiscordUser* request)
|
|||
request->userId);
|
||||
}
|
||||
|
||||
void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const char* appid)
|
||||
void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const char* appid, const char* steamappid)
|
||||
{
|
||||
const char* curappid = DEFAULT_DISCORD_APP_ID;
|
||||
|
||||
|
@ -101,7 +101,7 @@ void I_UpdateDiscordPresence(bool SendPresence, const char* curstatus, const cha
|
|||
handlers.joinGame = handleDiscordJoin;
|
||||
handlers.spectateGame = handleDiscordSpectate;
|
||||
handlers.joinRequest = handleDiscordJoinRequest;
|
||||
Discord_Initialize(curappid, &handlers, 1, NULL);
|
||||
Discord_Initialize(curappid, &handlers, 1, steamappid);
|
||||
}
|
||||
|
||||
if (SendPresence)
|
||||
|
|
Loading…
Reference in a new issue