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.

57 lines
1.2 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "KeyValues.h"
  9. #include "dme_controls/ElementPropertiesTree.h"
  10. #include "datamodel/dmelement.h"
  11. #include "vgui_controls/TextEntry.h"
  12. #include "vgui_controls/ComboBox.h"
  13. #include "vgui_controls/Button.h"
  14. #include "vgui_controls/PanelListPanel.h"
  15. #include "FactoryOverloads.h"
  16. void CFactoryOverloads::AddOverload(
  17. char const *attributeName,
  18. IAttributeWidgetFactory *newFactory,
  19. IAttributeElementChoiceList *newChoiceList )
  20. {
  21. Assert( attributeName );
  22. Assert( newFactory || newChoiceList );
  23. if ( !newFactory )
  24. {
  25. return;
  26. }
  27. Entry_t e;
  28. e.factory = newFactory;
  29. e.choices = newChoiceList;
  30. m_Overloads.Insert( attributeName, e );
  31. }
  32. int CFactoryOverloads::Count()
  33. {
  34. return m_Overloads.Count();
  35. }
  36. char const *CFactoryOverloads::Name( int index )
  37. {
  38. return m_Overloads.GetElementName( index );
  39. }
  40. IAttributeWidgetFactory *CFactoryOverloads::Factory( int index )
  41. {
  42. return m_Overloads[ index ].factory;
  43. }
  44. IAttributeElementChoiceList *CFactoryOverloads::ChoiceList( int index )
  45. {
  46. return m_Overloads[ index ].choices;
  47. }