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.

109 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TESTITEM_ROOT_H
  8. #define TESTITEM_ROOT_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/EditablePanel.h"
  13. #include "vgui_controls/ScrollableEditablePanel.h"
  14. #include "tf_controls.h"
  15. #include "testitem_dialog.h"
  16. //-----------------------------------------------------------------------------
  17. // A panel that handles the overall item testing process
  18. //-----------------------------------------------------------------------------
  19. class CTestItemBotControls : public vgui::EditablePanel, public CGameEventListener
  20. {
  21. DECLARE_CLASS_SIMPLE( CTestItemBotControls, vgui::EditablePanel );
  22. public:
  23. CTestItemBotControls( vgui::Panel *parent );
  24. ~CTestItemBotControls( void );
  25. void SetupComboBoxes( void );
  26. virtual void FireGameEvent( IGameEvent *event );
  27. void ImportTestSetup( KeyValues *pKV );
  28. void Close( void );
  29. void SetEmbedded( bool bEmbedded ) { m_bEmbedded = bEmbedded; InvalidateLayout(); }
  30. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  31. virtual void PerformLayout( void );
  32. virtual void OnCommand( const char *command );
  33. void UpdateBots( void );
  34. void CommitSettingsToKV( void );
  35. private:
  36. vgui::ComboBox *m_pBotAnimationComboBox;
  37. vgui::Slider *m_pBotAnimationSpeedSlider;
  38. vgui::CheckButton *m_pBotForceFireCheckBox;
  39. vgui::CheckButton *m_pBotTurntableCheckBox;
  40. vgui::CheckButton *m_pBotViewScanCheckBox;
  41. bool m_bEmbedded;
  42. };
  43. //-----------------------------------------------------------------------------
  44. // A panel that handles the overall item testing process
  45. //-----------------------------------------------------------------------------
  46. class CTestItemRoot : public vgui::EditablePanel, public CGameEventListener
  47. {
  48. DECLARE_CLASS_SIMPLE( CTestItemRoot, vgui::EditablePanel );
  49. public:
  50. CTestItemRoot( vgui::Panel *parent );
  51. ~CTestItemRoot( void );
  52. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  53. virtual void PerformLayout( void );
  54. virtual void OnCommand( const char *command );
  55. virtual void FireGameEvent( IGameEvent *event );
  56. void Close( void );
  57. void CloseAndTestItem( void );
  58. void UpdateTestItems( void );
  59. int FindReplaceableItemsForSelectedClass( CUtlVector<item_definition_index_t> *pItemDefs = NULL, bool bWeapons = false );
  60. void ExportTestSetup( const char *pFilename );
  61. void ImportTestSetup( const char *pFilename );
  62. void ImportTestSetup( KeyValues *pKV );
  63. void CommitSettingsToKV( void );
  64. MESSAGE_FUNC_PARAMS( OnSetTestItemKVs, "SetTestItemKVs", pKV );
  65. MESSAGE_FUNC_PARAMS( OnButtonChecked, "CheckButtonChecked", pData );
  66. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  67. private:
  68. void SetupComboBoxes( void );
  69. private:
  70. int m_iClassUsage;
  71. vgui::EditablePanel *m_pClassUsagePanel;
  72. vgui::EditablePanel *m_pTestingPanel;
  73. vgui::EditablePanel *m_pBotAdditionPanel;
  74. CTestItemBotControls *m_pBotControlPanel;
  75. // Testing panel
  76. CExButton *m_pItemTestButtons[TI_TYPE_COUNT];
  77. CExButton *m_pItemRemoveButtons[TI_TYPE_COUNT];
  78. CExLabel *m_pItemTestLabels[TI_TYPE_COUNT];
  79. vgui::CheckButton *m_pClassCheckButtons[TF_LAST_NORMAL_CLASS];
  80. KeyValues *m_pItemTestKVs[TI_TYPE_COUNT];
  81. // Bot addition panel
  82. vgui::ComboBox *m_pBotSelectionComboBox;
  83. vgui::CheckButton *m_pAutoAddBotsCheckBox;
  84. vgui::CheckButton *m_pBotsOnBlueTeamCheckBox;
  85. CExButton *m_pAddBotButton;
  86. vgui::DHANDLE<CTestItemDialog> m_hEditItemDialog;
  87. vgui::FileOpenDialog *m_hImportExportDialog;
  88. bool m_bExporting;
  89. };
  90. #endif // TESTITEM_ROOT_H