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. #include "cbase.h"
  7. #include "cs_achievements_and_stats_interface.h"
  8. #include "baseachievement.h"
  9. #include "GameEventListener.h"
  10. #include "../common/xlast_csgo/csgo.spa.h"
  11. #include "iachievementmgr.h"
  12. #include "utlmap.h"
  13. #include "steam/steam_api.h"
  14. #include "vgui_controls/Panel.h"
  15. #include "vgui_controls/PHandle.h"
  16. #include "vgui_controls/MenuItem.h"
  17. #include "vgui_controls/messagedialog.h"
  18. #include "cs_gamestats_shared.h"
  19. #include "vgui/IInput.h"
  20. #include "vgui/ILocalize.h"
  21. #include "vgui/IPanel.h"
  22. #include "vgui/ISurface.h"
  23. #include "vgui/ISystem.h"
  24. #include "vgui/IVGui.h"
  25. #if defined(CSTRIKE_DLL) && defined(CLIENT_DLL)
  26. CSAchievementsAndStatsInterface::CSAchievementsAndStatsInterface() : AchievementsAndStatsInterface()
  27. {
  28. m_pAchievementAndStatsSummary = NULL;
  29. g_pAchievementsAndStatsInterface = this;
  30. }
  31. void CSAchievementsAndStatsInterface::CreatePanel( vgui::Panel* pParent )
  32. {
  33. // Create achievement & stats dialog if not already created
  34. if ( !m_pAchievementAndStatsSummary )
  35. {
  36. m_pAchievementAndStatsSummary = new CAchievementAndStatsSummary(NULL);
  37. }
  38. if ( m_pAchievementAndStatsSummary )
  39. {
  40. m_pAchievementAndStatsSummary->SetParent(pParent);
  41. }
  42. }
  43. void CSAchievementsAndStatsInterface::DisplayPanel()
  44. {
  45. // Position & show dialog
  46. PositionDialog(m_pAchievementAndStatsSummary);
  47. m_pAchievementAndStatsSummary->Activate();
  48. }
  49. void CSAchievementsAndStatsInterface::ReleasePanel()
  50. {
  51. // Make sure the BasePanel doesn't try to delete this, because it doesn't really own it.
  52. if ( m_pAchievementAndStatsSummary )
  53. {
  54. m_pAchievementAndStatsSummary->SetParent((vgui::Panel*)NULL);
  55. }
  56. }
  57. #endif