ExtContentBrowser.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // Copyright 2017-2021 marynate. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Modules/ModuleManager.h"
  5. #include "IDocumentationProvider.h"
  6. #define ECB_WIP 0
  7. #define ECB_DEBUG 0
  8. #define ENABLE_ECB_LOG ECB_DEBUG & 1
  9. #define ECB_FOLD 1 // for folding code section only
  10. #define ECB_DISABLE 0 // for disable code block temporarily
  11. #define ECB_TODO 0 // todo list
  12. #define ECB_LEGACY 0 // legacy code holder, wait for review and remove
  13. ////////////////////////////////
  14. // Finished Features
  15. //
  16. #define ECB_FEA_SEARCH 1
  17. #define ECB_FEA_FILTER 1
  18. #define ECB_FEA_ASYNC_FOLDER_DISCOVERY 1
  19. // Import
  20. #define ECB_FEA_IMPORT_ROLLBACK 1
  21. #define ECB_FEA_IMPORT_OPTIONS 1
  22. #define ECB_FEA_IMPORT_IGNORE_SOFT_ERROR 1
  23. #define ECB_WIP_MULTI_IMPORT 1
  24. #define ECB_WIP_IMPORT_ADD_TO_COLLECTION 1
  25. // Dependency Viewer
  26. #define ECB_FEA_REF_VIEWER 1
  27. #define ECB_FEA_REF_VIEWER_OPTIONS ECB_FEA_REF_VIEWER & 1
  28. #define ECB_FEA_REF_VIEWER_NODE_SPACING 1
  29. // Asset Viewer
  30. #define ECB_FEA_ENGINE_VERSION_OVERLAY 1
  31. #define ECB_FEA_SHOW_INVALID 1
  32. #define ECB_FEA_SYNC_IN_CB 1
  33. #define ECB_FEA_VALIDATE 1
  34. #define ECB_FEA_VALIDATE_OVERLAY 1
  35. #define ECB_FEA_IMPORT_FLATMODE 1
  36. #define ECB_FEA_TOOLBAR_BUTTON_AUTOHIDE 1
  37. #define ECB_FEA_RELOAD_ROOT_FOLDER 1
  38. // Redirector Support
  39. #define ECB_FEA_REDIRECTOR_SUPPORT 1
  40. // Import Plugin Content
  41. #define ECB_FEA_IMPORT_PLUGIN 1
  42. // Asset Viewer
  43. #define ECB_FEA_ASSET_DRAG_DROP 1
  44. #define ECB_FEA_IMPORT_ADD_PLACE 1
  45. // Ignore Folders
  46. #define ECB_FEA_IGNORE_FOLDERS 1
  47. // Async
  48. #define ECB_FEA_ASYNC_ASSET_DISCOVERY 1
  49. ////////////////////////////////
  50. // Almost Done
  51. //
  52. // Import to Plugin instead of Project Content Folder
  53. #define ECB_WIP_IMPORT_TO_PLUGIN_FOLDER 1
  54. // Import Folder Color
  55. #define ECB_WIP_IMPORT_FOLDER_COLOR 1
  56. #define ECB_WIP_IMPORT_FOLDER_COLOR_OVERRIDE ECB_WIP_IMPORT_FOLDER_COLOR & 1
  57. // Orphan
  58. #define ECB_WIP_IMPORT_ORPHAN 1
  59. // Asset Viewer
  60. #define ECB_WIP_CONTENT_TYPE_OVERLAY 1
  61. #define ECB_WIP_REPARSE_ASSET 1
  62. // Cache Mode
  63. #define ECB_WIP_CACHEDB 1
  64. #define ECB_WIP_CACHEDB_LOADNAMEBATCH ECB_WIP_CACHEDB & 1 // 4.27+
  65. #define ECB_WIP_CACHEDB_SWITCH ECB_WIP_CACHEDB & 1
  66. // ThumbnailPool
  67. #define ECB_WIP_OBJECT_THUMB_POOL 1
  68. // Browser feature
  69. #define ECB_WIP_MORE_FILTER ECB_FEA_FILTER & 1
  70. // Custom Version Check
  71. #define ECB_WIP_IMPORT_CHECK_CUSTOM_VERSION 0
  72. ////////////////////////////////
  73. // WIP
  74. //
  75. // WIP: Show Hide Toolbar Button
  76. #define ECB_WIP_TOGGLE_TOOLBAR_BUTTON ECB_WIP & 0
  77. // WIP: Dependency Viewer
  78. #define ECB_WIP_REF_VIEWER_JUMP ECB_WIP & 0
  79. #define ECB_WIP_REF_VIEWER_HISTORY ECB_WIP & 0
  80. #define ECB_WIP_REF_VIEWER_HIGHLIGHT_ERROR ECB_WIP & 0
  81. // WIP: Browser feature
  82. #define ECB_WIP_SEARCH_RECURSE_TOGGLE ECB_WIP & 0
  83. #define ECB_WIP_MORE_VIEWTYPE ECB_WIP & 0
  84. #define ECB_WIP_INITIAL_ASSET ECB_WIP & 0
  85. #define ECB_WIP_FAVORITE ECB_WIP & 0
  86. #define ECB_WIP_COLLECTION ECB_WIP & 0
  87. #define ECB_WIP_BREADCRUMB ECB_WIP & 0
  88. #define ECB_WIP_HISTORY ECB_WIP & 0
  89. #define ECB_WIP_PATHPICKER ECB_WIP & 0
  90. #define ECB_WIP_LOCK ECB_WIP & 0
  91. #define ECB_WIP_MULTI_INSTANCES ECB_WIP & 0
  92. #define ECB_WIP_DELEGATES ECB_WIP & 0
  93. #define ECB_WIP_SYNC_ASSET ECB_WIP & 0
  94. #define ECB_WIP_FOLDER_ICONS ECB_WIP & 0
  95. // WIP: Asset Registry Serialization
  96. #define ECB_WIP_ASSETREGISTRY_SERIALIZATION ECB_WIP & 0
  97. // WIP: IMPORT
  98. #define ECB_WIP_IMPORT_SANDBOX ECB_WIP & 0
  99. #define ECB_WIP_IMPORT_FOR_DUMP ECB_WIP & 1
  100. // WIP: EXPORT
  101. #define ECB_WIP_EXPORT ECB_WIP & 0
  102. #define ECB_WIP_EXPORT_ZIP ECB_WIP_EXPORT & 1
  103. // WIP: Asset Viewer
  104. ////////////////////////////////
  105. // Experimental
  106. //
  107. // Thumbnail cache
  108. #define ECB_WIP_THUMB_CACHE ECB_WIP & 0
  109. DECLARE_LOG_CATEGORY_EXTERN(LogECB, Verbose, All);
  110. #if ENABLE_ECB_LOG
  111. #define ECB_LOG(Verbosity, Format, ...) \
  112. UE_LOG(LogECB, Verbosity, Format, ##__VA_ARGS__);
  113. #else
  114. #define ECB_LOG(Verbosity, Format, ...)
  115. #endif
  116. #define ECB_INFO(Verbosity, Format, ...) \
  117. UE_LOG(LogECB, Verbosity, Format, ##__VA_ARGS__);
  118. class IExtContentBrowserSingleton;
  119. struct FExtAssetData;
  120. class FExtDependencyGraphPanelNodeFactory;
  121. class FToolBarBuilder;
  122. class FMenuBuilder;
  123. class FExtender;
  124. /** Delegate called when selection changed. Provides more context than FOnAssetSelected */
  125. DECLARE_MULTICAST_DELEGATE_TwoParams(FOnExtAssetSelectionChanged, const TArray<FExtAssetData>& /*NewSelectedAssets*/, bool /*bIsPrimaryBrowser*/);
  126. class FExtContentBrowserModule : public IModuleInterface, public IDocumentationProvider
  127. {
  128. public:
  129. DECLARE_DELEGATE_RetVal(TSharedRef<FExtender>, FExtContentBrowserMenuExtender);
  130. public:
  131. /** IModuleInterface implementation */
  132. virtual void StartupModule() override;
  133. virtual void ShutdownModule() override;
  134. /** Gets the content browser singleton */
  135. virtual IExtContentBrowserSingleton& Get() const;
  136. virtual TArray<FExtContentBrowserMenuExtender>& GetAllAssetViewViewMenuExtenders() { return AssetViewViewMenuExtenders; }
  137. public:
  138. FOnExtAssetSelectionChanged& GetOnAssetSelectionChanged() { return OnAssetSelectionChanged; }
  139. public:
  140. // IDocumentationProvider interface
  141. virtual TSharedRef<IDocumentation> GetDocumentation() const override;
  142. private:
  143. TSharedPtr<IDocumentation> Documentation;
  144. private:
  145. IExtContentBrowserSingleton* ContentBrowserSingleton;
  146. TArray<FExtContentBrowserMenuExtender> AssetViewViewMenuExtenders;
  147. FOnExtAssetSelectionChanged OnAssetSelectionChanged;
  148. };