diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /serverbrowser/ModList.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'serverbrowser/ModList.h')
| -rw-r--r-- | serverbrowser/ModList.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/serverbrowser/ModList.h b/serverbrowser/ModList.h new file mode 100644 index 0000000..b899ad9 --- /dev/null +++ b/serverbrowser/ModList.h @@ -0,0 +1,62 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef MODLIST_H +#define MODLIST_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Handles parsing of half-life directory for mod info +//----------------------------------------------------------------------------- +class CModList +{ +public: + CModList(); + + int GetIndex( const CGameID &iAppID ) const; + void AddVGUIListener( vgui::VPANEL panel ); + + // returns number of mods + int ModCount(); + + // returns the full name of the mod, index valid in range [0, ModCount) + const char *GetModName( int index ); + + // returns mod directory string + const char *GetModDir( int index ); + + const CGameID &GetAppID( int index ) const; + + // returns the mod name for the associated gamedir + const char *GetModNameForModDir( const CGameID &iAppID ); + +private: + struct mod_t + { + char description[64]; + char gamedir[64]; + CGameID m_GameID; + int m_InternalAppId; + bool operator==( const mod_t& rhs ) const { return rhs.m_GameID == m_GameID; } + }; + + static int ModNameCompare( const mod_t *pLeft, const mod_t *pRight ); + void ParseInstalledMods(); + void ParseSteamMods(); + int LoadAppConfiguration( uint32 nAppID ); + + CUtlVector<mod_t> m_ModList; + CUtlVector<vgui::VPANEL> m_VGUIListeners; +}; + +// singleton accessor +extern CModList &ModList(); + + +#endif // MODLIST_H |