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.

50 lines
1.4 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef ACHIEVEMENTSANDSTATSINTERFACE_H
  7. #define ACHIEVEMENTSANDSTATSINTERFACE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/Panel.h"
  12. #include "vgui_controls/Panel.h"
  13. #include "vgui_controls/PHandle.h"
  14. #include "vgui_controls/MenuItem.h"
  15. #include "vgui_controls/MessageDialog.h"
  16. #include "vgui/ISurface.h"
  17. class AchievementsAndStatsInterface
  18. {
  19. public:
  20. AchievementsAndStatsInterface() { }
  21. virtual void CreatePanel( vgui::Panel* pParent ) {}
  22. virtual void DisplayPanel() {}
  23. virtual void ReleasePanel() {}
  24. virtual int GetAchievementsPanelMinWidth( void ) const { return 0; }
  25. protected:
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Positions a dialog on screen.
  28. //-----------------------------------------------------------------------------
  29. void PositionDialog(vgui::PHandle dlg)
  30. {
  31. if (!dlg.Get())
  32. return;
  33. int x, y, ww, wt, wide, tall;
  34. vgui::surface()->GetWorkspaceBounds( x, y, ww, wt );
  35. dlg->GetSize(wide, tall);
  36. // Center it, keeping requested size
  37. dlg->SetPos(x + ((ww - wide) / 2), y + ((wt - tall) / 2));
  38. }
  39. };
  40. #endif // ACHIEVEMENTSANDSTATSINTERFACE_H