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.

60 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CREATEMULTIPLAYERGAMESERVERPAGE_H
  8. #define CREATEMULTIPLAYERGAMESERVERPAGE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/PropertyPage.h>
  13. #include "CvarToggleCheckButton.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose: server options page of the create game server dialog
  16. //-----------------------------------------------------------------------------
  17. class CCreateMultiplayerGameServerPage : public vgui::PropertyPage
  18. {
  19. DECLARE_CLASS_SIMPLE( CCreateMultiplayerGameServerPage, vgui::PropertyPage );
  20. public:
  21. CCreateMultiplayerGameServerPage(vgui::Panel *parent, const char *name);
  22. ~CCreateMultiplayerGameServerPage();
  23. virtual void OnKeyCodePressed( vgui::KeyCode code );
  24. // returns currently entered information about the server
  25. void SetMap(const char *name);
  26. bool IsRandomMapSelected();
  27. const char *GetMapName();
  28. vgui::ComboBox *GetMapList( void ) { return m_pMapList; }
  29. // CS Bots
  30. void EnableBots( KeyValues *data );
  31. int GetBotQuota( void );
  32. bool GetBotsEnabled( void );
  33. protected:
  34. virtual void OnApplyChanges();
  35. MESSAGE_FUNC( OnCheckButtonChecked, "CheckButtonChecked" );
  36. private:
  37. void LoadMapList();
  38. void LoadMaps( const char *pszPathID );
  39. vgui::ComboBox *m_pMapList;
  40. vgui::CheckButton *m_pEnableBotsCheck;
  41. CCvarToggleCheckButton *m_pEnableTutorCheck;
  42. KeyValues *m_pSavedData;
  43. enum { DATA_STR_LENGTH = 64 };
  44. char m_szMapName[DATA_STR_LENGTH];
  45. };
  46. #endif // CREATEMULTIPLAYERGAMESERVERPAGE_H