datablockField.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _GUI_INSPECTOR_DATABLOCKFIELD_H_
  23. #define _GUI_INSPECTOR_DATABLOCKFIELD_H_
  24. #include "gui/editor/guiInspectorTypes.h"
  25. //-----------------------------------------------------------------------------
  26. // GuiInspectorDatablockField - custom field type for datablock enumeration
  27. //-----------------------------------------------------------------------------
  28. class GuiInspectorDatablockField : public GuiInspectorTypeMenuBase
  29. {
  30. public:
  31. typedef GuiInspectorTypeMenuBase Parent;
  32. protected:
  33. AbstractClassRep *mDesiredClass;
  34. virtual SimSet* _getDatablockSet() const { return Sim::getDataBlockSet(); }
  35. virtual void _populateMenu( GuiPopUpMenuCtrl* menu );
  36. public:
  37. DECLARE_CONOBJECT(GuiInspectorDatablockField);
  38. GuiInspectorDatablockField( StringTableEntry className );
  39. GuiInspectorDatablockField() { mDesiredClass = NULL; };
  40. void setClassName( StringTableEntry className );
  41. };
  42. //-----------------------------------------------------------------------------
  43. // TypeSFXDescriptionName GuiInspectorField Class
  44. //-----------------------------------------------------------------------------
  45. class GuiInspectorTypeSFXDescriptionName : public GuiInspectorDatablockField
  46. {
  47. public:
  48. typedef GuiInspectorDatablockField Parent;
  49. protected:
  50. virtual SimSet* _getDatablockSet() const { return Sim::getSFXDescriptionSet(); }
  51. public:
  52. DECLARE_CONOBJECT(GuiInspectorTypeSFXDescriptionName);
  53. static void consoleInit();
  54. };
  55. //-----------------------------------------------------------------------------
  56. // TypeSFXTrackName GuiInspectorField Class
  57. //-----------------------------------------------------------------------------
  58. class GuiInspectorTypeSFXTrackName : public GuiInspectorDatablockField
  59. {
  60. public:
  61. typedef GuiInspectorDatablockField Parent;
  62. protected:
  63. virtual SimSet* _getDatablockSet() const { return Sim::getSFXTrackSet(); }
  64. public:
  65. DECLARE_CONOBJECT(GuiInspectorTypeSFXTrackName);
  66. static void consoleInit();
  67. };
  68. //-----------------------------------------------------------------------------
  69. // TypeSFXEnvironmentName GuiInspectorField Class
  70. //-----------------------------------------------------------------------------
  71. class GuiInspectorTypeSFXEnvironmentName : public GuiInspectorDatablockField
  72. {
  73. public:
  74. typedef GuiInspectorDatablockField Parent;
  75. protected:
  76. virtual SimSet* _getDatablockSet() const { return Sim::getSFXEnvironmentSet(); }
  77. public:
  78. DECLARE_CONOBJECT(GuiInspectorTypeSFXEnvironmentName);
  79. static void consoleInit();
  80. };
  81. //-----------------------------------------------------------------------------
  82. // TypeSFXAmbienceName GuiInspectorField Class
  83. //-----------------------------------------------------------------------------
  84. class GuiInspectorTypeSFXAmbienceName : public GuiInspectorDatablockField
  85. {
  86. public:
  87. typedef GuiInspectorDatablockField Parent;
  88. protected:
  89. virtual SimSet* _getDatablockSet() const { return Sim::getSFXAmbienceSet(); }
  90. public:
  91. DECLARE_CONOBJECT(GuiInspectorTypeSFXAmbienceName);
  92. static void consoleInit();
  93. };
  94. #endif