summaryrefslogtreecommitdiff
path: root/gameui/matchmaking/basedialog.h
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 /gameui/matchmaking/basedialog.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'gameui/matchmaking/basedialog.h')
-rw-r--r--gameui/matchmaking/basedialog.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/gameui/matchmaking/basedialog.h b/gameui/matchmaking/basedialog.h
new file mode 100644
index 0000000..1501e1f
--- /dev/null
+++ b/gameui/matchmaking/basedialog.h
@@ -0,0 +1,120 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: All matchmaking dialogs inherit from this
+//
+//=============================================================================//
+
+#ifndef BASEDIALOG_H
+#define BASEDIALOG_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "dialogmenu.h"
+#include "vgui_controls/Label.h"
+#include "vgui_controls/KeyRepeat.h"
+#include "KeyValues.h"
+#include "BasePanel.h"
+
+#if !defined( _X360 )
+#include "xbox/xboxstubs.h"
+#endif
+
+class CFooterPanel;
+
+//-----------------------------------------------------------------------------
+// Purpose: A Label with an extra string to hold a session property lookup key
+//-----------------------------------------------------------------------------
+class CPropertyLabel : public vgui::Label
+{
+ DECLARE_CLASS_SIMPLE( CPropertyLabel, vgui::Label );
+
+public:
+ CPropertyLabel( Panel *parent, const char *panelName, const char *text ) : BaseClass( parent, panelName, text )
+ {
+ }
+
+ virtual void ApplySettings( KeyValues *pResourceData )
+ {
+ BaseClass::ApplySettings( pResourceData );
+
+ m_szPropertyString[0] = 0;
+ const char *pString = pResourceData->GetString( "PropertyString", NULL );
+ if ( pString )
+ {
+ Q_strncpy( m_szPropertyString, pString, sizeof( m_szPropertyString ) );
+ }
+ }
+
+ char m_szPropertyString[ MAX_PATH ];
+};
+
+//--------------------------------
+// CBaseDialog
+//--------------------------------
+class CBaseDialog : public vgui::Frame
+{
+ DECLARE_CLASS_SIMPLE( CBaseDialog, vgui::Frame );
+
+public:
+ CBaseDialog( vgui::Panel *parent, const char *pName );
+ ~CBaseDialog();
+
+ // IPanel interface
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void ApplySettings( KeyValues *pResourceData );
+ virtual void PerformLayout();
+ virtual void Activate();
+
+ virtual void OnKeyCodePressed( vgui::KeyCode code );
+ virtual void OnKeyCodeReleased( vgui::KeyCode code);
+ virtual void OnCommand( const char *pCommand );
+ virtual void OnClose();
+ virtual void OnThink();
+
+ virtual void OverrideMenuItem( KeyValues *pKeys );
+ virtual void SwapMenuItems( int iOne, int iTwo );
+
+ virtual void HandleKeyRepeated( vgui::KeyCode code );
+
+protected:
+ int m_nBorderWidth;
+ int m_nMinWide;
+
+ CDialogMenu m_Menu;
+ vgui::Label *m_pTitle;
+ vgui::Panel *m_pParent;
+
+ KeyValues *m_pFooterInfo;
+ int m_nButtonGap;
+
+ vgui::CKeyRepeatHandler m_KeyRepeat;
+};
+
+
+//---------------------------------------------------------------------
+// Helper object to display the map picture and descriptive text
+//---------------------------------------------------------------------
+class CScenarioInfoPanel : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CScenarioInfoPanel, vgui::EditablePanel );
+
+public:
+ CScenarioInfoPanel( vgui::Panel *parent, const char *pName );
+ ~CScenarioInfoPanel();
+
+ virtual void PerformLayout();
+ virtual void ApplySettings( KeyValues *pResourceData );
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+
+ vgui::ImagePanel *m_pMapImage;
+ CPropertyLabel *m_pTitle;
+ CPropertyLabel *m_pSubtitle;
+ CPropertyLabel *m_pDescOne;
+ CPropertyLabel *m_pDescTwo;
+ CPropertyLabel *m_pDescThree;
+ CPropertyLabel *m_pValueTwo;
+ CPropertyLabel *m_pValueThree;
+};
+
+#endif // BASEDIALOG_H \ No newline at end of file