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.

83 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CSSTATSSUMMARY_H
  8. #define CSSTATSSUMMARY_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/PanelListPanel.h"
  13. #include "vgui_controls/Label.h"
  14. #include "tier1/KeyValues.h"
  15. #include "vgui_controls/PropertyPage.h"
  16. #include "vgui_controls/Button.h"
  17. #include "c_cs_player.h"
  18. #include "cs_gamestats_shared.h"
  19. #include "achievements_page.h"
  20. #include "GameEventListener.h"
  21. #include "utlmap.h"
  22. class IAchievement;
  23. class IScheme;
  24. class CAchievementsPageGroupPanel;
  25. class StatCard;
  26. class CCSBaseAchievement;
  27. class CStatsSummary : public vgui::PropertyPage, public CGameEventListener
  28. {
  29. DECLARE_CLASS_SIMPLE ( CStatsSummary, vgui::PropertyPage );
  30. public:
  31. CStatsSummary( vgui::Panel *parent, const char *name );
  32. ~CStatsSummary();
  33. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  34. virtual void ApplySettings( KeyValues *pResourceData );
  35. virtual void OnSizeChanged( int newWide, int newTall );
  36. virtual void FireGameEvent( IGameEvent *event );
  37. virtual void OnThink();
  38. virtual void OnPageShow();
  39. void UpdateStatsData();
  40. void UpdateStatsSummary();
  41. void UpdateKillHistory();
  42. void UpdateFavoriteWeaponData();
  43. void UpdateMapsData();
  44. void UpdateRecentAchievements();
  45. void UpdateLastMatchStats();
  46. void UpdateLastMatchFavoriteWeaponStats();
  47. private:
  48. static int AchivementDateSortPredicate( CCSBaseAchievement* const* pLeft, CCSBaseAchievement* const* pRight);
  49. void DisplayCompressedLocalizedStat(CSStatType_t stat, const char* dialogVariable, const char* localizationToken = NULL);
  50. void DisplayFormattedLabel(const char* localizationToken, const wchar_t* valueText, const char* dialogVariable);
  51. int m_iFixedWidth;
  52. int m_iDefaultWeaponImage;
  53. int m_iDefaultMapImage;
  54. vgui::Label* m_pLabelRoundsPlayed;
  55. vgui::Label* m_pLabelRoundsWon;
  56. vgui::ImagePanel* m_pImagePanelFavWeapon;
  57. vgui::ImagePanel* m_pImagePanelLastMapFavWeapon;
  58. vgui::ImagePanel* m_pImagePanelFavMap;
  59. vgui::ImageList *m_pImageList;
  60. vgui::PanelListPanel *m_pRecentAchievementsList;
  61. StatCard* m_pStatCard;
  62. bool m_bRecentAchievementsDirty;
  63. bool m_bStatsDirty;
  64. CUtlMap<CSStatType_t, int> m_StatImageMap;
  65. };
  66. #endif // CSSTATSSUMMARY_H