ClassDesc.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Description : Class description of CBaseObject
  9. #ifndef CRYINCLUDE_EDITOR_OBJECTS_CLASSDESC_H
  10. #define CRYINCLUDE_EDITOR_OBJECTS_CLASSDESC_H
  11. #pragma once
  12. #include "Plugin.h"
  13. #include "Include/ObjectEvent.h"
  14. #include <QString>
  15. class CXmlArchive;
  16. AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  17. //! Virtual base class description of CBaseObject.
  18. //! Override this class to create specific Class descriptions for every base object class.
  19. //! Type name is specified like this:
  20. //! Category\Type ex: "TagPoint\Respawn"
  21. class SANDBOX_API CObjectClassDesc
  22. : public IClassDesc
  23. {
  24. AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  25. public:
  26. CObjectClassDesc()
  27. {
  28. m_nTextureIcon = 0;
  29. }
  30. //! Release class description.
  31. virtual ObjectType GetObjectType() = 0;
  32. virtual QObject* CreateQObject() const { return nullptr; }
  33. //! If this function return not empty string,object of this class must be created with file.
  34. //! Return root path where to look for files this object supports.
  35. //! Also wild card for files can be specified, ex: Objects\*.cgf
  36. virtual QString GetFileSpec()
  37. {
  38. return "";
  39. }
  40. virtual ESystemClassID SystemClassID() { return ESYSTEM_CLASS_OBJECT; };
  41. virtual void ShowAbout() {};
  42. virtual bool CanExitNow() { return true; }
  43. virtual void Serialize([[maybe_unused]] CXmlArchive& ar) {};
  44. //! Ex. Object with creation order 200 will be created after any object with order 100.
  45. virtual int GameCreationOrder() { return 100; };
  46. virtual QString GetTextureIcon() { return QString(); };
  47. virtual bool RenderTextureOnTop() const { return false; }
  48. virtual QString GetToolClassName() { return "EditTool.ObjectCreate"; }
  49. QString MenuSuggestion() { return{}; }
  50. QString Tooltip() { return{}; }
  51. QString Description() { return{}; }
  52. private:
  53. int m_nTextureIcon;
  54. };
  55. #endif // CRYINCLUDE_EDITOR_OBJECTS_CLASSDESC_H