Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef LOADCOMMENTARYDIALOG_H
  7. #define LOADCOMMENTARYDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/Frame.h"
  12. #include "filesystem.h"
  13. #include "utlvector.h"
  14. #define COMMENTARY_MAPFILENAME_MAX_LEN MAX_PATH
  15. #define COMMENTARY_MAPNAME_MAX_LEN 32
  16. #define COMMENTARY_DESCRIP_MAX_LEN 512
  17. #define MAX_LISTED_COMMENTARY_ITEMS 32
  18. struct CommentaryItem_t
  19. {
  20. char szMapFileName[COMMENTARY_MAPFILENAME_MAX_LEN]; // file location of the map
  21. char szMapName[COMMENTARY_MAPNAME_MAX_LEN]; // clean name of the map, eg "dod_kalt"
  22. char szPrintName[COMMENTARY_MAPNAME_MAX_LEN]; // printable name "Kalt"
  23. char szDescription[COMMENTARY_DESCRIP_MAX_LEN]; // track description "This map is fun, and people like it!"
  24. //int iChannel; // TODO: multiple channels within a single map, loaded into separate commentary tracks
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Base class for save & load game dialogs
  28. //-----------------------------------------------------------------------------
  29. class CLoadCommentaryDialog : public vgui::Frame
  30. {
  31. DECLARE_CLASS_SIMPLE( CLoadCommentaryDialog, vgui::Frame );
  32. public:
  33. explicit CLoadCommentaryDialog( vgui::Panel *parent );
  34. protected:
  35. CUtlVector<CommentaryItem_t> m_CommentaryItems;
  36. vgui::PanelListPanel *m_pGameList;
  37. virtual void OnCommand( const char *command );
  38. void ScanCommentaryFiles();
  39. void CreateCommentaryItemList();
  40. int GetSelectedItemIndex();
  41. void AddCommentaryItemToList( int saveIndex );
  42. void ParseCommentaryFile( char const *pszFileName, char const *pszShortName );
  43. static int __cdecl SaveGameSortFunc( const void *lhs, const void *rhs );
  44. private:
  45. MESSAGE_FUNC( OnPanelSelected, "PanelSelected" );
  46. };
  47. #endif // LOADCOMMENTARYDIALOG_H