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 /tracker/AdminServer/HelpText.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'tracker/AdminServer/HelpText.cpp')
| -rw-r--r-- | tracker/AdminServer/HelpText.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tracker/AdminServer/HelpText.cpp b/tracker/AdminServer/HelpText.cpp new file mode 100644 index 0000000..04c2c8a --- /dev/null +++ b/tracker/AdminServer/HelpText.cpp @@ -0,0 +1,84 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + + +#include <stdio.h> + +#include <VGUI_Controls.h> +#include "filesystem.h" +#include "HelpText.h" +using namespace vgui; + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CHelpText::CHelpText(const char *mod) +{ + + char configName[200]; + _snprintf(configName,200,"Admin\\HelpFile_%s.vdf",mod); + + m_pHelpData = new KeyValues ("Help"); + + // always load the basic definiton + LoadHelpFile("Admin\\HelpFile.vdf"); + + // now load mod specific stuff + if( g_pFullFileSystem->FileExists(configName) ) + { + LoadHelpFile(configName); + } + + // and load an admin mod page if you can find it + if( g_pFullFileSystem->FileExists("Admin\\HelpFile_adminmod.vdf") ) + { + LoadHelpFile("Admin\\HelpFile_adminmod.vdf"); + } + +} + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CHelpText::~CHelpText() +{ + m_pHelpData->deleteThis(); +} + + +void CHelpText::LoadHelpFile(const char *filename) +{ + + + if (!m_pHelpData->LoadFromFile(g_pFullFileSystem, filename, true, "PLATFORM")) + { + // failed to load... + } + else + { + + } + +} + +const char *CHelpText::GetHelp(const char *keyname) +{ + KeyValues *help = m_pHelpData->FindKey(keyname, true); + if(help) + { + return help->GetString("text"); + } + else + { + return NULL; + } +} + + + + + |