summaryrefslogtreecommitdiff
path: root/game/shared/cs_achievements_and_stats_interface.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/cs_achievements_and_stats_interface.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/cs_achievements_and_stats_interface.cpp')
-rw-r--r--game/shared/cs_achievements_and_stats_interface.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/game/shared/cs_achievements_and_stats_interface.cpp b/game/shared/cs_achievements_and_stats_interface.cpp
new file mode 100644
index 0000000..66665c1
--- /dev/null
+++ b/game/shared/cs_achievements_and_stats_interface.cpp
@@ -0,0 +1,80 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================
+
+#include "cbase.h"
+
+#include "cs_achievements_and_stats_interface.h"
+#include "baseachievement.h"
+#include "GameEventListener.h"
+#include "hl2orange.spa.h"
+#include "iachievementmgr.h"
+#include "utlmap.h"
+#include "steam/steam_api.h"
+
+#include "vgui_controls/Panel.h"
+#include "vgui_controls/PHandle.h"
+#include "vgui_controls/MenuItem.h"
+#include "vgui_controls/MessageDialog.h"
+
+#include "cs_gamestats_shared.h"
+#include "../client/cstrike/VGUI/achievement_stats_summary.h"
+#include "vgui/IInput.h"
+#include "vgui/ILocalize.h"
+#include "vgui/IPanel.h"
+#include "vgui/ISurface.h"
+#include "vgui/ISystem.h"
+#include "vgui/IVGui.h"
+
+
+#if defined(CSTRIKE_DLL) && defined(CLIENT_DLL)
+
+CSAchievementsAndStatsInterface::CSAchievementsAndStatsInterface() : AchievementsAndStatsInterface()
+{
+ m_pAchievementAndStatsSummary = NULL;
+
+ g_pAchievementsAndStatsInterface = this;
+}
+
+void CSAchievementsAndStatsInterface::CreatePanel( vgui::Panel* pParent )
+{
+ // Create achievement & stats dialog if not already created
+ if ( !m_pAchievementAndStatsSummary )
+ {
+ m_pAchievementAndStatsSummary = new CAchievementAndStatsSummary(NULL);
+ }
+
+ if ( m_pAchievementAndStatsSummary )
+ {
+ m_pAchievementAndStatsSummary->SetParent(pParent);
+ }
+}
+
+void CSAchievementsAndStatsInterface::DisplayPanel()
+{
+ // Position & show dialog
+ PositionDialog(m_pAchievementAndStatsSummary);
+ m_pAchievementAndStatsSummary->Activate();
+
+ //Make sure the top of the page appears on the screen (for video modes such as 1280x720).
+ int x, y;
+ m_pAchievementAndStatsSummary->GetPos( x, y );
+ if ( y < 0 )
+ {
+ m_pAchievementAndStatsSummary->SetPos( x, 0 );
+ }
+}
+
+void CSAchievementsAndStatsInterface::ReleasePanel()
+{
+ // Make sure the BasePanel doesn't try to delete this, because it doesn't really own it.
+ if ( m_pAchievementAndStatsSummary )
+ {
+ m_pAchievementAndStatsSummary->SetParent((vgui::Panel*)NULL);
+ }
+}
+
+#endif
+