From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- common/SourceAppInfo.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 common/SourceAppInfo.cpp (limited to 'common/SourceAppInfo.cpp') diff --git a/common/SourceAppInfo.cpp b/common/SourceAppInfo.cpp new file mode 100644 index 0000000..e2fdaa2 --- /dev/null +++ b/common/SourceAppInfo.cpp @@ -0,0 +1,80 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: languages definition +// +//============================================================================= + +#include "SourceAppInfo.h" +#include "tier0/dbg.h" + +struct SourceAppInfo_t +{ + const char *m_pchFullName; + const char *m_pchModName; + int m_nSteamAppId; + ESourceApp m_ESourceApp; +}; + + +static const SourceAppInfo_t s_SteamAppInfo[] = +{ + { "Source SDK Base", "sourcetest", 215, k_App_SDK_BASE }, + { "Half-Life 2", "hl2", 220, k_App_HL2 } , + { "Counter-Strike: Source", "cstrike", 240, k_App_CSS } , + { "Day of Defeat: Source", "dod", 300, k_App_DODS } , + { "Half-Life 2: Deathmatch", "hl2mp", 320, k_App_HL2MP } , + { "Half-Life 2: Lost Coast", "lostcoast", 340, k_App_LOST_COAST } , + { "Half-Life Deathmatch: Source", "hl1mp", 360, k_App_HL1DM } , + { "Half-Life 2: Episode One", "episodic", 380, k_App_HL2_EP1 }, + { "Portal", "portal", 400, k_App_PORTAL } , + { "Half-Life 2: Episode Two", "ep2", 420, k_App_HL2_EP2 } , + { "Team Fortress 2", "tf", 440, k_App_TF2 } , +}; + + +//----------------------------------------------------------------------------- +// Purpose: return the short string name used for this language by SteamUI +//----------------------------------------------------------------------------- +const char *GetAppFullName( ESourceApp eSourceApp ) +{ + Assert( Q_ARRAYSIZE(s_SteamAppInfo) == k_App_MAX ); + if ( s_SteamAppInfo[ eSourceApp ].m_ESourceApp == eSourceApp ) + { + return s_SteamAppInfo[ eSourceApp ].m_pchFullName; + } + + Assert( !"enum ESourceApp order mismatched from AppInfo_t s_SteamAppInfo, fix it!" ); + return s_SteamAppInfo[0].m_pchFullName; +} + +//----------------------------------------------------------------------------- +// Purpose: return the short string name used for this language by SteamUI +//----------------------------------------------------------------------------- +const char *GetAppModName( ESourceApp eSourceApp ) +{ + Assert( Q_ARRAYSIZE(s_SteamAppInfo) == k_App_MAX ); + if ( s_SteamAppInfo[ eSourceApp ].m_ESourceApp == eSourceApp ) + { + return s_SteamAppInfo[ eSourceApp ].m_pchModName; + } + + Assert( !"enum ESourceApp order mismatched from AppInfo_t s_SteamAppInfo, fix it!" ); + return s_SteamAppInfo[0].m_pchModName; +} + + +//----------------------------------------------------------------------------- +// Purpose: return the short string name used for this language by SteamUI +//----------------------------------------------------------------------------- +const int GetAppSteamAppId( ESourceApp eSourceApp ) +{ + Assert( Q_ARRAYSIZE(s_SteamAppInfo) == k_App_MAX ); + if ( s_SteamAppInfo[ eSourceApp ].m_ESourceApp == eSourceApp ) + { + return s_SteamAppInfo[ eSourceApp ].m_nSteamAppId; + } + + Assert( !"enum ESourceApp order mismatched from AppInfo_t s_SteamAppInfo, fix it!" ); + return s_SteamAppInfo[0].m_nSteamAppId; +} + -- cgit v1.2.3