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.

123 lines
3.6 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef COMMENTARYPROPERTIESPANEL_H
  7. #define COMMENTARYPROPERTIESPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/editablepanel.h"
  12. #include "tier1/utlstring.h"
  13. #include "datamodel/dmehandle.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class CCommEditDoc;
  18. class CDmeCommentaryNodeEntity;
  19. namespace vgui
  20. {
  21. class ComboBox;
  22. class Button;
  23. class TextEntry;
  24. class ListPanel;
  25. class CheckButton;
  26. class RadioButton;
  27. }
  28. //-----------------------------------------------------------------------------
  29. // Panel that shows all entities in the level
  30. //-----------------------------------------------------------------------------
  31. class CCommentaryPropertiesPanel : public vgui::EditablePanel
  32. {
  33. DECLARE_CLASS_SIMPLE( CCommentaryPropertiesPanel, vgui::EditablePanel );
  34. public:
  35. CCommentaryPropertiesPanel( CCommEditDoc *pDoc, vgui::Panel* pParent ); // standard constructor
  36. // Inherited from Panel
  37. virtual void OnCommand( const char *pCommand );
  38. // Sets the object to look at
  39. void SetObject( CDmeCommentaryNodeEntity *pEntity );
  40. private:
  41. // Populates the commentary node fields
  42. void PopulateCommentaryNodeFields();
  43. // Populates the info_target fields
  44. void PopulateInfoTargetFields();
  45. // Populates the info_remarkable fields
  46. void PopulateInfoRemarkableFields();
  47. // Text to attribute...
  48. void TextEntryToAttribute( vgui::TextEntry *pEntry, const char *pAttributeName );
  49. void TextEntriesToVector( vgui::TextEntry *pEntry[3], const char *pAttributeName );
  50. // Updates entity state when text fields change
  51. void UpdateCommentaryNode();
  52. void UpdateInfoTarget();
  53. void UpdateInfoRemarkable();
  54. // Called when the audio picker button is selected
  55. void PickSound();
  56. // Called when sound recording is requested
  57. void RecordSound( );
  58. // Called when the audio picker button is selected
  59. void PickInfoTarget( vgui::TextEntry *pControl );
  60. // Messages handled
  61. MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );
  62. MESSAGE_FUNC_PARAMS( OnSoundSelected, "SoundSelected", kv );
  63. MESSAGE_FUNC_PARAMS( OnPicked, "Picked", kv );
  64. MESSAGE_FUNC_PARAMS( OnFileSelected, "FileSelected", kv );
  65. MESSAGE_FUNC_PARAMS( OnSoundRecorded, "SoundRecorded", kv );
  66. CCommEditDoc *m_pDoc;
  67. vgui::EditablePanel *m_pCommentaryNodeScroll;
  68. vgui::EditablePanel *m_pInfoTargetScroll;
  69. vgui::EditablePanel *m_pInfoRemarkableScroll;
  70. vgui::EditablePanel *m_pCommentaryNode;
  71. vgui::EditablePanel *m_pInfoTarget;
  72. vgui::EditablePanel *m_pInfoRemarkable;
  73. vgui::TextEntry *m_pNodeName;
  74. vgui::Button *m_pSoundFilePicker;
  75. vgui::TextEntry *m_pSoundFileName;
  76. vgui::Button *m_pRecordSound;
  77. vgui::TextEntry *m_pSpeakerName;
  78. vgui::TextEntry *m_pSynopsis;
  79. vgui::TextEntry *m_pViewPosition;
  80. vgui::Button *m_pViewPositionPicker;
  81. vgui::TextEntry *m_pViewTarget;
  82. vgui::Button *m_pViewTargetPicker;
  83. vgui::TextEntry *m_pStartCommands;
  84. vgui::TextEntry *m_pEndCommands;
  85. vgui::CheckButton *m_pPreventMovement;
  86. vgui::TextEntry *m_pPosition[3];
  87. vgui::TextEntry *m_pOrientation[3];
  88. vgui::TextEntry *m_pTargetName;
  89. vgui::TextEntry *m_pTargetPosition[3];
  90. vgui::TextEntry *m_pTargetOrientation[3];
  91. vgui::TextEntry *m_pInfoRemarkableName;
  92. vgui::TextEntry *m_pInfoRemarkableSubject;
  93. vgui::TextEntry *m_pRemarkablePosition[3];
  94. CDmeHandle< CDmeCommentaryNodeEntity > m_hEntity;
  95. };
  96. #endif // COMMENTARYPROPERTIESPANEL_H