mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2024-12-22 17:47:38 +08:00
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
//========= 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
|