[HL25] Backport (but disabled) Steam Rich Presence commands call

The primary reason for disabling this is because these console commands
have no effect when running a mod (started through Steam at least, not
tested when launched directly from command-line).

Mods that are hosted on Steamworks might be able to make use of those
by doing the necessary back-end setup and compiling their client project
with the "STEAM_RICH_PRESENCE" pre-processor define.
This commit is contained in:
Joël Troch 2024-08-28 16:27:19 +02:00
parent 0dd796c295
commit f2c917f1f8
2 changed files with 14 additions and 0 deletions

View file

@ -374,6 +374,11 @@ void CHud::Init()
m_Menu.Init();
MsgFunc_ResetHUD(0, 0, NULL);
#ifdef STEAM_RICH_PRESENCE
gEngfuncs.pfnClientCmd("richpresence_gamemode\n"); // reset
gEngfuncs.pfnClientCmd("richpresence_update\n");
#endif
}
// CHud destructor

View file

@ -93,6 +93,15 @@ bool CHud::MsgFunc_GameMode(const char* pszName, int iSize, void* pbuf)
//TODO: define game mode constants
m_Teamplay = READ_BYTE() == 1;
#ifdef STEAM_RICH_PRESENCE
if (m_Teamplay)
gEngfuncs.pfnClientCmd("richpresence_gamemode Teamplay\n");
else
gEngfuncs.pfnClientCmd("richpresence_gamemode\n"); // reset
gEngfuncs.pfnClientCmd("richpresence_update\n");
#endif
return true;
}