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 /tools/commedit/commentarypropertiespanel.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'tools/commedit/commentarypropertiespanel.h')
| -rw-r--r-- | tools/commedit/commentarypropertiespanel.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/tools/commedit/commentarypropertiespanel.h b/tools/commedit/commentarypropertiespanel.h new file mode 100644 index 0000000..35e27e5 --- /dev/null +++ b/tools/commedit/commentarypropertiespanel.h @@ -0,0 +1,113 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#ifndef COMMENTARYPROPERTIESPANEL_H +#define COMMENTARYPROPERTIESPANEL_H +#ifdef _WIN32 +#pragma once +#endif + +#include "vgui_controls/editablepanel.h" +#include "tier1/utlstring.h" +#include "datamodel/dmehandle.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class CCommEditDoc; +class CDmeCommentaryNodeEntity; + +namespace vgui +{ + class ComboBox; + class Button; + class TextEntry; + class ListPanel; + class CheckButton; + class RadioButton; +} + + +//----------------------------------------------------------------------------- +// Panel that shows all entities in the level +//----------------------------------------------------------------------------- +class CCommentaryPropertiesPanel : public vgui::EditablePanel +{ + DECLARE_CLASS_SIMPLE( CCommentaryPropertiesPanel, vgui::EditablePanel ); + +public: + CCommentaryPropertiesPanel( CCommEditDoc *pDoc, vgui::Panel* pParent ); // standard constructor + + // Inherited from Panel + virtual void OnCommand( const char *pCommand ); + + // Sets the object to look at + void SetObject( CDmeCommentaryNodeEntity *pEntity ); + +private: + // Populates the commentary node fields + void PopulateCommentaryNodeFields(); + + // Populates the info_target fields + void PopulateInfoTargetFields(); + + // Text to attribute... + void TextEntryToAttribute( vgui::TextEntry *pEntry, const char *pAttributeName ); + void TextEntriesToVector( vgui::TextEntry *pEntry[3], const char *pAttributeName ); + + // Updates entity state when text fields change + void UpdateCommentaryNode(); + void UpdateInfoTarget(); + + // Called when the audio picker button is selected + void PickSound(); + + // Called when sound recording is requested + void RecordSound( ); + + // Called when the audio picker button is selected + void PickInfoTarget( vgui::TextEntry *pControl ); + + // Messages handled + MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv ); + MESSAGE_FUNC_PARAMS( OnSoundSelected, "SoundSelected", kv ); + MESSAGE_FUNC_PARAMS( OnPicked, "Picked", kv ); + MESSAGE_FUNC_PARAMS( OnFileSelected, "FileSelected", kv ); + MESSAGE_FUNC_PARAMS( OnSoundRecorded, "SoundRecorded", kv ); + + CCommEditDoc *m_pDoc; + + vgui::EditablePanel *m_pCommentaryNodeScroll; + vgui::EditablePanel *m_pInfoTargetScroll; + vgui::EditablePanel *m_pCommentaryNode; + vgui::EditablePanel *m_pInfoTarget; + + vgui::TextEntry *m_pNodeName; + vgui::Button *m_pSoundFilePicker; + vgui::TextEntry *m_pSoundFileName; + vgui::Button *m_pRecordSound; + vgui::TextEntry *m_pSpeakerName; + vgui::TextEntry *m_pSynopsis; + vgui::TextEntry *m_pViewPosition; + vgui::Button *m_pViewPositionPicker; + vgui::TextEntry *m_pViewTarget; + vgui::Button *m_pViewTargetPicker; + vgui::TextEntry *m_pStartCommands; + vgui::TextEntry *m_pEndCommands; + vgui::CheckButton *m_pPreventMovement; + vgui::TextEntry *m_pPosition[3]; + vgui::TextEntry *m_pOrientation[3]; + + vgui::TextEntry *m_pTargetName; + vgui::TextEntry *m_pTargetPosition[3]; + vgui::TextEntry *m_pTargetOrientation[3]; + + CDmeHandle< CDmeCommentaryNodeEntity > m_hEntity; +}; + + +#endif // COMMENTARYPROPERTIESPANEL_H |