blob: 66665c16d228a2e9861019626b737369e8301abb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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
|