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/pet/particlesystemdefinitionbrowser.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'tools/pet/particlesystemdefinitionbrowser.h')
| -rw-r--r-- | tools/pet/particlesystemdefinitionbrowser.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/tools/pet/particlesystemdefinitionbrowser.h b/tools/pet/particlesystemdefinitionbrowser.h new file mode 100644 index 0000000..725b2a1 --- /dev/null +++ b/tools/pet/particlesystemdefinitionbrowser.h @@ -0,0 +1,90 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#ifndef PARTICLESYSTEMDEFINITIONBROWSER_H +#define PARTICLESYSTEMDEFINITIONBROWSER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "vgui_controls/editablepanel.h" +#include "tier1/utlstring.h" +#include "particles/particles.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class CPetDoc; +class CDmeParticleSystemDefinition; +class CUndoScopeGuard; +namespace vgui +{ + class ComboBox; + class Button; + class TextEntry; + class ListPanel; + class CheckButton; + class RadioButton; +} + + +//----------------------------------------------------------------------------- +// Panel that shows all entities in the level +//----------------------------------------------------------------------------- +class CParticleSystemDefinitionBrowser : public vgui::EditablePanel +{ + DECLARE_CLASS_SIMPLE( CParticleSystemDefinitionBrowser, vgui::EditablePanel ); + +public: + CParticleSystemDefinitionBrowser( CPetDoc *pDoc, vgui::Panel* pParent, const char *pName ); // standard constructor + virtual ~CParticleSystemDefinitionBrowser(); + + // Inherited from Panel + virtual void OnCommand( const char *pCommand ); + virtual void OnKeyCodeTyped( vgui::KeyCode code ); + MESSAGE_FUNC_CHARPTR( OnFileSelected, "FileSelected", fullpath ); + // Methods related to updating the listpanel + void UpdateParticleSystemList(); + + // Select a particular node + void SelectParticleSystem( CDmeParticleSystemDefinition *pParticleSystem ); + + // Copy, paste. + void CopyToClipboard( ); + void PasteFromClipboard( ); + +private: + // Messages handled + MESSAGE_FUNC( OnItemDeselected, "ItemDeselected" ); + MESSAGE_FUNC( OnItemSelected, "ItemSelected" ); + MESSAGE_FUNC_PARAMS( OnInputCompleted, "InputCompleted", kv ); + + void ReplaceDef_r( CUndoScopeGuard& guard, CDmeParticleSystemDefinition *pDef ); + + // Gets the ith selected particle system + CDmeParticleSystemDefinition* GetSelectedParticleSystem( int i ); + + // Called when the selection changes + void UpdateParticleSystemSelection(); + + // Deletes selected particle systems + void DeleteParticleSystems(); + + // Create from KV + void LoadKVSection( CDmeParticleSystemDefinition *pNew, KeyValues *pOverridesKv, ParticleFunctionType_t eType ); + CDmeParticleSystemDefinition* CreateParticleFromKV( KeyValues *pKeyValue ); + void CreateParticleSystemsFromKV( const char *pFilepath ); + + // Shows the most recent selected object in properties window + void OnProperties(); + + CPetDoc *m_pDoc; + vgui::ListPanel *m_pParticleSystemsDefinitions; +}; + + +#endif // PARTICLESYSTEMDEFINITIONBROWSER_H |