SExtContentBrowser.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. // Copyright 2017-2021 marynate. All Rights Reserved.
  2. #pragma once
  3. #include "ExtContentBrowser.h"
  4. #include "IExtContentBrowserSingleton.h"
  5. #include "Input/Reply.h"
  6. #include "Layout/Visibility.h"
  7. #include "Widgets/DeclarativeSyntaxSupport.h"
  8. #include "Widgets/SWidget.h"
  9. #include "Widgets/SCompoundWidget.h"
  10. #include "SAssetSearchBox.h"
  11. #include "Framework/MultiBox/MultiBoxExtender.h"
  12. #include "AssetRegistry/AssetData.h"
  13. #if ECB_WIP_COLLECTION
  14. #include "CollectionManagerTypes.h"
  15. #endif
  16. #if ECB_WIP_HISTORY
  17. #include "HistoryManager.h"
  18. #endif
  19. class FAssetContextMenu;
  20. class FFrontendFilter_Text;
  21. class FSourcesSearch;
  22. class FPathContextMenu;
  23. class FTabManager;
  24. class FUICommandList;
  25. class SExtDependencyViewer;
  26. class SExtAssetView;
  27. class SCollectionView;
  28. class SComboButton;
  29. class SExtFilterList;
  30. class SExtPathView;
  31. class SSplitter;
  32. class UFactory;
  33. /**
  34. * A widget to display and work with uasset files
  35. */
  36. class SExtContentBrowser
  37. : public SCompoundWidget
  38. {
  39. public:
  40. SLATE_BEGIN_ARGS(SExtContentBrowser)
  41. : _ContainingTab()
  42. , _InitiallyLocked(false)
  43. {}
  44. /** The tab in which the content browser resides */
  45. SLATE_ARGUMENT( TSharedPtr<SDockTab>, ContainingTab )
  46. /** If true, this content browser will not sync from external sources. */
  47. SLATE_ARGUMENT( bool, InitiallyLocked )
  48. SLATE_END_ARGS()
  49. ~SExtContentBrowser();
  50. /** Constructs this widget with InArgs */
  51. void Construct( const FArguments& InArgs, const FName& InstanceName);
  52. virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
  53. #if ECB_WIP_SYNC_ASSET
  54. /**
  55. * Changes sources to show the specified assets and selects them in the asset view
  56. *
  57. * @param AssetDataList - A list of assets to sync the view to
  58. *
  59. * @param bAllowImplicitSync - true to allow the view to sync to parent folders if they are already selected,
  60. * false to force the view to select the explicit Parent folders of each asset
  61. */
  62. void SyncToAssets( const TArray<FExtAssetData>& AssetDataList, const bool bAllowImplicitSync = false, const bool bDisableFiltersThatHideAssets = true );
  63. /**
  64. * Changes sources to show the specified folders and selects them in the asset view
  65. *
  66. * @param FolderList - A list of folders to sync the view to
  67. *
  68. * @param bAllowImplicitSync - true to allow the view to sync to parent folders if they are already selected,
  69. * false to force the view to select the explicit Parent folders of each asset
  70. */
  71. void SyncToFolders( const TArray<FString>& FolderList, const bool bAllowImplicitSync = false );
  72. /**
  73. * Changes sources to show the specified items and selects them in the asset view
  74. *
  75. * @param AssetDataList - A list of assets to sync the view to
  76. *
  77. * @param bAllowImplicitSync - true to allow the view to sync to parent folders if they are already selected,
  78. * false to force the view to select the explicit Parent folders of each asset
  79. */
  80. void SyncTo( const FExtContentBrowserSelection& ItemSelection, const bool bAllowImplicitSync = false, const bool bDisableFiltersThatHideAssets = true );
  81. #endif
  82. /** Sets this content browser as the primary browser. The primary browser is the target for asset syncs and contributes to the global selection set. */
  83. void SetIsPrimaryContentBrowser(bool NewIsPrimary);
  84. /** Returns if this browser can be used as the primary browser. */
  85. bool CanSetAsPrimaryContentBrowser() const;
  86. #if ECB_WIP_MULTI_INSTANCES
  87. /** Get the unique name of this content browser's in */
  88. const FName GetInstanceName() const;
  89. /** Gets the tab manager for the tab containing this browser */
  90. TSharedPtr<FTabManager> GetTabManager() const;
  91. /** Handler for when "Open in new Content Browser" is selected */
  92. void OpenNewContentBrowser();
  93. #endif
  94. #if ECB_LEGACY
  95. /** Loads all selected assets if unloaded */
  96. void LoadSelectedObjectsIfNeeded();
  97. #endif
  98. /** Returns all the assets that are selected in the asset view */
  99. void GetSelectedAssets(TArray<FExtAssetData>& SelectedAssets);
  100. #if ECB_LEGACY
  101. /** Returns all the folders that are selected in the asset view */
  102. void GetSelectedFolders(TArray<FString>& SelectedFolders);
  103. /** Returns the folders that are selected in the path view */
  104. TArray<FString> GetSelectedPathViewFolders();
  105. #endif
  106. /** Saves all persistent settings to config and returns a string identifier */
  107. void SaveSettings() const;
  108. #if ECB_LEGACY
  109. /** Sets the content browser to show the specified paths */
  110. void SetSelectedPaths(const TArray<FString>& FolderPaths, bool bNeedsRefresh = false);
  111. #endif
  112. #if ECB_WIP_LOCK
  113. /** Returns true if this content browser does not accept syncing from an external source */
  114. bool IsLocked() const;
  115. #endif
  116. /** Gives keyboard focus to the asset search box */
  117. void SetKeyboardFocusOnSearch() const;
  118. virtual FReply OnKeyDown( const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent ) override;
  119. #if ECB_LEGACY
  120. virtual FReply OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
  121. virtual FReply OnPreviewMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent ) override;
  122. virtual FReply OnMouseButtonDoubleClick( const FGeometry& InMyGeometry, const FPointerEvent& InMouseEvent ) override;
  123. #endif
  124. private:
  125. #if ECB_WIP_SYNC_ASSET
  126. /** Called prior to syncing the selection in this Content Browser */
  127. void PrepareToSync( const TArray<FAssetData>& AssetDataList, const TArray<FString>& FolderPaths, const bool bDisableFiltersThatHideAssets );
  128. #endif
  129. /** Called to retrieve the text that should be highlighted on assets */
  130. FText GetHighlightedText() const;
  131. /** Called to work out whether the import button should be enabled */
  132. bool IsImportEnabled() const;
  133. /** Called to retrieve the text that should be in the import tooltip */
  134. FText GetImportTooltipText() const;
  135. /** Called when a containing tab is closing, if there is one */
  136. void OnContainingTabSavingVisualState() const;
  137. /** Called when a containing tab is closed, if there is one */
  138. void OnContainingTabClosed(TSharedRef<SDockTab> DockTab);
  139. /** Called when a containing tab is activated, if there is one */
  140. void OnContainingTabActivated(TSharedRef<SDockTab> DockTab, ETabActivationCause InActivationCause);
  141. /** Loads settings from config based on the browser's InstanceName*/
  142. void LoadSettings(const FName& InstanceName);
  143. /** Handler for when the sources were changed */
  144. void SourcesChanged(const TArray<FString>& SelectedPaths, const TArray<FCollectionNameType>& SelectedCollections);
  145. /** Handler for when a folder has been entered in the path view */
  146. void FolderEntered(const FString& FolderPath);
  147. /** Handler for when a path has been selected in the path view */
  148. void PathSelected(const FString& FolderPath);
  149. #if ECB_WIP_FAVORITE
  150. /** Handler for when a path has been selected in the favorite path view */
  151. void FavoritePathSelected(const FString& FolderPath);
  152. /** Gets the current path if one exists, otherwise returns empty string. */
  153. FString GetCurrentPath() const;
  154. #endif
  155. /** Get the asset tree context menu */
  156. TSharedRef<FExtender> GetPathContextMenuExtender(const TArray<FString>& SelectedPaths) const;
  157. #if ECB_WIP_COLLECTION
  158. /** Handler for when a collection has been selected in the collection view */
  159. void CollectionSelected(const FCollectionNameType& SelectedCollection);
  160. /** Handler for when the sources were changed by the path picker */
  161. void PathPickerPathSelected(const FString& FolderPath);
  162. /** Handler for when the sources were changed by the path picker collection view */
  163. void PathPickerCollectionSelected(const FCollectionNameType& SelectedCollection);
  164. /** Sets the state of the browser to the one described by the supplied history data */
  165. void OnApplyHistoryData(const FHistoryData& History);
  166. /** Updates the supplied history data with current information */
  167. void OnUpdateHistoryData(FHistoryData& History) const;
  168. #endif
  169. #if ECB_FEA_SEARCH
  170. /** Called when the editable text needs to be set or cleared */
  171. void SetSearchBoxText(const FText& InSearchText);
  172. /** Called by the editable text control when the search text is changed by the user */
  173. void OnSearchBoxChanged(const FText& InSearchText);
  174. /** Called by the editable text control when the user commits a text change */
  175. void OnSearchBoxCommitted(const FText& InSearchText, ETextCommit::Type CommitInfo);
  176. #endif
  177. #if ECB_LEGACY
  178. /** Should the "Save Search" button be enabled? */
  179. bool IsSaveSearchButtonEnabled() const;
  180. /** Open the menu to let you save the current search text as a dynamic collection */
  181. FReply OnSaveSearchButtonClicked();
  182. /** Called when a crumb in the path breadcrumb trail or menu is clicked */
  183. void OnPathClicked(const FString& CrumbData);
  184. /** Called when item in the path delimiter arrow menu is clicked */
  185. void OnPathMenuItemClicked(FString ClickedPath);
  186. /**
  187. * Populates the delimiter arrow with a menu of directories under the current directory that can be navigated to
  188. *
  189. * @param CrumbData The current directory path
  190. * @return The directory menu
  191. */
  192. TSharedPtr<SWidget> OnGetCrumbDelimiterContent(const FString& CrumbData) const;
  193. /** Gets the content for the path picker combo button */
  194. TSharedRef<SWidget> GetPathPickerContent();
  195. #endif
  196. /** Handle creating a context menu for the "Add New" button */
  197. TSharedRef<SWidget> MakeAddNewContextMenu(bool bShowGetContent, bool bShowImport);
  198. #if ECB_LEGACY
  199. /** Called to work out whether the import button should be enabled */
  200. bool IsAddNewEnabled() const;
  201. /** Gets the tool tip for the "Add New" button */
  202. FText GetAddNewToolTipText() const;
  203. #endif
  204. /** Makes the filters menu */
  205. TSharedRef<SWidget> MakeAddFilterMenu();
  206. /** Builds the context menu for the filter list area. */
  207. TSharedPtr<SWidget> GetFilterContextMenu();
  208. /** Imports uasset files. */
  209. void ImportAsset(const TArray<FExtAssetData>& InAssetDatas);
  210. /** Imports uasset files to sandbox folder. */
  211. void ImportAssetToSandbox(const TArray<FExtAssetData>& InAssetDatas);
  212. void ImportAssetFlatMode(const TArray<FExtAssetData>& InAssetDatas);
  213. /** Imports a new piece of content. */
  214. FReply HandleImportClicked();
  215. /** Imports a new piece of content. */
  216. FReply HandleImportToSandboxClicked();
  217. FReply HandleFlatImportClicked();
  218. /** Zip uasset with dependencies. */
  219. FReply HandleExportAssetClicked();
  220. /** Called to work out whether the zip button should be enabled */
  221. bool IsExportAssetEnabled() const;
  222. /** Zip uasset with dependencies. */
  223. FReply HandleZipExportClicked();
  224. bool IsValidateEnabled() const;
  225. FReply HandleValidateclicked();
  226. #if ECB_FEA_IMPORT_OPTIONS
  227. /** Returns the foreground color for the import options */
  228. FSlateColor GetImportOptionsButtonForegroundColor() const;
  229. /** Handler for when the import options combo button is clicked */
  230. TSharedRef<SWidget> GetImportOptionsButtonContent();
  231. #endif
  232. /** Handle add root content folder button clicked. */
  233. FReply HandleAddContentFolderClicked();
  234. /** Add root content folder. */
  235. void AddContentFolder();
  236. /** Handle add root content folder button clicked. */
  237. FReply HandleRemoveContentFoldersClicked();
  238. /** Add root content folder. */
  239. void RemoveContentFolders();
  240. /** If can remove content folders */
  241. bool CanRemoveContentFolders() const;
  242. #if ECB_LEGACY
  243. /** Opens the add content dialog. */
  244. void OnAddContentRequested();
  245. #endif
  246. /** Handler for when the selection set in the asset view has changed. */
  247. void OnAssetSelectionChanged(const FExtAssetData& SelectedAsset);
  248. #if ECB_LEGACY
  249. /** Handler for when the user double clicks, presses enter, or presses space on an asset */
  250. void OnAssetsActivated(const TArray<FAssetData>& ActivatedAssets, EAssetTypeActivationMethod::Type ActivationMethod);
  251. #endif
  252. /** Handler for when an asset context menu has been requested. */
  253. TSharedPtr<SWidget> OnGetAssetContextMenu(const TArray<FExtAssetData>& SelectedAssets);
  254. #if ECB_WIP_LOCK
  255. /** Handler for clicking the lock button */
  256. FReply ToggleLockClicked();
  257. /** Gets the brush used on the lock button */
  258. const FSlateBrush* GetToggleLockImage() const;
  259. #endif
  260. /** Gets the visibility by last frame width */
  261. EVisibility GetVisibilityByLastFrameWidth(float MinWidthToShow) const;
  262. /** Gets the visibility state of the asset tree */
  263. EVisibility GetSourcesViewVisibility() const;
  264. /** Gets the brush used to on the sources toggle button */
  265. const FSlateBrush* GetSourcesToggleImage() const;
  266. /** Handler for clicking the tree expand/collapse button */
  267. FReply SourcesViewExpandClicked();
  268. /** Gets the visibility of the path expander button */
  269. EVisibility GetPathExpanderVisibility() const;
  270. #if ECB_FEA_REF_VIEWER
  271. /** Gets the visibility state of the asset tree */
  272. EVisibility GetReferencesViewerVisibility() const;
  273. /** Gets the brush used to on the sources toggle button */
  274. const FSlateBrush* GetDependencyViewerToggleImage() const;
  275. /** Handler for clicking the tree expand/collapse button */
  276. FReply ReferenceViewerExpandClicked();
  277. #endif
  278. #if ECB_WIP_HISTORY
  279. /** Handler for clicking the history back button */
  280. FReply BackClicked();
  281. /** Handler for clicking the history forward button */
  282. FReply ForwardClicked();
  283. /** Gets the tool tip text for the history back button */
  284. FText GetHistoryBackTooltip() const;
  285. /** Gets the tool tip text for the history forward button */
  286. FText GetHistoryForwardTooltip() const;
  287. /** True if the user may use the history back button */
  288. bool IsBackEnabled() const;
  289. /** True if the user may use the history forward button */
  290. bool IsForwardEnabled() const;
  291. #endif
  292. #if ECB_LEGACY
  293. /** Handler for SaveAll in folder */
  294. void HandleSaveAllCurrentFolderCommand() const;
  295. /** Handler for opening assets or folders */
  296. void HandleOpenAssetsOrFoldersCommandExecute();
  297. /** Handler for previewing assets */
  298. void HandlePreviewAssetsCommandExecute();
  299. /** Handler for clicking the directory up button */
  300. void HandleDirectoryUpCommandExecute();
  301. /** True if the user may use the directory up button */
  302. bool CanExecuteDirectoryUp() const;
  303. /** Gets the tool tip text for the directory up button */
  304. FText GetDirectoryUpTooltip() const;
  305. /** Gets the Visibility for the directory up buttons tooltip (hidden if empty) */
  306. EVisibility GetDirectoryUpToolTipVisibility() const;
  307. #endif
  308. void HandleImportSelectedCommandExecute();
  309. void HandleToggleDependencyViewerCommandExecute();
  310. #if ECB_WIP_BREADCRUMB
  311. /** Updates the breadcrumb trail to the current path */
  312. void UpdatePath();
  313. #endif
  314. /** Handler for when a filter in the filter list has changed */
  315. void OnFilterChanged();
  316. #if ECB_LEGACY
  317. /** Gets the text for the path label */
  318. FText GetPathText() const;
  319. /** Returns true if currently filtering by a source */
  320. bool IsFilteredBySource() const;
  321. #endif
  322. #if ECB_WIP_SYNC_ASSET
  323. /** Handler for when the context menu or asset view requests to find assets in the asset tree */
  324. void OnFindInAssetTreeRequested(const TArray<FAssetData>& AssetsToFind);
  325. #endif
  326. #if ECB_LEGACY
  327. /** Handler for when the user has committed a rename of an asset */
  328. void OnAssetRenameCommitted(const TArray<FAssetData>& Assets);
  329. /** Handler for when the asset context menu requests to rename an asset */
  330. void OnRenameRequested(const FAssetData& AssetData);
  331. /** Handler for when the asset context menu requests to rename a folder */
  332. void OnRenameFolderRequested(const FString& FolderToRename);
  333. /** Handler for when the path context menu has successfully deleted a folder */
  334. void OnOpenedFolderDeleted();
  335. /** Handler for when the asset context menu requests to refresh the asset view */
  336. void OnAssetViewRefreshRequested();
  337. /** Handles an on collection destroyed event */
  338. void HandleCollectionRemoved(const FCollectionNameType& Collection);
  339. /** Handles an on collection renamed event */
  340. void HandleCollectionRenamed(const FCollectionNameType& OriginalCollection, const FCollectionNameType& NewCollection);
  341. /** Handles an on collection updated event */
  342. void HandleCollectionUpdated(const FCollectionNameType& Collection);
  343. /** Handles a path removed event */
  344. void HandlePathRemoved(const FString& Path);
  345. #endif
  346. #if ECB_FEA_SEARCH
  347. /** Gets all suggestions for the asset search box */
  348. void OnAssetSearchSuggestionFilter(const FText& SearchText, TArray<FAssetSearchBoxSuggestion>& PossibleSuggestions, FText& SuggestionHighlightText) const;
  349. /** Combines the chosen suggestion with the active search text */
  350. FText OnAssetSearchSuggestionChosen(const FText& SearchText, const FString& Suggestion) const;
  351. /** Gets the dynamic hint text for the "Search Assets" search text box */
  352. FText GetSearchAssetsHintText() const;
  353. #endif
  354. /** Delegate called when generating the context menu for a folder */
  355. TSharedPtr<SWidget> GetFolderContextMenu(const TArray<FString>& SelectedPaths, FContentBrowserMenuExtender_SelectedPaths InMenuExtender, FOnCreateNewFolder OnCreateNewFolder, bool bPathView);
  356. #if ECB_WIP_DELEGATES
  357. /** Delegate called to get the current selection state */
  358. void GetSelectionState(TArray<FExtAssetData>& SelectedAssets, TArray<FString>& SelectedPaths);
  359. #endif
  360. /** Handler for when "Clear Folder Selection" is selected */
  361. void ClearFolderSelection();
  362. /** Bind our UI commands */
  363. void BindCommands();
  364. /** Gets the visibility of the collection view */
  365. EVisibility GetCollectionViewVisibility() const;
  366. /** Gets the visibility of the favorites view */
  367. EVisibility GetFavoriteFolderVisibility() const;
  368. #if ECB_FEA_SEARCH
  369. /** The visibility of the search bar for the base path view*/
  370. EVisibility GetAlternateSearchBarVisibility() const;
  371. /** Called when Asset View Options "Search" options change */
  372. void HandleAssetViewSearchOptionsChanged();
  373. #endif
  374. void HandleRequestShowChangeLog();
  375. #if ECB_WIP_FAVORITE
  376. /** Toggles the favorite status of an array of folders*/
  377. void ToggleFolderFavorite(const TArray<FString>& FolderPaths);
  378. #endif
  379. #if ECB_DEBUG
  380. FReply HandlePrintCacheClicked();
  381. FReply HandleClearCacheClicked();
  382. FReply HandlePrintAssetDataClicked();
  383. #endif
  384. void ShowPluginVersionChangeLog();
  385. /** Delegate called when an editor setting is changed */
  386. void HandleSettingChanged(FName PropertyName);
  387. void UpdateAssetReferenceSplitterOrientation();
  388. FSlateColor GetContentBrowserBorderBackgroundColor() const;
  389. FSlateColor GetToolbarBackgroundColor() const;
  390. FSlateColor GetSourceViewBackgroundColor() const;
  391. FSlateColor GetAssetViewBackgroundColor() const;
  392. private:
  393. /** The tab that contains this browser */
  394. TWeakPtr<SDockTab> ContainingTab;
  395. #if ECB_WIP_HISTORY
  396. /** The manager that keeps track of history data for this browser */
  397. FHistoryManager HistoryManager;
  398. #endif
  399. /** A helper class to manage asset context menu options */
  400. TSharedPtr<class FAssetContextMenu> AssetContextMenu;
  401. /** The context menu manager for the path view */
  402. TSharedPtr<class FPathContextMenu> PathContextMenu;
  403. /** The asset tree widget */
  404. TSharedPtr<SExtPathView> PathViewPtr;
  405. #if ECB_WIP_FAVORITE
  406. /** The favorites tree widget */
  407. TSharedPtr<class SFavoritePathView> FavoritePathViewPtr;
  408. #endif
  409. #if ECB_WIP_COLLECTION
  410. /** The collection widget */
  411. TSharedPtr<SCollectionView> CollectionViewPtr;
  412. #endif
  413. /** The asset view widget */
  414. TSharedPtr<SExtAssetView> AssetViewPtr;
  415. #if ECB_WIP_BREADCRUMB
  416. /** The breadcrumb trail representing the current path */
  417. TSharedPtr< SBreadcrumbTrail<FString> > PathBreadcrumbTrail;
  418. #endif
  419. #if ECB_FEA_SEARCH
  420. /** The text box used to search for assets */
  421. TSharedPtr<SAssetSearchBox> SearchBoxPtr;
  422. /** The text filter to use on the assets */
  423. TSharedPtr< FFrontendFilter_Text > TextFilter;
  424. /** When viewing a dynamic collection, the active search query will be stashed in this variable so that it can be restored again later */
  425. TOptional<FText> StashedSearchBoxText;
  426. #endif
  427. /** The filter list */
  428. TSharedPtr<SExtFilterList> FilterListPtr;
  429. /** The filter list */
  430. TSharedPtr<SExtDependencyViewer> ReferenceViewerPtr;
  431. #if ECB_WIP_PATHPICKER
  432. /** The path picker */
  433. TSharedPtr<SComboButton> PathPickerButton;
  434. #endif
  435. #if ECB_WIP_CACHEDB
  436. void HandleCacheDBFilePathPicked(const FString& PickedPath);
  437. FReply HandleLoadCacheDBclicked();
  438. FReply HandleSaveCacheDBClicked();
  439. FReply HandleSaveAndSwitchToCacheModeClicked();
  440. FReply HandlePurgeCacheDBClicked();
  441. //FReply HandleSwitchAndLoadCacheDBClicked();
  442. /** Callback for picking a path in the source directory picker. */
  443. void HandleSwitchAndLoadCacheDBClicked(const FString& PickedPath);
  444. FText GetSaveAndSwitchToCacheModeText() const;
  445. FText GetCacheStatusText() const;
  446. EVisibility GetCacheStatusBarVisibility() const;
  447. #endif
  448. #if ECB_FEA_IMPORT_OPTIONS
  449. /** The button that displays import options */
  450. TSharedPtr<SComboButton> ImportOptionsComboButton;
  451. #endif
  452. /** The expanded state of the asset tree */
  453. bool bSourcesViewExpanded;
  454. /** The expanded state of the asset tree */
  455. bool bReferenceViewerExpanded;
  456. /** True if this browser is the primary content browser */
  457. bool bIsPrimaryBrowser;
  458. /** True if this content browser can be set to the primary browser. */
  459. bool bCanSetAsPrimaryBrowser;
  460. /** Unique name for this Content Browser. */
  461. FName InstanceName;
  462. /** True if source should not be changed from an outside source */
  463. bool bIsLocked;
  464. /** True if can remove selected content folders */
  465. bool bCanRemoveContentFolders;
  466. /** The list of FrontendFilters currently applied to the asset view */
  467. TSharedPtr<FExtAssetFilterCollectionType> FrontendFilters;
  468. /** Commands handled by this widget */
  469. TSharedPtr< FUICommandList > Commands;
  470. /** The splitter between the path & asset view */
  471. TSharedPtr<SSplitter> PathAssetSplitterPtr;
  472. /** The splitter between the path & collection view */
  473. TSharedPtr<SSplitter> PathCollectionSplitterPtr;
  474. /** The splitter between the path & favorite view */
  475. TSharedPtr<SSplitter> PathFavoriteSplitterPtr;
  476. /** The splitter between the asset & dependency view */
  477. TSharedPtr<SSplitter> AssetReferenceSplitterPtr;
  478. /** True if we should always show collections in this Content Browser, ignoring the view settings */
  479. bool bAlwaysShowCollections;
  480. public:
  481. /** The section of EditorPerProjectUserSettings in which to save content browser settings */
  482. static const FString SettingsIniSection;
  483. private:
  484. TSharedRef<SWidget> CreateChangeLogWidget();
  485. TSharedPtr<class IDocumentationPage > AboutPage;
  486. bool bShowChangelog = false;
  487. float WidthLastFrame;
  488. };