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.

116 lines
3.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MDLSEQUENCEPICKER_H
  7. #define MDLSEQUENCEPICKER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/ImageList.h"
  12. #include "vgui_controls/Frame.h"
  13. #include "datacache/imdlcache.h"
  14. #include "matsys_controls/mdlpanel.h"
  15. //-----------------------------------------------------------------------------
  16. // Forward declarations
  17. //-----------------------------------------------------------------------------
  18. namespace vgui
  19. {
  20. class Splitter;
  21. class Button;
  22. }
  23. class CGameFileTreeView;
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Main app window
  26. //-----------------------------------------------------------------------------
  27. class CMDLSequencePicker : public vgui::EditablePanel
  28. {
  29. DECLARE_CLASS_SIMPLE( CMDLSequencePicker, vgui::EditablePanel );
  30. public:
  31. CMDLSequencePicker( vgui::Panel *pParent );
  32. virtual ~CMDLSequencePicker();
  33. // overridden frame functions
  34. virtual void Activate();
  35. virtual void OnClose();
  36. virtual void PerformLayout();
  37. virtual void OnTick();
  38. char const *GetModelName();
  39. char const *GetSequenceName();
  40. int GetSequenceNumber();
  41. private:
  42. void SelectMDL( const char *pMDLName );
  43. void RefreshFileList();
  44. void RefreshActivitiesAndSequencesList();
  45. // Plays the selected activity
  46. void PlaySelectedActivity( );
  47. // Plays the selected sequence
  48. void PlaySelectedSequence( );
  49. MESSAGE_FUNC( OnFileSelected, "TreeViewItemSelected" );
  50. MESSAGE_FUNC_PTR_CHARPTR( OnTextChanged, "TextChanged", Panel, text );
  51. MESSAGE_FUNC_PARAMS( OnItemSelected, "ItemSelected", kv );
  52. MESSAGE_FUNC( OnPageChanged, "PageChanged" );
  53. // changes
  54. // MESSAGE_FUNC_INT( CloakFolder, "CloakFolder", item );
  55. // MESSAGE_FUNC_INT( OpenFileForEdit, "EditFile", item );
  56. // MESSAGE_FUNC_INT( OpenFileForDelete, "DeleteFile", item );
  57. CMDLPanel *m_pMDLPreview;
  58. vgui::ComboBox *m_pFilterList;
  59. CGameFileTreeView *m_pFileTree;
  60. vgui::ImageList m_Images;
  61. vgui::Splitter* m_pMDLSplitter;
  62. vgui::Splitter* m_pSequenceSplitter;
  63. vgui::PropertySheet *m_pViewsSheet;
  64. vgui::PropertyPage *m_pSequencesPage;
  65. vgui::PropertyPage *m_pActivitiesPage;
  66. vgui::ListPanel *m_pSequencesList;
  67. vgui::ListPanel *m_pActivitiesList;
  68. MDLHandle_t m_hSelectedMDL;
  69. friend class CMDLSequencePickerFrame;
  70. };
  71. //-----------------------------------------------------------------------------
  72. // Model sequence picker frame
  73. //-----------------------------------------------------------------------------
  74. class CMDLSequencePickerFrame : public vgui::Frame
  75. {
  76. DECLARE_CLASS_SIMPLE( CMDLSequencePickerFrame, vgui::Frame );
  77. public:
  78. CMDLSequencePickerFrame( vgui::Panel *parent, char const *title );
  79. virtual ~CMDLSequencePickerFrame();
  80. virtual void PerformLayout();
  81. protected:
  82. virtual void OnTick();
  83. MESSAGE_FUNC( OnOK, "OnOK" );
  84. MESSAGE_FUNC( OnCancel, "OnCancel" );
  85. private:
  86. CMDLSequencePicker *m_pMDLSequencePicker;
  87. vgui::Button *m_pOK;
  88. vgui::Button *m_pCancel;
  89. };
  90. #endif // MDLSEQUENCEPICKER_H