Team Fortress 2 Source Code as on 22/4/2020
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.

75 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef BONUSMAPSDIALOG_H
  8. #define BONUSMAPSDIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/Frame.h"
  13. #include "BonusMapsDatabase.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Displays and loads available bonus maps
  16. //-----------------------------------------------------------------------------
  17. class CBonusMapsDialog : public vgui::Frame
  18. {
  19. DECLARE_CLASS_SIMPLE( CBonusMapsDialog, vgui::Frame );
  20. public:
  21. CBonusMapsDialog(vgui::Panel *parent);
  22. ~CBonusMapsDialog();
  23. void SetSelectedBooleanStatus( const char *pchName, bool bValue );
  24. void RefreshData( void );
  25. int GetSelectedChallenge( void );
  26. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  27. virtual void OnCommand( const char *command );
  28. void OnKeyCodeTyped( vgui::KeyCode code );
  29. void OnKeyCodePressed( vgui::KeyCode code );
  30. private:
  31. bool ImportZippedBonusMaps( const char *pchZippedFileName );
  32. void BuildMapsList( void );
  33. void CreateBonusMapsList();
  34. int GetSelectedItemBonusMapIndex();
  35. void RefreshDialog( BonusMapDescription_t *pMap );
  36. void RefreshMedalDisplay( BonusMapDescription_t *pMap );
  37. void RefreshCompletionPercentage( void );
  38. MESSAGE_FUNC( OnPanelSelected, "PanelSelected" );
  39. MESSAGE_FUNC( OnControlModified, "ControlModified" );
  40. MESSAGE_FUNC( OnTextChanged, "TextChanged" )
  41. {
  42. OnControlModified();
  43. }
  44. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  45. private:
  46. Color m_PercentageBarBackgroundColor, m_PercentageBarColor;
  47. vgui::FileOpenDialog *m_hImportBonusMapsDialog;
  48. vgui::PanelListPanel *m_pGameList;
  49. vgui::ComboBox *m_pChallengeSelection;
  50. vgui::ImagePanel *m_pPercentageBarBackground;
  51. vgui::ImagePanel *m_pPercentageBar;
  52. };
  53. extern CBonusMapsDialog *g_pBonusMapsDialog;
  54. #endif // BONUSMAPSDIALOG_H