Counter Strike : Global Offensive Source Code
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.

88 lines
2.2 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //===========================================================================//
  9. #ifndef CMAINPANEL_H
  10. #define CMAINPANEL_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include <vgui_controls/Frame.h>
  15. #include <vgui_controls/Panel.h>
  16. #include <vgui_controls/ListPanel.h>
  17. #include <vgui_controls/PHandle.h>
  18. #include "utlvector.h"
  19. //#include <GamePanelInfo.h>
  20. #include "imanageserver.h"
  21. //#include "gameserver.h"
  22. #include "CreateMultiplayerGameServerPage.h"
  23. class IAdminServer;
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Root panel for dedicated server GUI
  26. //-----------------------------------------------------------------------------
  27. class CMainPanel : public vgui::Panel
  28. {
  29. public:
  30. // Construction/destruction
  31. CMainPanel( );
  32. virtual ~CMainPanel();
  33. virtual void Initialize( );
  34. // displays the dialog, moves it into focus, updates if it has to
  35. virtual void Open( void );
  36. // returns a pointer to a static instance of this dialog
  37. // valid for use only in sort functions
  38. static CMainPanel *GetInstance();
  39. virtual void StartServer(const char *cvars);
  40. void ActivateBuildMode();
  41. void *GetShutdownHandle() { return m_hShutdown; }
  42. void AddConsoleText(const char *msg);
  43. bool Stopping() { return m_bClosing; }
  44. bool IsInConfig() { return m_bIsInConfig; }
  45. private:
  46. // called when dialog is shut down
  47. virtual void OnClose();
  48. virtual void OnTick();
  49. void DoStop();
  50. // GUI elements
  51. IManageServer *m_pGameServer;
  52. // the popup menu
  53. vgui::DHANDLE<vgui::ProgressBox> m_pProgressBox;
  54. CCreateMultiplayerGameServerPage *m_pConfigPage;
  55. // Event that lets the thread tell the main window it shutdown
  56. void *m_hShutdown;
  57. bool m_bStarting; // whether the server is currently starting
  58. bool m_bStarted; // whether the server has been started or not
  59. bool m_bClosing; // whether we are shutting down
  60. bool m_bIsInConfig;
  61. serveritem_t s1;
  62. int m_hResourceWaitHandle;
  63. float m_flPreviousSteamProgress;
  64. typedef vgui::Panel BaseClass;
  65. DECLARE_PANELMAP();
  66. };
  67. #endif // CMAINPANEL_H