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.

90 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef PARTICLESYSTEMDEFINITIONBROWSER_H
  7. #define PARTICLESYSTEMDEFINITIONBROWSER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "vgui_controls/editablepanel.h"
  12. #include "tier1/utlstring.h"
  13. #include "particles/particles.h"
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. class CPetDoc;
  18. class CDmeParticleSystemDefinition;
  19. class CUndoScopeGuard;
  20. namespace vgui
  21. {
  22. class ComboBox;
  23. class Button;
  24. class TextEntry;
  25. class ListPanel;
  26. class CheckButton;
  27. class RadioButton;
  28. }
  29. //-----------------------------------------------------------------------------
  30. // Panel that shows all entities in the level
  31. //-----------------------------------------------------------------------------
  32. class CParticleSystemDefinitionBrowser : public vgui::EditablePanel
  33. {
  34. DECLARE_CLASS_SIMPLE( CParticleSystemDefinitionBrowser, vgui::EditablePanel );
  35. public:
  36. CParticleSystemDefinitionBrowser( CPetDoc *pDoc, vgui::Panel* pParent, const char *pName ); // standard constructor
  37. virtual ~CParticleSystemDefinitionBrowser();
  38. // Inherited from Panel
  39. virtual void OnCommand( const char *pCommand );
  40. virtual void OnKeyCodeTyped( vgui::KeyCode code );
  41. MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath );
  42. // Methods related to updating the listpanel
  43. void UpdateParticleSystemList();
  44. // Select a particular node
  45. void SelectParticleSystem( CDmeParticleSystemDefinition *pParticleSystem );
  46. // Copy, paste.
  47. void CopyToClipboard( );
  48. void PasteFromClipboard( );
  49. private:
  50. // Messages handled
  51. MESSAGE_FUNC( OnItemDeselected, "ItemDeselected" );
  52. MESSAGE_FUNC( OnItemSelected, "ItemSelected" );
  53. MESSAGE_FUNC_PARAMS( OnInputCompleted, "InputCompleted", kv );
  54. void ReplaceDef_r( CUndoScopeGuard& guard, CDmeParticleSystemDefinition *pDef );
  55. // Gets the ith selected particle system
  56. CDmeParticleSystemDefinition* GetSelectedParticleSystem( int i );
  57. // Called when the selection changes
  58. void UpdateParticleSystemSelection();
  59. // Deletes selected particle systems
  60. void DeleteParticleSystems();
  61. // Create from KV
  62. void LoadKVSection( CDmeParticleSystemDefinition *pNew, KeyValues *pOverridesKv, ParticleFunctionType_t eType );
  63. CDmeParticleSystemDefinition* CreateParticleFromKV( KeyValues *pKeyValue );
  64. void CreateParticleSystemsFromKV( const char *pFilepath );
  65. // Shows the most recent selected object in properties window
  66. void OnProperties();
  67. CPetDoc *m_pDoc;
  68. vgui::ListPanel *m_pParticleSystemsDefinitions;
  69. };
  70. #endif // PARTICLESYSTEMDEFINITIONBROWSER_H