diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/matsys_controls/sequencepicker.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/matsys_controls/sequencepicker.h')
| -rw-r--r-- | public/matsys_controls/sequencepicker.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/public/matsys_controls/sequencepicker.h b/public/matsys_controls/sequencepicker.h new file mode 100644 index 0000000..68e4729 --- /dev/null +++ b/public/matsys_controls/sequencepicker.h @@ -0,0 +1,111 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef SEQUENCEPICKER_H +#define SEQUENCEPICKER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tier1/utlstring.h" +#include "vgui_controls/Frame.h" +#include "vgui_controls/EditablePanel.h" +#include "vgui_controls/ImageList.h" +#include "datacache/imdlcache.h" +#include "matsys_controls/mdlpanel.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +namespace vgui +{ + class Splitter; +} + + +//----------------------------------------------------------------------------- +// Purpose: Sequence picker panel +//----------------------------------------------------------------------------- +class CSequencePicker : public vgui::EditablePanel +{ + DECLARE_CLASS_SIMPLE( CSequencePicker, vgui::EditablePanel ); + +public: + enum PickType_t + { + PICK_NONE = 0, + PICK_SEQUENCES = 0x1, + PICK_ACTIVITIES = 0x2, + PICK_ALL = 0xFFFFFFFF, + }; + + // Flags come from PickType_t + CSequencePicker( vgui::Panel *pParent, int nFlags = PICK_ALL ); + ~CSequencePicker(); + + // overridden frame functions + virtual void PerformLayout(); + + // Sets the MDL to preview sequences for + void SetMDL( const char *pMDLName ); + + // Gets the selected activity/sequence + PickType_t GetSelectedSequenceType(); + const char *GetSelectedSequenceName( ); + +private: + void RefreshActivitiesAndSequencesList(); + + // Plays the selected activity + void PlayActivity( const char *pActivityName ); + + // Plays the selected sequence + void PlaySequence( const char *pSequenceName ); + + MESSAGE_FUNC_PARAMS( OnItemSelected, "ItemSelected", kv ); + MESSAGE_FUNC( OnPageChanged, "PageChanged" ); + + CMDLPanel *m_pMDLPreview; + vgui::Splitter* m_pPreviewSplitter; + vgui::PropertySheet *m_pViewsSheet; + vgui::PropertyPage *m_pSequencesPage; + vgui::PropertyPage *m_pActivitiesPage; + vgui::ListPanel *m_pSequencesList; + vgui::ListPanel *m_pActivitiesList; + MDLHandle_t m_hSelectedMDL; + CUtlString m_Filter; + + friend class CSequencePickerFrame; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Main app window +//----------------------------------------------------------------------------- +class CSequencePickerFrame : public vgui::Frame +{ + DECLARE_CLASS_SIMPLE( CSequencePickerFrame, vgui::Frame ); + +public: + CSequencePickerFrame( vgui::Panel *pParent, int nFlags ); + + // Inherited from Frame + virtual void OnCommand( const char *pCommand ); + + // Purpose: Activate the dialog + void DoModal( const char *pMDLName ); + +private: + MESSAGE_FUNC_PARAMS( OnSequencePreviewChanged, "SequencePreviewChanged", kv ); + + CSequencePicker *m_pPicker; + vgui::Button *m_pOpenButton; + vgui::Button *m_pCancelButton; +}; + + +#endif // SEQUENCEPICKER_H |