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.

89 lines
3.1 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: Dialog used to edit properties of a particle system definition
  4. //
  5. //===========================================================================//
  6. #ifndef PARTICLESYSTEMPROPERTIESPANEL_H
  7. #define PARTICLESYSTEMPROPERTIESPANEL_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. #include "particles/particles.h"
  15. //-----------------------------------------------------------------------------
  16. // Forward declarations
  17. //-----------------------------------------------------------------------------
  18. class CDmeParticleSystemDefinition;
  19. class CParticleFunctionBrowser;
  20. class CDmeElementPanel;
  21. namespace vgui
  22. {
  23. class Splitter;
  24. class ComboBox;
  25. }
  26. //-----------------------------------------------------------------------------
  27. // Used by the panel to discover the list of known particle system definitions
  28. //-----------------------------------------------------------------------------
  29. class IParticleSystemPropertiesPanelQuery
  30. {
  31. public:
  32. virtual void GetKnownParticleDefinitions( CUtlVector< CDmeParticleSystemDefinition* > &definitions ) = 0;
  33. };
  34. //-----------------------------------------------------------------------------
  35. // Panel used to edit a particle system definition
  36. //-----------------------------------------------------------------------------
  37. class CParticleSystemPropertiesPanel : public vgui::EditablePanel
  38. {
  39. DECLARE_CLASS_SIMPLE( CParticleSystemPropertiesPanel, vgui::EditablePanel );
  40. // Sends the message 'ParticleSystemModified' when the particle system was modified in any way
  41. // Sends the message 'ParticleFunctionSelChanged' when the selected particle function changed
  42. // -- stores the selected CDmeParticleFunction in a subkey called 'function'
  43. public:
  44. CParticleSystemPropertiesPanel( IParticleSystemPropertiesPanelQuery *pQuery, vgui::Panel* pParent ); // standard constructor
  45. // Sets the particle system to look at
  46. void SetParticleSystem( CDmeParticleSystemDefinition *pParticleSystem );
  47. CDmeParticleSystemDefinition *GetParticleSystem( );
  48. // Refreshes display
  49. void Refresh( bool bValuesOnly = true );
  50. void DeleteSelectedFunctions( );
  51. private:
  52. // For inheriting classes to get notified without having to listen to messages
  53. virtual void OnParticleSystemModified() {}
  54. MESSAGE_FUNC_PARAMS( OnDmeElementChanged, "DmeElementChanged", params );
  55. MESSAGE_FUNC( OnParticleSystemModifiedInternal, "ParticleSystemModified" );
  56. MESSAGE_FUNC_PARAMS( OnParticleFunctionSelChanged, "ParticleFunctionSelChanged", params );
  57. MESSAGE_FUNC( OnPasteFuncs, "PasteFuncs" );
  58. MESSAGE_FUNC( OnCopy, "OnCopy" );
  59. KEYBINDING_FUNC_NODECLARE( edit_copy, KEY_C, vgui::MODIFIER_CONTROL, OnCopy, "#edit_copy_help", 0 );
  60. IParticleSystemPropertiesPanelQuery *m_pQuery;
  61. vgui::Splitter *m_pSplitter;
  62. vgui::EditablePanel *m_pFunctionBrowserArea;
  63. CParticleFunctionBrowser *m_pParticleFunctionBrowser;
  64. CDmeElementPanel *m_pParticleFunctionProperties;
  65. CDmeHandle< CDmeParticleSystemDefinition > m_hParticleSystem;
  66. };
  67. #endif // PARTICLESYSTEMPROPERTIESPANEL_H