You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
UETOOL-332 - Collections 2.0 UETOOL-373 - Check robustness of Collections 2.0 The collection manager will now fix-up any references to redirectors within its collections once the asset registry has finished discovering all the available assets. It also adds a watcher so it can pick up any moves or deletes as they happen. All of this fix-up is applied to the in-memory copy of the collection, and doesn't get persisted to disk until it needs to be (because referenced redirectors are being deleted). This helps to minimize issues with source control availability and shared/private collections. This change also makes sure that objects that are being referenced by a collection will leave a redirector behind, and also adds some extra context (such as the collection name) to some of the source control errors that may be reported when saving a collection. [CL 2602519 by Jamie Dale in Main branch]
96 lines
4.1 KiB
C++
96 lines
4.1 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#pragma once
|
|
|
|
class SContentBrowser;
|
|
class FNativeClassHierarchy;
|
|
class FCollectionAssetRegistryBridge;
|
|
|
|
#define MAX_CONTENT_BROWSERS 4
|
|
|
|
/**
|
|
* Content browser module singleton implementation class
|
|
*/
|
|
class FContentBrowserSingleton : public IContentBrowserSingleton
|
|
{
|
|
public:
|
|
/** Constructor, Destructor */
|
|
FContentBrowserSingleton();
|
|
virtual ~FContentBrowserSingleton();
|
|
|
|
// IContentBrowserSingleton interface
|
|
virtual TSharedRef<class SWidget> CreateAssetPicker(const FAssetPickerConfig& AssetPickerConfig) override;
|
|
virtual TSharedRef<class SWidget> CreatePathPicker(const FPathPickerConfig& PathPickerConfig) override;
|
|
virtual TSharedRef<class SWidget> CreateCollectionPicker(const FCollectionPickerConfig& CollectionPickerConfig) override;
|
|
virtual void CreateOpenAssetDialog(const FOpenAssetDialogConfig& OpenAssetConfig, const FOnAssetsChosenForOpen& OnAssetsChosenForOpen, const FOnAssetDialogCancelled& OnAssetDialogCancelled) override;
|
|
virtual TArray<FAssetData> CreateModalOpenAssetDialog(const FOpenAssetDialogConfig& InConfig) override;
|
|
virtual void CreateSaveAssetDialog(const FSaveAssetDialogConfig& SaveAssetConfig, const FOnObjectPathChosenForSave& OnAssetNameChosenForSave, const FOnAssetDialogCancelled& OnAssetDialogCancelled) override;
|
|
virtual FString CreateModalSaveAssetDialog(const FSaveAssetDialogConfig& SaveAssetConfig) override;
|
|
virtual bool HasPrimaryContentBrowser() const override;
|
|
virtual void FocusPrimaryContentBrowser(bool bFocusSearch) override;
|
|
virtual void CreateNewAsset(const FString& DefaultAssetName, const FString& PackagePath, UClass* AssetClass, UFactory* Factory) override;
|
|
virtual void SyncBrowserToAssets(const TArray<class FAssetData>& AssetDataList, bool bAllowLockedBrowsers = false) override;
|
|
virtual void SyncBrowserToAssets(const TArray<UObject*>& AssetList, bool bAllowLockedBrowsers = false) override;
|
|
virtual void GetSelectedAssets(TArray<FAssetData>& SelectedAssets) override;
|
|
|
|
/** Gets the content browser singleton as a FContentBrowserSingleton */
|
|
static FContentBrowserSingleton& Get();
|
|
|
|
/** Sets the current primary content browser. */
|
|
void SetPrimaryContentBrowser(const TSharedRef<SContentBrowser>& NewPrimaryBrowser);
|
|
|
|
/** Notifies the singleton that a browser was closed */
|
|
void ContentBrowserClosed(const TSharedRef<SContentBrowser>& ClosedBrowser);
|
|
|
|
TSharedRef<FNativeClassHierarchy> GetNativeClassHierarchy();
|
|
|
|
private:
|
|
|
|
/** Shared code to open an asset dialog window with a config */
|
|
void SharedCreateAssetDialogWindow(const TSharedRef<class SAssetDialog>& AssetDialog, const FSharedAssetDialogConfig& InConfig, bool bModal) const;
|
|
|
|
/**
|
|
* Delegate handlers
|
|
**/
|
|
void OnEditorLoadSelectedAssetsIfNeeded();
|
|
|
|
/** Sets the primary content browser to the next valid browser in the list of all browsers */
|
|
void ChooseNewPrimaryBrowser();
|
|
|
|
/** Gives focus to the specified content browser */
|
|
void FocusContentBrowser(const TSharedPtr<SContentBrowser>& BrowserToFocus);
|
|
|
|
/** Summons a new content browser */
|
|
void SummonNewBrowser(bool bAllowLockedBrowsers = false);
|
|
|
|
/** Handler for a request to spawn a new content browser tab */
|
|
TSharedRef<SDockTab> SpawnContentBrowserTab( const FSpawnTabArgs& SpawnTabArgs, int32 BrowserIdx );
|
|
|
|
/** Handler for a request to spawn a new content browser tab */
|
|
FText GetContentBrowserTabLabel(int32 BrowserIdx);
|
|
|
|
/** Returns true if this content browser is locked (can be used even when closed) */
|
|
bool IsLocked(const FName& InstanceName) const;
|
|
|
|
/** Returns a localized name for the tab/menu entry with index */
|
|
static FText GetContentBrowserLabelWithIndex( int32 BrowserIdx );
|
|
|
|
public:
|
|
/** The tab identifier/instance name for content browser tabs */
|
|
FName ContentBrowserTabIDs[MAX_CONTENT_BROWSERS];
|
|
|
|
private:
|
|
TArray<TWeakPtr<SContentBrowser>> AllContentBrowsers;
|
|
|
|
TMap<FName, TWeakPtr<FTabManager>> BrowserToLastKnownTabManagerMap;
|
|
|
|
TWeakPtr<SContentBrowser> PrimaryContentBrowser;
|
|
|
|
TSharedPtr<FNativeClassHierarchy> NativeClassHierarchy;
|
|
|
|
TSharedRef<FCollectionAssetRegistryBridge> CollectionAssetRegistryBridge;
|
|
|
|
/** An incrementing int32 which is used when making unique settings strings */
|
|
int32 SettingsStringID;
|
|
}; |