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 /vgui2/dme_controls/FactoryOverloads.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'vgui2/dme_controls/FactoryOverloads.cpp')
| -rw-r--r-- | vgui2/dme_controls/FactoryOverloads.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/vgui2/dme_controls/FactoryOverloads.cpp b/vgui2/dme_controls/FactoryOverloads.cpp new file mode 100644 index 0000000..5bc785c --- /dev/null +++ b/vgui2/dme_controls/FactoryOverloads.cpp @@ -0,0 +1,58 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// + +#include "KeyValues.h" +#include "dme_controls/ElementPropertiesTree.h" +#include "datamodel/dmelement.h" + +#include "vgui_controls/TextEntry.h" +#include "vgui_controls/ComboBox.h" +#include "vgui_controls/Button.h" +#include "vgui_controls/PanelListPanel.h" + +#include "FactoryOverloads.h" + +void CFactoryOverloads::AddOverload( + char const *attributeName, + IAttributeWidgetFactory *newFactory, + IAttributeElementChoiceList *newChoiceList ) +{ + Assert( attributeName ); + Assert( newFactory || newChoiceList ); + + if ( !newFactory ) + { + return; + } + + Entry_t e; + e.factory = newFactory; + e.choices = newChoiceList; + + m_Overloads.Insert( attributeName, e ); +} + +int CFactoryOverloads::Count() +{ + return m_Overloads.Count(); +} + +char const *CFactoryOverloads::Name( int index ) +{ + return m_Overloads.GetElementName( index ); +} + +IAttributeWidgetFactory *CFactoryOverloads::Factory( int index ) +{ + return m_Overloads[ index ].factory; +} + +IAttributeElementChoiceList *CFactoryOverloads::ChoiceList( int index ) +{ + return m_Overloads[ index ].choices; +}
\ No newline at end of file |