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.

71 lines
1.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef BASESAVEGAMEDIALOG_H
  7. #define BASESAVEGAMEDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/Frame.h"
  12. #include "vgui/MouseCode.h"
  13. #include "keyvalues.h"
  14. #include "utlvector.h"
  15. #define SAVEGAME_MAPNAME_LEN 32
  16. #define SAVEGAME_COMMENT_LEN 80
  17. #define SAVEGAME_ELAPSED_LEN 32
  18. struct SaveGameDescription_t
  19. {
  20. char szShortName[64];
  21. char szFileName[128];
  22. char szMapName[SAVEGAME_MAPNAME_LEN];
  23. char szComment[SAVEGAME_COMMENT_LEN];
  24. char szType[64];
  25. char szElapsedTime[SAVEGAME_ELAPSED_LEN];
  26. char szFileTime[32];
  27. unsigned int iTimestamp;
  28. unsigned int iSize;
  29. };
  30. int SaveReadNameAndComment( FileHandle_t f, char *name, char *comment );
  31. //-----------------------------------------------------------------------------
  32. // Purpose: Base class for save & load game dialogs
  33. //-----------------------------------------------------------------------------
  34. class CBaseSaveGameDialog : public vgui::Frame
  35. {
  36. DECLARE_CLASS_SIMPLE( CBaseSaveGameDialog, vgui::Frame );
  37. public:
  38. CBaseSaveGameDialog( vgui::Panel *parent, const char *name );
  39. static int __cdecl SaveGameSortFunc( const void *lhs, const void *rhs );
  40. protected:
  41. CUtlVector<SaveGameDescription_t> m_SaveGames;
  42. vgui::PanelListPanel *m_pGameList;
  43. virtual void OnScanningSaveGames() {}
  44. void DeleteSaveGame( const char *fileName );
  45. void ScanSavedGames();
  46. void CreateSavedGamesList();
  47. int GetSelectedItemSaveIndex();
  48. void AddSaveGameItemToList( int saveIndex );
  49. bool ParseSaveData( char const *pszFileName, char const *pszShortName, SaveGameDescription_t &save );
  50. private:
  51. MESSAGE_FUNC( OnPanelSelected, "PanelSelected" );
  52. };
  53. #endif // BASESAVEGAMEDIALOG_H