diff options
Diffstat (limited to 'game/shared/achievements_and_stats_interface.h')
| -rw-r--r-- | game/shared/achievements_and_stats_interface.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/game/shared/achievements_and_stats_interface.h b/game/shared/achievements_and_stats_interface.h new file mode 100644 index 0000000..a671902 --- /dev/null +++ b/game/shared/achievements_and_stats_interface.h @@ -0,0 +1,50 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef ACHIEVEMENTSANDSTATSINTERFACE_H +#define ACHIEVEMENTSANDSTATSINTERFACE_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "vgui_controls/Panel.h" +#include "vgui_controls/Panel.h" +#include "vgui_controls/PHandle.h" +#include "vgui_controls/MenuItem.h" +#include "vgui_controls/MessageDialog.h" +#include "vgui/ISurface.h" + +class AchievementsAndStatsInterface +{ +public: + AchievementsAndStatsInterface() { } + + virtual void CreatePanel( vgui::Panel* pParent ) {} + virtual void DisplayPanel() {} + virtual void ReleasePanel() {} + virtual int GetAchievementsPanelMinWidth( void ) const { return 0; } + +protected: + //----------------------------------------------------------------------------- + // Purpose: Positions a dialog on screen. + //----------------------------------------------------------------------------- + void PositionDialog(vgui::PHandle dlg) + { + if (!dlg.Get()) + return; + + int x, y, ww, wt, wide, tall; + vgui::surface()->GetWorkspaceBounds( x, y, ww, wt ); + dlg->GetSize(wide, tall); + + // Center it, keeping requested size + dlg->SetPos(x + ((ww - wide) / 2), y + ((wt - tall) / 2)); + } +}; + + +#endif // ACHIEVEMENTSANDSTATSINTERFACE_H |