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.

116 lines
3.4 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef VMTPICKER_H
  7. #define VMTPICKER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "matsys_controls/baseassetpicker.h"
  12. #include "materialsystem/MaterialSystemUtil.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class CVMTPreviewPanel;
  17. class CSheetExtended;
  18. class CVMTSequenceMenuButton;
  19. class CVMTPicker;
  20. class CVMTPreviewToolbar;
  21. class CSheetSequencePanel;
  22. namespace vgui
  23. {
  24. class Splitter;
  25. class CheckButton;
  26. class Slider;
  27. class Panel;
  28. }
  29. //-----------------------------------------------------------------------------
  30. class CVMTPreviewToolbar : public vgui::EditablePanel
  31. {
  32. DECLARE_CLASS_SIMPLE( CVMTPreviewToolbar, EditablePanel );
  33. public:
  34. CVMTPreviewToolbar( vgui::Panel *parent, const char *panelName, CVMTPicker *parentpicker );
  35. void PopulateSequenceMenu( vgui::Menu *menu );
  36. int GetSequenceMenuItemCount( );
  37. void UpdateToolbarGUI();
  38. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  39. MESSAGE_FUNC_PARAMS( OnSliderMoved, "SliderMoved", pData );
  40. MESSAGE_FUNC_INT( OnSelectSequence, "OnSelectSequence", nSequenceNumber );
  41. MESSAGE_FUNC( OnNextSequence, "OnNextSequence" );
  42. MESSAGE_FUNC( OnPrevSequence, "OnPrevSequence" );
  43. MESSAGE_FUNC_PARAMS( OnSheetSequenceSelected, "SheetSequenceSelected", pData );
  44. private:
  45. vgui::Slider *m_pSheetPreviewSpeed;
  46. CVMTPicker *m_pParentPicker;
  47. vgui::Button *m_pNextSeqButton;
  48. vgui::Button *m_pPrevSeqButton;
  49. vgui::MenuButton *m_pSequenceSelection;
  50. vgui::MenuButton *m_pSequenceSelection_Second;
  51. CSheetSequencePanel *m_pSheetPanel;
  52. CSheetSequencePanel *m_pSheetPanel_Second;
  53. };
  54. //-----------------------------------------------------------------------------
  55. // Purpose: Base class for choosing raw assets
  56. //-----------------------------------------------------------------------------
  57. class CVMTPicker : public CBaseAssetPicker
  58. {
  59. DECLARE_CLASS_SIMPLE( CVMTPicker, CBaseAssetPicker );
  60. public:
  61. CVMTPicker( vgui::Panel *pParent, bool bAllowMultiselect = false );
  62. virtual ~CVMTPicker();
  63. virtual void CustomizeSelectionMessage( KeyValues *pKeyValues );
  64. void SetSheetPreviewSpeed( float flPreviewSpeed );
  65. void SetSelectedSequence( int nSequence );
  66. void SetSelectedSecondarySequence( int nSequence );
  67. int GetSheetSequenceCount();
  68. int GetCurrentSequence();
  69. int GetCurrentSecondarySequence();
  70. int GetRealSequenceNumber();
  71. CSheetExtended* GetSheet();
  72. IMaterial* GetMaterial();
  73. private:
  74. // Derived classes have this called when the previewed asset changes
  75. virtual void OnSelectedAssetPicked( const char *pAssetName );
  76. CVMTPreviewPanel *m_pVMTPreview2D;
  77. CVMTPreviewPanel *m_pVMTPreview3D;
  78. vgui::Splitter *m_p2D3DSplitter;
  79. vgui::Splitter *m_pPreviewSplitter;
  80. CVMTPreviewToolbar *m_pVMTPreviewToolbar;
  81. };
  82. //-----------------------------------------------------------------------------
  83. // Purpose: Modal dialog for asset picker
  84. //-----------------------------------------------------------------------------
  85. class CVMTPickerFrame : public CBaseAssetPickerFrame
  86. {
  87. DECLARE_CLASS_SIMPLE( CVMTPickerFrame, CBaseAssetPickerFrame );
  88. public:
  89. CVMTPickerFrame( vgui::Panel *pParent, const char *pTitle, bool bAllowMultiselect = false );
  90. };
  91. #endif // VMTPICKER_H