Team Fortress 2 Source Code as on 22/4/2020
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.

84 lines
2.9 KiB

  1. //========= Copyright 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. // Refreshes display
  48. void Refresh( bool bValuesOnly = true );
  49. private:
  50. // For inheriting classes to get notified without having to listen to messages
  51. virtual void OnParticleSystemModified() {}
  52. MESSAGE_FUNC( OnTextChanged, "TextChanged" );
  53. MESSAGE_FUNC_PARAMS( OnDmeElementChanged, "DmeElementChanged", params );
  54. MESSAGE_FUNC( OnParticleSystemModifiedInternal, "ParticleSystemModified" );
  55. MESSAGE_FUNC_PARAMS( OnParticleFunctionSelChanged, "ParticleFunctionSelChanged", params );
  56. IParticleSystemPropertiesPanelQuery *m_pQuery;
  57. vgui::Splitter *m_pSplitter;
  58. vgui::ComboBox *m_pFunctionTypeCombo;
  59. vgui::EditablePanel *m_pFunctionBrowserArea;
  60. CParticleFunctionBrowser *m_pParticleFunctionBrowser[PARTICLE_FUNCTION_COUNT];
  61. CDmeElementPanel *m_pParticleFunctionProperties;
  62. CDmeHandle< CDmeParticleSystemDefinition > m_hParticleSystem;
  63. };
  64. #endif // PARTICLESYSTEMPROPERTIESPANEL_H