Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef MEDIABROWSERDIALOG_H
  7. #define MEDIABROWSERDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <vgui_controls/Frame.h>
  12. #include <vgui_controls/ImageList.h>
  13. #include <vgui_controls/SectionedListPanel.h>
  14. #include <vgui_controls/PHandle.h>
  15. #include <FileSystem.h>
  16. #include "vgui/mousecode.h"
  17. #include "vgui/IScheme.h"
  18. #include "configs.h"
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Main dialog for media browser
  21. //-----------------------------------------------------------------------------
  22. class CSDKLauncherDialog : public vgui::Frame
  23. {
  24. typedef vgui::Frame BaseClass;
  25. public:
  26. DECLARE_CLASS_SIMPLE( CSDKLauncherDialog, vgui::Frame );
  27. CSDKLauncherDialog(vgui::Panel *parent, const char *name);
  28. virtual ~CSDKLauncherDialog();
  29. void PopulateCurrentGameCombo( bool bSelectLast );
  30. void PopulateCurrentEngineCombo( bool bSelectLast );
  31. void Launch( int hActiveListItem, bool bForce );
  32. void RefreshConfigs( void );
  33. void SetCurrentGame( const char* pcCurrentGame );
  34. protected:
  35. virtual void OnClose();
  36. virtual void OnCommand( const char *command );
  37. private:
  38. void ResetConfigs( void );
  39. bool ParseConfigs( CUtlVector<CGameConfig*> &configs );
  40. void PopulateMediaList();
  41. void GetEngineVersion(char* pcEngineVer, int nSize);
  42. void SetEngineVersion(const char *pcEngineVer);
  43. MESSAGE_FUNC_INT( OnItemDoubleLeftClick, "ItemDoubleLeftClick", itemID );
  44. MESSAGE_FUNC_INT( OnItemContextMenu, "ItemContextMenu", itemID );
  45. MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", pkv );
  46. private:
  47. vgui::ImageList *m_pImageList;
  48. vgui::SectionedListPanel *m_pMediaList;
  49. vgui::Menu *m_pContextMenu;
  50. vgui::ComboBox *m_pCurrentGameCombo;
  51. vgui::ComboBox *m_pCurrentEngineCombo;
  52. };
  53. extern CSDKLauncherDialog *g_pSDKLauncherDialog;
  54. #endif // MEDIABROWSERDIALOG_H