Counter Strike : Global Offensive Source Code
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.

139 lines
3.5 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MDLPICKER_H
  7. #define MDLPICKER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier1/utlstring.h"
  12. #include "vgui_controls/Frame.h"
  13. #include "matsys_controls/baseassetpicker.h"
  14. #include "datacache/imdlcache.h"
  15. //-----------------------------------------------------------------------------
  16. // Forward declarations
  17. //-----------------------------------------------------------------------------
  18. namespace vgui
  19. {
  20. class Splitter;
  21. }
  22. class CMDLPanel;
  23. //-----------------------------------------------------------------------------
  24. // Purpose: Main app window
  25. //-----------------------------------------------------------------------------
  26. class CMDLPicker : public CBaseAssetPicker
  27. {
  28. DECLARE_CLASS_SIMPLE( CMDLPicker, CBaseAssetPicker );
  29. public:
  30. enum PageType_t
  31. {
  32. PAGE_NONE = 0,
  33. PAGE_RENDER = 0x1,
  34. PAGE_SEQUENCES = 0x2,
  35. PAGE_ACTIVITIES = 0x4,
  36. PAGE_SKINS = 0x8,
  37. PAGE_INFO = 0x10,
  38. PAGE_ALL = 0xFFFFFFFF,
  39. };
  40. CMDLPicker( vgui::Panel *pParent, int nFlags = PAGE_ALL );
  41. ~CMDLPicker();
  42. // overridden frame functions
  43. virtual void PerformLayout();
  44. virtual void OnCommand( const char *pCommand );
  45. // Get current model
  46. void GetSelectedMDLName( char *pBuffer, int nMaxLen );
  47. // get current selected options page
  48. int GetSelectedPage();
  49. // Allows external apps to select a MDL
  50. void SelectMDL( const char *pRelativePath );
  51. // Set/Get Sequence
  52. void SelectSequence( const char *pSequenceName );
  53. const char *GetSelectedSequenceName();
  54. // Set/Get Activity
  55. void SelectActivity( const char *pActivityName );
  56. const char *GetSelectedActivityName();
  57. void SelectSkin( int nSkin );
  58. int GetSelectedSkin();
  59. private:
  60. MESSAGE_FUNC_PARAMS( OnAssetSelected, "AssetSelected", params );
  61. virtual void OnSelectedAssetPicked( const char *pMDLName );
  62. void RefreshActivitiesAndSequencesList();
  63. void RefreshRenderSettings();
  64. int UpdateSkinsList();
  65. void UpdateInfoTab();
  66. int UpdatePropDataList( KeyValues *pkvPropData, bool &bIsStatic );
  67. // Plays the selected activity
  68. void PlaySelectedActivity( );
  69. // Plays the selected sequence
  70. void PlaySelectedSequence( );
  71. MESSAGE_FUNC_PARAMS( OnCheckButtonChecked, "CheckButtonChecked", kv );
  72. MESSAGE_FUNC_PARAMS( OnItemSelected, "ItemSelected", kv );
  73. MESSAGE_FUNC( OnPageChanged, "PageChanged" );
  74. CMDLPanel *m_pMDLPreview;
  75. vgui::Splitter* m_pFileBrowserSplitter;
  76. vgui::Splitter* m_pPreviewSplitter;
  77. vgui::PropertySheet *m_pViewsSheet;
  78. vgui::PropertyPage *m_pRenderPage;
  79. vgui::PropertyPage *m_pSequencesPage;
  80. vgui::PropertyPage *m_pActivitiesPage;
  81. vgui::PropertyPage *m_pSkinsPage;
  82. vgui::PropertyPage *m_pInfoPage;
  83. vgui::ListPanel *m_pSequencesList;
  84. vgui::ListPanel *m_pActivitiesList;
  85. vgui::ListPanel *m_pSkinsList;
  86. vgui::ListPanel *m_pPropDataList;
  87. MDLHandle_t m_hSelectedMDL;
  88. int m_nFlags;
  89. friend class CMDLPickerFrame;
  90. };
  91. //-----------------------------------------------------------------------------
  92. // Purpose: Main app window
  93. //-----------------------------------------------------------------------------
  94. class CMDLPickerFrame : public CBaseAssetPickerFrame
  95. {
  96. DECLARE_CLASS_SIMPLE( CMDLPickerFrame, CBaseAssetPickerFrame );
  97. public:
  98. CMDLPickerFrame( vgui::Panel *pParent, const char *pTitle, int nFlags = CMDLPicker::PAGE_ALL );
  99. virtual ~CMDLPickerFrame();
  100. // Allows external apps to select a MDL
  101. void SelectMDL( const char *pRelativePath );
  102. };
  103. #endif // MDLPICKER_H