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 /gameui/LoadCommentaryDialog.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'gameui/LoadCommentaryDialog.h')
| -rw-r--r-- | gameui/LoadCommentaryDialog.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gameui/LoadCommentaryDialog.h b/gameui/LoadCommentaryDialog.h new file mode 100644 index 0000000..aa728b6 --- /dev/null +++ b/gameui/LoadCommentaryDialog.h @@ -0,0 +1,63 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef LOADCOMMENTARYDIALOG_H +#define LOADCOMMENTARYDIALOG_H +#ifdef _WIN32 +#pragma once +#endif + +#include "vgui_controls/Frame.h" +#include "filesystem.h" +#include "utlvector.h" + + +#define COMMENTARY_MAPFILENAME_MAX_LEN MAX_PATH +#define COMMENTARY_MAPNAME_MAX_LEN 32 +#define COMMENTARY_DESCRIP_MAX_LEN 512 +#define MAX_LISTED_COMMENTARY_ITEMS 32 + +struct CommentaryItem_t +{ + char szMapFileName[COMMENTARY_MAPFILENAME_MAX_LEN]; // file location of the map + char szMapName[COMMENTARY_MAPNAME_MAX_LEN]; // clean name of the map, eg "dod_kalt" + char szPrintName[COMMENTARY_MAPNAME_MAX_LEN]; // printable name "Kalt" + char szDescription[COMMENTARY_DESCRIP_MAX_LEN]; // track description "This map is fun, and people like it!" + + //int iChannel; // TODO: multiple channels within a single map, loaded into separate commentary tracks +}; + +//----------------------------------------------------------------------------- +// Purpose: Base class for save & load game dialogs +//----------------------------------------------------------------------------- +class CLoadCommentaryDialog : public vgui::Frame +{ + DECLARE_CLASS_SIMPLE( CLoadCommentaryDialog, vgui::Frame ); + +public: + CLoadCommentaryDialog( vgui::Panel *parent ); + +protected: + CUtlVector<CommentaryItem_t> m_CommentaryItems; + vgui::PanelListPanel *m_pGameList; + + virtual void OnCommand( const char *command ); + virtual void OnKeyCodePressed( vgui::KeyCode code ); + + void ScanCommentaryFiles(); + void CreateCommentaryItemList(); + int GetSelectedItemIndex(); + void AddCommentaryItemToList( int saveIndex ); + + void ParseCommentaryFile( char const *pszFileName, char const *pszShortName ); + static int __cdecl SaveGameSortFunc( const void *lhs, const void *rhs ); + +private: + MESSAGE_FUNC( OnPanelSelected, "PanelSelected" ); +}; + + +#endif // LOADCOMMENTARYDIALOG_H |