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.

99 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TESTITEM_DIALOG_H
  8. #define TESTITEM_DIALOG_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. enum testitem_entrysteps_t
  16. {
  17. TI_STEP_MODELNAME,
  18. TI_STEP_WPN_ITEMREPLACED,
  19. TI_STEP_NONWPN_BODYGROUPS,
  20. TI_STEP_OTHER_OPTIONS,
  21. TI_STEP_CUSTOMIZATION,
  22. TI_STEP_FINISHED,
  23. };
  24. enum testitem_bodygroups_to_hide_t
  25. {
  26. TI_HIDEBG_HAT,
  27. TI_HIDEBG_HEADPHONES,
  28. TI_HIDEBG_MEDALS,
  29. TI_HIDEBG_GRENADES,
  30. TI_HIDEBG_BULLETS,
  31. TI_HIDEBG_ARROWS,
  32. TI_HIDEBG_RIGHTARM,
  33. TI_HIDEBG_SHOES_SOCKS,
  34. TI_HIDEBG_COUNT,
  35. };
  36. //-----------------------------------------------------------------------------
  37. // A dialog that handles adding or modifying an item we're testing
  38. //-----------------------------------------------------------------------------
  39. class CTestItemDialog : public vgui::EditablePanel, public CGameEventListener
  40. {
  41. DECLARE_CLASS_SIMPLE( CTestItemDialog, vgui::EditablePanel );
  42. public:
  43. CTestItemDialog( vgui::Panel *parent, testitem_itemtypes_t iItemType, int iClassUsage, KeyValues *pExistingKVs );
  44. ~CTestItemDialog( void );
  45. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  46. virtual void PerformLayout( void );
  47. virtual void OnCommand( const char *command );
  48. virtual void FireGameEvent( IGameEvent *event );
  49. void Close( void );
  50. void CloseAndUpdateItem( void );
  51. MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", data );
  52. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  53. private:
  54. void InitializeFromExistingKVs( KeyValues *pExistingKVs );
  55. void SetEntryStep( testitem_entrysteps_t iStep );
  56. void OpenSelectModelDialog( void );
  57. void SetupItemComboBox( vgui::ComboBox *pComboBox );
  58. void SetupPaintColorComboBox( void );
  59. void SetupUnusualEffectComboBox( void );
  60. void HandleClassCheckbuttonChecked( vgui::Panel *pPanel );
  61. private:
  62. testitem_entrysteps_t m_iEntryStep;
  63. testitem_itemtypes_t m_iItemType;
  64. int m_iClassUsage;
  65. vgui::FileOpenDialog *m_hImportModelDialog;
  66. char m_szRelativePath[MAX_PATH];
  67. CExLabel *m_pModelLabel;
  68. CExLabel *m_pSelectModelLabel;
  69. CExLabel *m_pNoItemsToReplaceLabel;
  70. CExButton *m_pSelectModelButton;
  71. CExButton *m_pOkButton;
  72. vgui::ComboBox *m_pItemReplacedComboBox;
  73. vgui::EditablePanel *m_pBodygroupPanel;
  74. vgui::EditablePanel *m_pItemReplacedPanel;
  75. vgui::CheckButton *m_pBodygroupCheckButtons[TI_HIDEBG_COUNT];
  76. vgui::EditablePanel *m_pCustomizationsPanel;
  77. vgui::ComboBox *m_pPaintColorComboBox;
  78. vgui::ComboBox *m_pUnusualEffectComboBox;
  79. vgui::EditablePanel *m_pExistingItemToTestPanel;
  80. vgui::ComboBox *m_pExistingItemComboBox;
  81. };
  82. #endif // TESTITEM_DIALOG_H