summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/testitem_root.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 /game/client/tf/vgui/testitem_root.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/vgui/testitem_root.h')
-rw-r--r--game/client/tf/vgui/testitem_root.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/game/client/tf/vgui/testitem_root.h b/game/client/tf/vgui/testitem_root.h
new file mode 100644
index 0000000..1fed8b3
--- /dev/null
+++ b/game/client/tf/vgui/testitem_root.h
@@ -0,0 +1,109 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef TESTITEM_ROOT_H
+#define TESTITEM_ROOT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "vgui_controls/EditablePanel.h"
+#include "vgui_controls/ScrollableEditablePanel.h"
+#include "tf_controls.h"
+#include "testitem_dialog.h"
+
+
+//-----------------------------------------------------------------------------
+// A panel that handles the overall item testing process
+//-----------------------------------------------------------------------------
+class CTestItemBotControls : public vgui::EditablePanel, public CGameEventListener
+{
+ DECLARE_CLASS_SIMPLE( CTestItemBotControls, vgui::EditablePanel );
+public:
+ CTestItemBotControls( vgui::Panel *parent );
+ ~CTestItemBotControls( void );
+
+ void SetupComboBoxes( void );
+ virtual void FireGameEvent( IGameEvent *event );
+ void ImportTestSetup( KeyValues *pKV );
+ void Close( void );
+ void SetEmbedded( bool bEmbedded ) { m_bEmbedded = bEmbedded; InvalidateLayout(); }
+
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void PerformLayout( void );
+ virtual void OnCommand( const char *command );
+ void UpdateBots( void );
+ void CommitSettingsToKV( void );
+
+private:
+ vgui::ComboBox *m_pBotAnimationComboBox;
+ vgui::Slider *m_pBotAnimationSpeedSlider;
+ vgui::CheckButton *m_pBotForceFireCheckBox;
+ vgui::CheckButton *m_pBotTurntableCheckBox;
+ vgui::CheckButton *m_pBotViewScanCheckBox;
+ bool m_bEmbedded;
+};
+
+
+//-----------------------------------------------------------------------------
+// A panel that handles the overall item testing process
+//-----------------------------------------------------------------------------
+class CTestItemRoot : public vgui::EditablePanel, public CGameEventListener
+{
+ DECLARE_CLASS_SIMPLE( CTestItemRoot, vgui::EditablePanel );
+public:
+ CTestItemRoot( vgui::Panel *parent );
+ ~CTestItemRoot( void );
+
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void PerformLayout( void );
+ virtual void OnCommand( const char *command );
+ virtual void FireGameEvent( IGameEvent *event );
+
+ void Close( void );
+ void CloseAndTestItem( void );
+ void UpdateTestItems( void );
+ int FindReplaceableItemsForSelectedClass( CUtlVector<item_definition_index_t> *pItemDefs = NULL, bool bWeapons = false );
+ void ExportTestSetup( const char *pFilename );
+ void ImportTestSetup( const char *pFilename );
+ void ImportTestSetup( KeyValues *pKV );
+ void CommitSettingsToKV( void );
+
+ MESSAGE_FUNC_PARAMS( OnSetTestItemKVs, "SetTestItemKVs", pKV );
+ MESSAGE_FUNC_PARAMS( OnButtonChecked, "CheckButtonChecked", pData );
+ MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
+
+private:
+ void SetupComboBoxes( void );
+
+private:
+ int m_iClassUsage;
+
+ vgui::EditablePanel *m_pClassUsagePanel;
+ vgui::EditablePanel *m_pTestingPanel;
+ vgui::EditablePanel *m_pBotAdditionPanel;
+ CTestItemBotControls *m_pBotControlPanel;
+
+ // Testing panel
+ CExButton *m_pItemTestButtons[TI_TYPE_COUNT];
+ CExButton *m_pItemRemoveButtons[TI_TYPE_COUNT];
+ CExLabel *m_pItemTestLabels[TI_TYPE_COUNT];
+ vgui::CheckButton *m_pClassCheckButtons[TF_LAST_NORMAL_CLASS];
+ KeyValues *m_pItemTestKVs[TI_TYPE_COUNT];
+
+ // Bot addition panel
+ vgui::ComboBox *m_pBotSelectionComboBox;
+ vgui::CheckButton *m_pAutoAddBotsCheckBox;
+ vgui::CheckButton *m_pBotsOnBlueTeamCheckBox;
+ CExButton *m_pAddBotButton;
+
+ vgui::DHANDLE<CTestItemDialog> m_hEditItemDialog;
+ vgui::FileOpenDialog *m_hImportExportDialog;
+ bool m_bExporting;
+};
+
+#endif // TESTITEM_ROOT_H