2016-12-08 08:52:44 -05:00
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "SCollectionView.h"
# include "Misc/ConfigCacheIni.h"
# include "Modules/ModuleManager.h"
# include "Widgets/SOverlay.h"
# include "Layout/WidgetPath.h"
# include "Framework/Application/MenuStack.h"
# include "Framework/Application/SlateApplication.h"
# include "Framework/Commands/UICommandList.h"
# include "Widgets/Layout/SSeparator.h"
# include "Widgets/Images/SImage.h"
# include "Framework/MultiBox/MultiBoxExtender.h"
# include "Framework/MultiBox/MultiBoxBuilder.h"
# include "Widgets/Input/SButton.h"
# include "EditorStyleSet.h"
# include "ISourceControlProvider.h"
# include "ISourceControlModule.h"
# include "CollectionManagerModule.h"
# include "ContentBrowserUtils.h"
# include "HistoryManager.h"
2014-03-14 14:13:41 -04:00
2015-05-29 13:15:40 -04:00
# include "CollectionAssetManagement.h"
2014-03-14 14:13:41 -04:00
# include "CollectionContextMenu.h"
2015-06-19 07:33:02 -04:00
# include "DragAndDrop/AssetDragDropOp.h"
# include "DragAndDrop/CollectionDragDropOp.h"
2014-03-14 14:13:41 -04:00
# include "SourcesViewWidgets.h"
# include "ContentBrowserModule.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "Widgets/Layout/SExpandableArea.h"
# include "Widgets/Input/SSearchBox.h"
2014-03-14 14:13:41 -04:00
# define LOCTEXT_NAMESPACE "ContentBrowser"
2015-06-10 13:19:26 -04:00
namespace CollectionViewFilter
{
void GetBasicStrings ( const FCollectionItem & InCollection , TArray < FString > & OutBasicStrings )
{
OutBasicStrings . Add ( InCollection . CollectionName . ToString ( ) ) ;
}
2015-06-24 12:29:41 -04:00
bool TestComplexExpression ( const FCollectionItem & InCollection , const FName & InKey , const FTextFilterString & InValue , ETextFilterComparisonOperation InComparisonOperation , ETextFilterTextComparisonMode InTextComparisonMode )
2015-06-10 13:19:26 -04:00
{
static const FName NameKeyName = " Name " ;
static const FName TypeKeyName = " Type " ;
// Handle the collection name
if ( InKey = = NameKeyName )
{
// Names can only work with Equal or NotEqual type tests
if ( InComparisonOperation ! = ETextFilterComparisonOperation : : Equal & & InComparisonOperation ! = ETextFilterComparisonOperation : : NotEqual )
{
return false ;
}
const bool bIsMatch = TextFilterUtils : : TestBasicStringExpression ( InCollection . CollectionName . ToString ( ) , InValue , InTextComparisonMode ) ;
return ( InComparisonOperation = = ETextFilterComparisonOperation : : Equal ) ? bIsMatch : ! bIsMatch ;
}
// Handle the collection type
if ( InKey = = TypeKeyName )
{
// Types can only work with Equal or NotEqual type tests
if ( InComparisonOperation ! = ETextFilterComparisonOperation : : Equal & & InComparisonOperation ! = ETextFilterComparisonOperation : : NotEqual )
{
return false ;
}
const bool bIsMatch = TextFilterUtils : : TestBasicStringExpression ( ECollectionShareType : : ToString ( InCollection . CollectionType ) , InValue , InTextComparisonMode ) ;
return ( InComparisonOperation = = ETextFilterComparisonOperation : : Equal ) ? bIsMatch : ! bIsMatch ;
}
return false ;
}
} // namespace CollectionViewFilter
2014-03-14 14:13:41 -04:00
void SCollectionView : : Construct ( const FArguments & InArgs )
{
OnCollectionSelected = InArgs . _OnCollectionSelected ;
bAllowCollectionButtons = InArgs . _AllowCollectionButtons ;
bAllowRightClickMenu = InArgs . _AllowRightClickMenu ;
2015-06-19 07:33:02 -04:00
bAllowCollectionDrag = InArgs . _AllowCollectionDrag ;
bDraggedOver = false ;
2015-07-06 09:37:48 -04:00
bQueueCollectionItemsUpdate = false ;
2015-07-03 13:54:34 -04:00
bQueueSCCRefresh = true ;
2014-03-14 14:13:41 -04:00
2015-06-01 10:04:42 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
2014-03-14 14:13:41 -04:00
CollectionManagerModule . Get ( ) . OnCollectionCreated ( ) . AddSP ( this , & SCollectionView : : HandleCollectionCreated ) ;
CollectionManagerModule . Get ( ) . OnCollectionRenamed ( ) . AddSP ( this , & SCollectionView : : HandleCollectionRenamed ) ;
2015-06-19 07:33:02 -04:00
CollectionManagerModule . Get ( ) . OnCollectionReparented ( ) . AddSP ( this , & SCollectionView : : HandleCollectionReparented ) ;
2014-03-14 14:13:41 -04:00
CollectionManagerModule . Get ( ) . OnCollectionDestroyed ( ) . AddSP ( this , & SCollectionView : : HandleCollectionDestroyed ) ;
2015-07-03 13:54:34 -04:00
CollectionManagerModule . Get ( ) . OnCollectionUpdated ( ) . AddSP ( this , & SCollectionView : : HandleCollectionUpdated ) ;
CollectionManagerModule . Get ( ) . OnAssetsAdded ( ) . AddSP ( this , & SCollectionView : : HandleAssetsAddedToCollection ) ;
CollectionManagerModule . Get ( ) . OnAssetsRemoved ( ) . AddSP ( this , & SCollectionView : : HandleAssetsRemovedFromCollection ) ;
ISourceControlModule : : Get ( ) . RegisterProviderChanged ( FSourceControlProviderChanged : : FDelegate : : CreateSP ( this , & SCollectionView : : HandleSourceControlProviderChanged ) ) ;
SourceControlStateChangedDelegateHandle = ISourceControlModule : : Get ( ) . GetProvider ( ) . RegisterSourceControlStateChanged_Handle ( FSourceControlStateChanged : : FDelegate : : CreateSP ( this , & SCollectionView : : HandleSourceControlStateChanged ) ) ;
2014-03-14 14:13:41 -04:00
Commands = TSharedPtr < FUICommandList > ( new FUICommandList ) ;
CollectionContextMenu = MakeShareable ( new FCollectionContextMenu ( SharedThis ( this ) ) ) ;
CollectionContextMenu - > BindCommands ( Commands ) ;
2015-06-10 13:19:26 -04:00
CollectionItemTextFilter = MakeShareable ( new FCollectionItemTextFilter (
FCollectionItemTextFilter : : FItemToStringArray : : CreateStatic ( & CollectionViewFilter : : GetBasicStrings ) ,
FCollectionItemTextFilter : : FItemTestComplexExpression : : CreateStatic ( & CollectionViewFilter : : TestComplexExpression )
) ) ;
CollectionItemTextFilter - > OnChanged ( ) . AddSP ( this , & SCollectionView : : UpdateFilteredCollectionItems ) ;
2015-05-29 13:15:40 -04:00
if ( InArgs . _AllowQuickAssetManagement )
{
QuickAssetManagement = MakeShareable ( new FCollectionAssetManagement ( ) ) ;
}
2014-03-14 14:13:41 -04:00
FOnContextMenuOpening CollectionListContextMenuOpening ;
if ( InArgs . _AllowContextMenu )
{
2015-06-19 07:33:02 -04:00
CollectionListContextMenuOpening = FOnContextMenuOpening : : CreateSP ( this , & SCollectionView : : MakeCollectionTreeContextMenu ) ;
2014-03-14 14:13:41 -04:00
}
PreventSelectionChangedDelegateCount = 0 ;
TSharedRef < SWidget > HeaderContent = SNew ( SHorizontalBox )
2015-05-21 14:47:20 -04:00
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1.0f )
2015-05-26 10:11:32 -04:00
. Padding ( 0.0f )
2014-03-14 14:13:41 -04:00
[
2015-05-26 10:11:32 -04:00
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
[
SNew ( STextBlock )
. Font ( FEditorStyle : : GetFontStyle ( " ContentBrowser.SourceTitleFont " ) )
. Text ( LOCTEXT ( " CollectionsListTitle " , " Collections " ) )
. Visibility ( this , & SCollectionView : : GetCollectionsTitleTextVisibility )
]
+ SHorizontalBox : : Slot ( )
[
SAssignNew ( SearchBoxPtr , SSearchBox )
. HintText ( LOCTEXT ( " CollectionsViewSearchBoxHint " , " Search Collections " ) )
2015-06-10 13:19:26 -04:00
. OnTextChanged ( this , & SCollectionView : : SetCollectionsSearchFilterText )
2015-05-26 10:11:32 -04:00
. Visibility ( this , & SCollectionView : : GetCollectionsSearchBoxVisibility )
]
2014-03-14 14:13:41 -04:00
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
2015-05-21 14:47:20 -04:00
. VAlign ( VAlign_Center )
. Padding ( 2.0f , 0.0f , 0.0f , 0.0f )
2014-03-14 14:13:41 -04:00
[
SNew ( SButton )
2015-05-21 14:47:20 -04:00
. ButtonStyle ( FEditorStyle : : Get ( ) , " FlatButton " )
2014-03-14 14:13:41 -04:00
. ToolTipText ( LOCTEXT ( " AddCollectionButtonTooltip " , " Add a collection. " ) )
. OnClicked ( this , & SCollectionView : : MakeAddCollectionMenu )
2015-05-21 14:47:20 -04:00
. ContentPadding ( FMargin ( 2 , 2 ) )
2014-03-14 14:13:41 -04:00
. Visibility ( this , & SCollectionView : : GetAddCollectionButtonVisibility )
[
SNew ( SImage ) . Image ( FEditorStyle : : GetBrush ( " ContentBrowser.AddCollectionButtonIcon " ) )
]
] ;
TSharedRef < SWidget > BodyContent = SNew ( SVerticalBox )
// Separator
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
[
SNew ( SSeparator )
]
2015-06-19 07:33:02 -04:00
// Collections tree
2014-03-14 14:13:41 -04:00
+ SVerticalBox : : Slot ( )
. FillHeight ( 1.f )
[
2015-06-19 07:33:02 -04:00
SAssignNew ( CollectionTreePtr , STreeView < TSharedPtr < FCollectionItem > > )
. TreeItemsSource ( & VisibleRootCollectionItems )
. OnGenerateRow ( this , & SCollectionView : : GenerateCollectionRow )
. OnGetChildren ( this , & SCollectionView : : GetCollectionItemChildren )
2014-03-14 14:13:41 -04:00
. ItemHeight ( 18 )
. SelectionMode ( ESelectionMode : : Multi )
. OnSelectionChanged ( this , & SCollectionView : : CollectionSelectionChanged )
2015-06-19 07:33:02 -04:00
. OnContextMenuOpening ( CollectionListContextMenuOpening )
2014-03-14 14:13:41 -04:00
. OnItemScrolledIntoView ( this , & SCollectionView : : CollectionItemScrolledIntoView )
. ClearSelectionOnClick ( false )
2015-06-19 07:33:02 -04:00
. Visibility ( this , & SCollectionView : : GetCollectionTreeVisibility )
2014-03-14 14:13:41 -04:00
] ;
TSharedPtr < SWidget > Content ;
if ( InArgs . _AllowCollapsing )
{
Content = SAssignNew ( CollectionsExpandableAreaPtr , SExpandableArea )
. MaxHeight ( 200 )
. BorderImage ( FEditorStyle : : GetBrush ( " NoBorder " ) )
2015-05-21 14:47:20 -04:00
. HeaderPadding ( FMargin ( 4.0f , 0.0f , 0.0f , 0.0f ) )
2014-03-14 14:13:41 -04:00
. HeaderContent ( )
[
2015-05-26 10:11:32 -04:00
SNew ( SBox )
. Padding ( FMargin ( 6.0f , 0.0f , 0.0f , 0.0f ) )
[
HeaderContent
]
2014-03-14 14:13:41 -04:00
]
. BodyContent ( )
[
BodyContent
] ;
}
else
{
Content = SNew ( SVerticalBox )
2015-05-21 14:47:20 -04:00
+ SVerticalBox : : Slot ( )
. AutoHeight ( )
[
HeaderContent
2014-03-14 14:13:41 -04:00
]
2015-05-21 14:47:20 -04:00
+ SVerticalBox : : Slot ( )
[
BodyContent
] ;
2014-03-14 14:13:41 -04:00
}
ChildSlot
[
2015-06-19 07:33:02 -04:00
SNew ( SOverlay )
// Main content
+ SOverlay : : Slot ( )
[
Content . ToSharedRef ( )
]
// Drop target overlay
+ SOverlay : : Slot ( )
[
SNew ( SBorder )
. Padding ( 0 )
. Visibility ( EVisibility : : HitTestInvisible )
. BorderImage ( this , & SCollectionView : : GetCollectionViewDropTargetBorder )
. BorderBackgroundColor ( FLinearColor : : Yellow )
[
SNullWidget : : NullWidget
]
]
2014-03-14 14:13:41 -04:00
] ;
UpdateCollectionItems ( ) ;
}
void SCollectionView : : HandleCollectionCreated ( const FCollectionNameType & Collection )
{
2015-07-06 09:37:48 -04:00
bQueueCollectionItemsUpdate = true ;
2014-03-14 14:13:41 -04:00
}
void SCollectionView : : HandleCollectionRenamed ( const FCollectionNameType & OriginalCollection , const FCollectionNameType & NewCollection )
2015-06-19 07:33:02 -04:00
{
2015-07-06 09:37:48 -04:00
bQueueCollectionItemsUpdate = true ;
2015-06-19 07:33:02 -04:00
2015-07-06 09:37:48 -04:00
// Rename the item in-place so we can maintain its expansion and selection states correctly once the view is refreshed on the next Tick
TSharedPtr < FCollectionItem > CollectionItem = AvailableCollections . FindRef ( OriginalCollection ) ;
if ( CollectionItem . IsValid ( ) )
2015-06-19 07:33:02 -04:00
{
2015-07-06 09:37:48 -04:00
CollectionItem - > CollectionName = NewCollection . Name ;
CollectionItem - > CollectionType = NewCollection . Type ;
2015-07-24 11:43:16 -04:00
AvailableCollections . Remove ( OriginalCollection ) ;
AvailableCollections . Add ( NewCollection , CollectionItem ) ;
2015-06-19 07:33:02 -04:00
}
}
void SCollectionView : : HandleCollectionReparented ( const FCollectionNameType & Collection , const TOptional < FCollectionNameType > & OldParent , const TOptional < FCollectionNameType > & NewParent )
2014-03-14 14:13:41 -04:00
{
2015-07-06 09:37:48 -04:00
bQueueCollectionItemsUpdate = true ;
2014-03-14 14:13:41 -04:00
}
void SCollectionView : : HandleCollectionDestroyed ( const FCollectionNameType & Collection )
{
2015-07-06 09:37:48 -04:00
bQueueCollectionItemsUpdate = true ;
2014-03-14 14:13:41 -04:00
}
2015-07-03 13:54:34 -04:00
void SCollectionView : : HandleCollectionUpdated ( const FCollectionNameType & Collection )
{
TSharedPtr < FCollectionItem > CollectionItemToUpdate = AvailableCollections . FindRef ( Collection ) ;
if ( CollectionItemToUpdate . IsValid ( ) )
{
bQueueSCCRefresh = true ;
UpdateCollectionItemStatus ( CollectionItemToUpdate . ToSharedRef ( ) ) ;
}
}
void SCollectionView : : HandleAssetsAddedToCollection ( const FCollectionNameType & Collection , const TArray < FName > & AssetsAdded )
{
HandleCollectionUpdated ( Collection ) ;
}
void SCollectionView : : HandleAssetsRemovedFromCollection ( const FCollectionNameType & Collection , const TArray < FName > & AssetsRemoved )
{
HandleCollectionUpdated ( Collection ) ;
}
void SCollectionView : : HandleSourceControlProviderChanged ( ISourceControlProvider & OldProvider , ISourceControlProvider & NewProvider )
{
OldProvider . UnregisterSourceControlStateChanged_Handle ( SourceControlStateChangedDelegateHandle ) ;
SourceControlStateChangedDelegateHandle = NewProvider . RegisterSourceControlStateChanged_Handle ( FSourceControlStateChanged : : FDelegate : : CreateSP ( this , & SCollectionView : : HandleSourceControlStateChanged ) ) ;
bQueueSCCRefresh = true ;
HandleSourceControlStateChanged ( ) ;
}
void SCollectionView : : HandleSourceControlStateChanged ( )
{
// Update the status of each collection
for ( const auto & AvailableCollectionInfo : AvailableCollections )
{
UpdateCollectionItemStatus ( AvailableCollectionInfo . Value . ToSharedRef ( ) ) ;
}
}
void SCollectionView : : UpdateCollectionItemStatus ( const TSharedRef < FCollectionItem > & CollectionItem )
{
TOptional < ECollectionItemStatus > NewStatus ;
2015-07-10 09:03:02 -04:00
// Check IsModuleAvailable as we might be in the process of shutting down, and were notified due to the SCC provider being nulled out...
if ( FCollectionManagerModule : : IsModuleAvailable ( ) )
2015-07-03 13:54:34 -04:00
{
2015-07-10 09:03:02 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
FCollectionStatusInfo StatusInfo ;
if ( CollectionManagerModule . Get ( ) . GetCollectionStatusInfo ( CollectionItem - > CollectionName , CollectionItem - > CollectionType , StatusInfo ) )
2015-07-03 13:54:34 -04:00
{
2015-07-10 09:03:02 -04:00
// Test the SCC state first as this should take priority when reporting the status back to the user
if ( StatusInfo . bUseSCC )
2015-07-03 13:54:34 -04:00
{
2015-07-10 09:03:02 -04:00
if ( StatusInfo . SCCState . IsValid ( ) & & StatusInfo . SCCState - > IsSourceControlled ( ) )
2015-07-03 13:54:34 -04:00
{
2015-07-10 09:03:02 -04:00
if ( StatusInfo . SCCState - > IsCheckedOutOther ( ) )
{
NewStatus = ECollectionItemStatus : : IsCheckedOutByAnotherUser ;
}
else if ( StatusInfo . SCCState - > IsConflicted ( ) )
{
NewStatus = ECollectionItemStatus : : IsConflicted ;
}
else if ( ! StatusInfo . SCCState - > IsCurrent ( ) )
{
NewStatus = ECollectionItemStatus : : IsOutOfDate ;
}
else if ( StatusInfo . SCCState - > IsModified ( ) )
{
NewStatus = ECollectionItemStatus : : HasLocalChanges ;
}
2015-07-03 13:54:34 -04:00
}
2015-07-10 09:03:02 -04:00
else
2015-07-03 13:54:34 -04:00
{
2015-07-10 09:03:02 -04:00
NewStatus = ECollectionItemStatus : : IsMissingSCCProvider ;
2015-07-03 13:54:34 -04:00
}
2015-07-10 09:03:02 -04:00
}
// Not set by the SCC status, so check just use the local state
if ( ! NewStatus . IsSet ( ) )
{
if ( StatusInfo . bIsDirty )
2015-07-03 13:54:34 -04:00
{
NewStatus = ECollectionItemStatus : : HasLocalChanges ;
}
2015-07-10 09:03:02 -04:00
else if ( StatusInfo . bIsEmpty )
{
NewStatus = ECollectionItemStatus : : IsUpToDateAndEmpty ;
}
else
{
NewStatus = ECollectionItemStatus : : IsUpToDateAndPopulated ;
}
2015-07-03 13:54:34 -04:00
}
}
}
CollectionItem - > CurrentStatus = NewStatus . Get ( ECollectionItemStatus : : IsUpToDateAndEmpty ) ;
}
2014-03-14 14:13:41 -04:00
void SCollectionView : : UpdateCollectionItems ( )
{
2015-06-19 07:33:02 -04:00
struct FGatherCollectionItems
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
FGatherCollectionItems ( )
: CollectionManagerModule ( FCollectionManagerModule : : GetModule ( ) )
2014-03-14 14:13:41 -04:00
{
}
2015-06-19 07:33:02 -04:00
void GatherCollectionItems ( FAvailableCollectionsMap & OutAvailableCollections )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
OutAvailableCollections . Reset ( ) ;
TArray < FCollectionNameType > RootCollections ;
CollectionManagerModule . Get ( ) . GetRootCollections ( RootCollections ) ;
ProcessGatheredCollectionsAndRecurse ( RootCollections , nullptr , OutAvailableCollections ) ;
}
void GatherChildCollectionItems ( const TSharedPtr < FCollectionItem > & InParentCollectionItem , FAvailableCollectionsMap & OutAvailableCollections )
{
TArray < FCollectionNameType > ChildCollections ;
CollectionManagerModule . Get ( ) . GetChildCollections ( InParentCollectionItem - > CollectionName , InParentCollectionItem - > CollectionType , ChildCollections ) ;
ProcessGatheredCollectionsAndRecurse ( ChildCollections , InParentCollectionItem , OutAvailableCollections ) ;
}
void ProcessGatheredCollectionsAndRecurse ( const TArray < FCollectionNameType > & InCollections , const TSharedPtr < FCollectionItem > & InParentCollectionItem , FAvailableCollectionsMap & OutAvailableCollections )
{
for ( const FCollectionNameType & Collection : InCollections )
{
// Never display system collections
if ( Collection . Type = = ECollectionShareType : : CST_System )
{
continue ;
}
2015-07-03 13:54:34 -04:00
TSharedRef < FCollectionItem > CollectionItem = MakeShareable ( new FCollectionItem ( Collection . Name , Collection . Type ) ) ;
2015-06-19 07:33:02 -04:00
OutAvailableCollections . Add ( Collection , CollectionItem ) ;
2015-07-09 09:59:51 -04:00
CollectionManagerModule . Get ( ) . GetCollectionStorageMode ( Collection . Name , Collection . Type , CollectionItem - > StorageMode ) ;
2015-07-03 13:54:34 -04:00
SCollectionView : : UpdateCollectionItemStatus ( CollectionItem ) ;
2015-06-19 07:33:02 -04:00
if ( InParentCollectionItem . IsValid ( ) )
{
// Fixup the parent and child pointers
InParentCollectionItem - > ChildCollections . Add ( CollectionItem ) ;
CollectionItem - > ParentCollection = InParentCollectionItem ;
}
// Recurse
GatherChildCollectionItems ( CollectionItem , OutAvailableCollections ) ;
}
}
FCollectionManagerModule & CollectionManagerModule ;
} ;
// Backup the current selection and expansion state of our collections
// We're about to re-create the tree, so we'll need to re-apply this again afterwards
TArray < FCollectionNameType > SelectedCollections ;
TArray < FCollectionNameType > ExpandedCollections ;
{
const auto SelectedCollectionItems = CollectionTreePtr - > GetSelectedItems ( ) ;
SelectedCollections . Reserve ( SelectedCollectionItems . Num ( ) ) ;
for ( const TSharedPtr < FCollectionItem > & SelectedCollectionItem : SelectedCollectionItems )
{
SelectedCollections . Add ( FCollectionNameType ( SelectedCollectionItem - > CollectionName , SelectedCollectionItem - > CollectionType ) ) ;
}
}
{
TSet < TSharedPtr < FCollectionItem > > ExpandedCollectionItems ;
CollectionTreePtr - > GetExpandedItems ( ExpandedCollectionItems ) ;
ExpandedCollections . Reserve ( ExpandedCollectionItems . Num ( ) ) ;
for ( const TSharedPtr < FCollectionItem > & ExpandedCollectionItem : ExpandedCollectionItems )
{
ExpandedCollections . Add ( FCollectionNameType ( ExpandedCollectionItem - > CollectionName , ExpandedCollectionItem - > CollectionType ) ) ;
2014-03-14 14:13:41 -04:00
}
}
2015-06-19 07:33:02 -04:00
FGatherCollectionItems GatherCollectionItems ;
GatherCollectionItems . GatherCollectionItems ( AvailableCollections ) ;
2015-05-21 14:47:20 -04:00
2015-06-10 13:19:26 -04:00
UpdateFilteredCollectionItems ( ) ;
2015-06-19 07:33:02 -04:00
// Restore selection and expansion
SetSelectedCollections ( SelectedCollections , false ) ;
SetExpandedCollections ( ExpandedCollections ) ;
2015-07-03 13:54:34 -04:00
bQueueSCCRefresh = true ;
2015-05-21 14:47:20 -04:00
}
2015-06-10 13:19:26 -04:00
void SCollectionView : : UpdateFilteredCollectionItems ( )
2015-05-21 14:47:20 -04:00
{
2015-06-19 07:33:02 -04:00
VisibleCollections . Reset ( ) ;
VisibleRootCollectionItems . Reset ( ) ;
auto AddVisibleCollection = [ & ] ( const TSharedPtr < FCollectionItem > & InCollectionItem )
2015-05-21 14:47:20 -04:00
{
2015-06-19 07:33:02 -04:00
VisibleCollections . Add ( FCollectionNameType ( InCollectionItem - > CollectionName , InCollectionItem - > CollectionType ) ) ;
if ( ! InCollectionItem - > ParentCollection . IsValid ( ) )
2015-05-21 14:47:20 -04:00
{
2015-06-19 07:33:02 -04:00
VisibleRootCollectionItems . AddUnique ( InCollectionItem ) ;
}
} ;
auto AddVisibleCollectionRecursive = [ & ] ( const TSharedPtr < FCollectionItem > & InCollectionItem )
{
TSharedPtr < FCollectionItem > CollectionItemToAdd = InCollectionItem ;
do
{
AddVisibleCollection ( CollectionItemToAdd ) ;
CollectionItemToAdd = CollectionItemToAdd - > ParentCollection . Pin ( ) ;
}
while ( CollectionItemToAdd . IsValid ( ) ) ;
} ;
// Do we have an active filter to test against?
if ( CollectionItemTextFilter - > GetRawFilterText ( ) . IsEmpty ( ) )
{
// No filter, just mark everything as visible
for ( const auto & AvailableCollectionInfo : AvailableCollections )
{
AddVisibleCollection ( AvailableCollectionInfo . Value ) ;
}
}
else
{
TArray < TSharedRef < FCollectionItem > > CollectionsToExpandTo ;
// Test everything against the filter - a visible child needs to make sure its parents are also marked as visible
for ( const auto & AvailableCollectionInfo : AvailableCollections )
{
const TSharedPtr < FCollectionItem > & CollectionItem = AvailableCollectionInfo . Value ;
if ( CollectionItemTextFilter - > PassesFilter ( * CollectionItem ) )
{
AddVisibleCollectionRecursive ( CollectionItem ) ;
CollectionsToExpandTo . Add ( CollectionItem . ToSharedRef ( ) ) ;
}
}
// Make sure all matching items have their parents expanded so they can be seen
for ( const TSharedRef < FCollectionItem > & CollectionItem : CollectionsToExpandTo )
{
ExpandParentItems ( CollectionItem ) ;
2015-05-21 14:47:20 -04:00
}
}
2015-06-19 07:33:02 -04:00
VisibleRootCollectionItems . Sort ( FCollectionItem : : FCompareFCollectionItemByName ( ) ) ;
CollectionTreePtr - > RequestTreeRefresh ( ) ;
2015-05-21 14:47:20 -04:00
}
2015-06-10 13:19:26 -04:00
void SCollectionView : : SetCollectionsSearchFilterText ( const FText & InSearchText )
2015-05-21 14:47:20 -04:00
{
2015-06-10 13:19:26 -04:00
CollectionItemTextFilter - > SetRawFilterText ( InSearchText ) ;
SearchBoxPtr - > SetError ( CollectionItemTextFilter - > GetFilterErrorText ( ) ) ;
}
FText SCollectionView : : GetCollectionsSearchFilterText ( ) const
{
return CollectionItemTextFilter - > GetRawFilterText ( ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
void SCollectionView : : SetSelectedCollections ( const TArray < FCollectionNameType > & CollectionsToSelect , const bool bEnsureVisible )
2014-03-14 14:13:41 -04:00
{
// Prevent the selection changed delegate since the invoking code requested it
FScopedPreventSelectionChangedDelegate DelegatePrevention ( SharedThis ( this ) ) ;
// Expand the collections area if we are indeed selecting at least one collection
2015-06-19 07:33:02 -04:00
if ( bEnsureVisible & & CollectionsToSelect . Num ( ) > 0 & & CollectionsExpandableAreaPtr . IsValid ( ) )
2014-03-14 14:13:41 -04:00
{
CollectionsExpandableAreaPtr - > SetExpanded ( true ) ;
}
2015-06-19 07:33:02 -04:00
// Clear the selection to start, then add the selected items as they are found
CollectionTreePtr - > ClearSelection ( ) ;
2014-03-14 14:13:41 -04:00
2015-06-19 07:33:02 -04:00
for ( const FCollectionNameType & CollectionToSelect : CollectionsToSelect )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
TSharedPtr < FCollectionItem > CollectionItemToSelect = AvailableCollections . FindRef ( CollectionToSelect ) ;
if ( CollectionItemToSelect . IsValid ( ) )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
if ( bEnsureVisible )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
ExpandParentItems ( CollectionItemToSelect . ToSharedRef ( ) ) ;
CollectionTreePtr - > RequestScrollIntoView ( CollectionItemToSelect ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > SetItemSelection ( CollectionItemToSelect , true ) ;
// If the selected collection doesn't pass our current filter, we need to clear it
2015-07-09 09:59:51 -04:00
if ( bEnsureVisible & & ! CollectionItemTextFilter - > PassesFilter ( * CollectionItemToSelect ) )
2015-06-19 07:33:02 -04:00
{
SearchBoxPtr - > SetText ( FText : : GetEmpty ( ) ) ;
}
}
}
}
void SCollectionView : : SetExpandedCollections ( const TArray < FCollectionNameType > & CollectionsToExpand )
{
// Clear the expansion to start, then add the expanded items as they are found
CollectionTreePtr - > ClearExpandedItems ( ) ;
for ( const FCollectionNameType & CollectionToExpand : CollectionsToExpand )
{
TSharedPtr < FCollectionItem > CollectionItemToExpand = AvailableCollections . FindRef ( CollectionToExpand ) ;
if ( CollectionItemToExpand . IsValid ( ) )
{
CollectionTreePtr - > SetItemExpansion ( CollectionItemToExpand , true ) ;
2014-03-14 14:13:41 -04:00
}
}
}
void SCollectionView : : ClearSelection ( )
{
// Prevent the selection changed delegate since the invoking code requested it
FScopedPreventSelectionChangedDelegate DelegatePrevention ( SharedThis ( this ) ) ;
// Clear the selection to start, then add the selected paths as they are found
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > ClearSelection ( ) ;
2014-03-14 14:13:41 -04:00
}
TArray < FCollectionNameType > SCollectionView : : GetSelectedCollections ( ) const
{
TArray < FCollectionNameType > RetArray ;
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > Items = CollectionTreePtr - > GetSelectedItems ( ) ;
2014-03-14 14:13:41 -04:00
for ( int32 ItemIdx = 0 ; ItemIdx < Items . Num ( ) ; + + ItemIdx )
{
const TSharedPtr < FCollectionItem > & Item = Items [ ItemIdx ] ;
2015-06-01 09:29:31 -04:00
RetArray . Add ( FCollectionNameType ( Item - > CollectionName , Item - > CollectionType ) ) ;
2014-03-14 14:13:41 -04:00
}
return RetArray ;
}
2015-05-29 13:15:40 -04:00
void SCollectionView : : SetSelectedAssets ( const TArray < FAssetData > & SelectedAssets )
{
if ( QuickAssetManagement . IsValid ( ) )
{
QuickAssetManagement - > SetCurrentAssets ( SelectedAssets ) ;
}
}
2015-06-10 13:19:26 -04:00
void SCollectionView : : ApplyHistoryData ( const FHistoryData & History )
2014-03-14 14:13:41 -04:00
{
// Prevent the selection changed delegate because it would add more history when we are just setting a state
FScopedPreventSelectionChangedDelegate DelegatePrevention ( SharedThis ( this ) ) ;
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > ClearSelection ( ) ;
2015-07-09 09:59:51 -04:00
for ( const FCollectionNameType & HistoryCollection : History . SourcesData . Collections )
2014-03-14 14:13:41 -04:00
{
2015-07-09 09:59:51 -04:00
TSharedPtr < FCollectionItem > CollectionHistoryItem = AvailableCollections . FindRef ( HistoryCollection ) ;
2015-06-19 07:33:02 -04:00
if ( CollectionHistoryItem . IsValid ( ) )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
ExpandParentItems ( CollectionHistoryItem . ToSharedRef ( ) ) ;
CollectionTreePtr - > RequestScrollIntoView ( CollectionHistoryItem ) ;
CollectionTreePtr - > SetItemSelection ( CollectionHistoryItem , true ) ;
2014-03-14 14:13:41 -04:00
}
}
}
void SCollectionView : : SaveSettings ( const FString & IniFilename , const FString & IniSection , const FString & SettingsString ) const
{
2015-06-19 07:33:02 -04:00
auto SaveCollectionsArrayToIni = [ & ] ( const FString & InSubKey , const TArray < TSharedPtr < FCollectionItem > > & InCollectionItems )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
FString CollectionsString ;
for ( const TSharedPtr < FCollectionItem > & CollectionItem : InCollectionItems )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
if ( CollectionsString . Len ( ) > 0 )
{
CollectionsString + = TEXT ( " , " ) ;
}
CollectionsString + = CollectionItem - > CollectionName . ToString ( ) ;
CollectionsString + = TEXT ( " ? " ) ;
CollectionsString + = FString : : FromInt ( CollectionItem - > CollectionType ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
GConfig - > SetString ( * IniSection , * ( SettingsString + InSubKey ) , * CollectionsString , IniFilename ) ;
} ;
2014-03-14 14:13:41 -04:00
const bool IsCollectionsExpanded = CollectionsExpandableAreaPtr . IsValid ( ) ? CollectionsExpandableAreaPtr - > IsExpanded ( ) : true ;
GConfig - > SetBool ( * IniSection , * ( SettingsString + TEXT ( " .CollectionsExpanded " ) ) , IsCollectionsExpanded , IniFilename ) ;
2015-06-19 07:33:02 -04:00
SaveCollectionsArrayToIni ( TEXT ( " .SelectedCollections " ) , CollectionTreePtr - > GetSelectedItems ( ) ) ;
{
TSet < TSharedPtr < FCollectionItem > > ExpandedCollectionItems ;
CollectionTreePtr - > GetExpandedItems ( ExpandedCollectionItems ) ;
SaveCollectionsArrayToIni ( TEXT ( " .ExpandedCollections " ) , ExpandedCollectionItems . Array ( ) ) ;
}
2014-03-14 14:13:41 -04:00
}
void SCollectionView : : LoadSettings ( const FString & IniFilename , const FString & IniSection , const FString & SettingsString )
{
2015-06-19 07:33:02 -04:00
auto LoadCollectionsArrayFromIni = [ & ] ( const FString & InSubKey ) - > TArray < FCollectionNameType >
{
TArray < FCollectionNameType > RetCollectionsArray ;
FString CollectionsArrayString ;
if ( GConfig - > GetString ( * IniSection , * ( SettingsString + InSubKey ) , CollectionsArrayString , IniFilename ) )
{
TArray < FString > CollectionStrings ;
CollectionsArrayString . ParseIntoArray ( CollectionStrings , TEXT ( " , " ) , /*bCullEmpty*/ true ) ;
for ( const FString & CollectionString : CollectionStrings )
{
FString CollectionName ;
FString CollectionTypeString ;
if ( CollectionString . Split ( TEXT ( " ? " ) , & CollectionName , & CollectionTypeString ) )
{
const int32 CollectionType = FCString : : Atoi ( * CollectionTypeString ) ;
if ( CollectionType > = 0 & & CollectionType < ECollectionShareType : : CST_All )
{
RetCollectionsArray . Add ( FCollectionNameType ( FName ( * CollectionName ) , ECollectionShareType : : Type ( CollectionType ) ) ) ;
}
}
}
}
return RetCollectionsArray ;
} ;
2014-03-14 14:13:41 -04:00
// Collection expansion state
bool bCollectionsExpanded = false ;
2015-06-19 07:33:02 -04:00
if ( CollectionsExpandableAreaPtr . IsValid ( ) & & GConfig - > GetBool ( * IniSection , * ( SettingsString + TEXT ( " .CollectionsExpanded " ) ) , bCollectionsExpanded , IniFilename ) )
2014-03-14 14:13:41 -04:00
{
CollectionsExpandableAreaPtr - > SetExpanded ( bCollectionsExpanded ) ;
}
// Selected Collections
2015-06-19 07:33:02 -04:00
TArray < FCollectionNameType > NewSelectedCollections = LoadCollectionsArrayFromIni ( TEXT ( " .SelectedCollections " ) ) ;
if ( NewSelectedCollections . Num ( ) > 0 )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
SetSelectedCollections ( NewSelectedCollections ) ;
2014-03-14 14:13:41 -04:00
2015-06-19 07:33:02 -04:00
const TArray < TSharedPtr < FCollectionItem > > SelectedCollectionItems = CollectionTreePtr - > GetSelectedItems ( ) ;
if ( SelectedCollectionItems . Num ( ) > 0 )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
CollectionSelectionChanged ( SelectedCollectionItems [ 0 ] , ESelectInfo : : Direct ) ;
2014-03-14 14:13:41 -04:00
}
}
2015-06-19 07:33:02 -04:00
// Expanded Collections
TArray < FCollectionNameType > NewExpandedCollections = LoadCollectionsArrayFromIni ( TEXT ( " .ExpandedCollections " ) ) ;
if ( NewExpandedCollections . Num ( ) > 0 )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
SetExpandedCollections ( NewExpandedCollections ) ;
2014-03-14 14:13:41 -04:00
}
}
2015-07-03 13:54:34 -04:00
void SCollectionView : : Tick ( const FGeometry & AllottedGeometry , const double InCurrentTime , const float InDeltaTime )
{
SCompoundWidget : : Tick ( AllottedGeometry , InCurrentTime , InDeltaTime ) ;
2015-07-06 09:37:48 -04:00
if ( bQueueCollectionItemsUpdate )
{
bQueueCollectionItemsUpdate = false ;
UpdateCollectionItems ( ) ;
}
2015-07-10 09:03:02 -04:00
if ( bQueueSCCRefresh & & FCollectionManagerModule : : IsModuleAvailable ( ) & & ISourceControlModule : : Get ( ) . IsEnabled ( ) )
2015-07-03 13:54:34 -04:00
{
bQueueSCCRefresh = false ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
TArray < FString > CollectionFilesToRefresh ;
for ( const auto & AvailableCollectionInfo : AvailableCollections )
{
FCollectionStatusInfo StatusInfo ;
if ( CollectionManagerModule . Get ( ) . GetCollectionStatusInfo ( AvailableCollectionInfo . Value - > CollectionName , AvailableCollectionInfo . Value - > CollectionType , StatusInfo ) )
{
if ( StatusInfo . bUseSCC & & StatusInfo . SCCState . IsValid ( ) & & StatusInfo . SCCState - > IsSourceControlled ( ) )
{
CollectionFilesToRefresh . Add ( StatusInfo . SCCState - > GetFilename ( ) ) ;
}
}
}
if ( CollectionFilesToRefresh . Num ( ) > 0 )
{
ISourceControlModule : : Get ( ) . QueueStatusUpdate ( CollectionFilesToRefresh ) ;
}
}
}
2014-10-30 12:29:36 -04:00
FReply SCollectionView : : OnKeyDown ( const FGeometry & MyGeometry , const FKeyEvent & InKeyEvent )
2014-03-14 14:13:41 -04:00
{
2014-10-30 12:29:36 -04:00
if ( Commands - > ProcessCommandBindings ( InKeyEvent ) )
2014-03-14 14:13:41 -04:00
{
return FReply : : Handled ( ) ;
}
return FReply : : Unhandled ( ) ;
}
2015-06-19 07:33:02 -04:00
void SCollectionView : : OnDragEnter ( const FGeometry & MyGeometry , const FDragDropEvent & DragDropEvent )
{
ValidateDragDropOnCollectionTree ( MyGeometry , DragDropEvent , bDraggedOver ) ; // updates bDraggedOver
}
void SCollectionView : : OnDragLeave ( const FDragDropEvent & DragDropEvent )
{
bDraggedOver = false ;
}
FReply SCollectionView : : OnDragOver ( const FGeometry & MyGeometry , const FDragDropEvent & DragDropEvent )
{
ValidateDragDropOnCollectionTree ( MyGeometry , DragDropEvent , bDraggedOver ) ; // updates bDraggedOver
return ( bDraggedOver ) ? FReply : : Handled ( ) : FReply : : Unhandled ( ) ;
}
FReply SCollectionView : : OnDrop ( const FGeometry & MyGeometry , const FDragDropEvent & DragDropEvent )
{
if ( ValidateDragDropOnCollectionTree ( MyGeometry , DragDropEvent , bDraggedOver ) ) // updates bDraggedOver
{
bDraggedOver = false ;
return HandleDragDropOnCollectionTree ( MyGeometry , DragDropEvent ) ;
}
if ( bDraggedOver )
{
// We were able to handle this operation, but could not due to another error - still report this drop as handled so it doesn't fall through to other widgets
bDraggedOver = false ;
return FReply : : Handled ( ) ;
}
return FReply : : Unhandled ( ) ;
}
2015-07-09 09:59:51 -04:00
void SCollectionView : : MakeSaveDynamicCollectionMenu ( FText InQueryString )
{
// Get all menu extenders for this context menu from the content browser module
FContentBrowserModule & ContentBrowserModule = FModuleManager : : GetModuleChecked < FContentBrowserModule > ( TEXT ( " ContentBrowser " ) ) ;
TArray < FContentBrowserMenuExtender > MenuExtenderDelegates = ContentBrowserModule . GetAllCollectionViewContextMenuExtenders ( ) ;
TArray < TSharedPtr < FExtender > > Extenders ;
for ( int32 i = 0 ; i < MenuExtenderDelegates . Num ( ) ; + + i )
{
if ( MenuExtenderDelegates [ i ] . IsBound ( ) )
{
Extenders . Add ( MenuExtenderDelegates [ i ] . Execute ( ) ) ;
}
}
TSharedPtr < FExtender > MenuExtender = FExtender : : Combine ( Extenders ) ;
FMenuBuilder MenuBuilder ( /*bInShouldCloseWindowAfterMenuSelection=*/ true , NULL , MenuExtender , true ) ;
CollectionContextMenu - > UpdateProjectSourceControl ( ) ;
CollectionContextMenu - > MakeSaveDynamicCollectionSubMenu ( MenuBuilder , InQueryString ) ;
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3167359)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3152124 on 2016/10/05 by Jamie.Dale
Fixed SOutputLog filter not handling OnTextCommitted
Change 3152255 on 2016/10/05 by Michael.Dupuis
#jira UE-28173 Support \" properly in FName
Change 3152273 on 2016/10/05 by Nick.Darnell
Core - The module manager is now thread safer, we had a critical section around the internal module list - but we were incrementing/decrementing shared pointers to module data shared pointers that were not thread safe outside of the critical section. Ran into a crash working on some heavily threaded code in automation.
Change 3152314 on 2016/10/05 by Nick.Darnell
Automation - Continued work to rough out the automation workflow for screenshot. Still lots of work remaining, but it appears the basic of approving images might be working as of this CL.
Change 3152316 on 2016/10/05 by Michael.Dupuis
#jira UE-30346 Update selection when in tree view mode
Change 3152317 on 2016/10/05 by Nick.Darnell
Automation - Adding some test shots to compare against to EngineTest for screenshot approval.
Change 3152319 on 2016/10/05 by Michael.Dupuis
#jira UE-29817 StringAssetReference will now only open an Asset picker (not actor picker) as the goal is to reference an asset
Change 3152521 on 2016/10/05 by Nick.Darnell
Automation - Fixing some issues with where it reads the screenshot compare rules.
Change 3152536 on 2016/10/05 by Alexis.Matte
Fix FBX automation test.
- Make sure the fbx test can avoid automatic detection of the mesh type
- Avoid to log the warning when the importer set the material usage after creating a material for skeletalmesh.
Change 3152572 on 2016/10/05 by Nick.Darnell
Automation - The GameProjectAutomationTests now do some pre-run house cleaning to make sure the project doesn't already exist, and tries to remove it if it was created previously but not deleted.
Change 3152591 on 2016/10/05 by Nick.Darnell
Automation - Changing the game project errors to be errors.
Change 3153115 on 2016/10/06 by Jamie.Dale
Removed superflous padding when SPropertyEditorAsset had no buttons
Change 3153215 on 2016/10/06 by Michael.Dupuis
Fixed build warning
Change 3153248 on 2016/10/06 by Nick.Darnell
Automation - Working on solving projects not being generated, suspect UBT isn't built or isn't available.
Change 3153255 on 2016/10/06 by Nick.Darnell
PR #2835: Fix TestEqual AddError Message in FAutomationTestBase (Contributed by dorgonman)
#jira UE-36922
Change 3153300 on 2016/10/06 by Nick.Darnell
Automation - Enabled verbose logging to automation build farm.
Change 3153343 on 2016/10/06 by Matt.Kuhlenschmidt
PR #2825: More project launcher progress improvements (Contributed by projectgheist)
Change 3153506 on 2016/10/06 by Gareth.Martin
Fixed crash trying to edit landscape with r.LightPropagationVolume=1 enabled
#jira UE-36933
Change 3153752 on 2016/10/06 by tim.gautier
Add toggle button to UMG_Behavior. Set Level Blueprint for TM-UMG to AllWidget
Change 3153763 on 2016/10/06 by Nick.Darnell
Automation - Disable verbose logging.
Change 3153778 on 2016/10/06 by Nick.Darnell
PR #2837: Fixed engine compilation with defined LOG_SLATE_EVENTS (Contributed by Pierdek)
#jira UE-36940
Change 3153943 on 2016/10/06 by Nick.Darnell
Automation - Disabling some broken tests.
Change 3154035 on 2016/10/06 by Nick.Darnell
Automation - Fixing re-runs for tests that want them. Previously this wasn't working for any test that was run using the Reprostring method of being executed.
Change 3154039 on 2016/10/06 by Nick.Darnell
Automation - Updating some test assets in the EngineTest project.
Change 3154476 on 2016/10/07 by Richard.TalbotWatkin
Fix to regression where vertex color view in Mesh Paint Mode no longer worked correctly. We now allow selected static meshes to go down the dynamic path if VertexColors show mode is active.
#jira UE-36772 - Selecting a channel in Vertex Paint mode does not show the channel color
Change 3154650 on 2016/10/07 by Alexis.Matte
Add new front axis facing X option to fbx importer
Change 3154785 on 2016/10/07 by Nick.Darnell
Automation - Continued work on automation, ripping out the message bus from the screenshot manager, that's causing the screenshot manager to recieve shots from every machine ever running tests. The Automation Controller is now in charge, and will tell the screenshot manager whatever it needs.
Change 3155131 on 2016/10/07 by Michael.Dupuis
#jira UE-36509 Do not disabled inverse filter when doing a sync to asset
Change 3155141 on 2016/10/07 by Michael.Dupuis
#jira UE-36056 Do not open the Actor Picker if we're working on an archetype object
Change 3155262 on 2016/10/07 by Michael.Dupuis
#jira UE-19737 reset ctrl key when resetting state to None
Change 3156326 on 2016/10/09 by Matt.Kuhlenschmidt
Fixed crash when asset picker is used without a property editor (usually a heavily customized property).
Change 3156473 on 2016/10/10 by Richard.TalbotWatkin
Attempt to make geometry render / rebuild more robust in the hope of catching UE-36265.
#jira UE-36265 - [CrashReport] UE4Editor_Engine!FModelSceneProxy::HasSelectedSurfaces() [modelrender.cpp:538]
Change 3156479 on 2016/10/10 by Richard.TalbotWatkin
Fixed non-editor build.
Change 3156579 on 2016/10/10 by Alexis.Matte
Add a check to make sure curve pointer is valid.
#jira UE-36177
Change 3156585 on 2016/10/10 by Ben.Marsh
Fix line endings for screenshot settings.
Change 3156617 on 2016/10/10 by Matt.Kuhlenschmidt
Disable per-pixel blending of menus by default. Causes artifacts on windows versions and we are not using it.
Change 3156674 on 2016/10/10 by Nick.Darnell
Automation - Continued work on the automation workflow. Now screenshot functional test actors actually have the screenshot processed for differences during the test back on the test controller machine, and then waits for the results of the comparison to be performed.
Change 3156709 on 2016/10/10 by Alexis.Matte
#jira UE-16337
Make sure the base mesh import data transform is used when we import a LOD.
Change 3156714 on 2016/10/10 by Nick.Darnell
Automation - Fixing -game crash due to TestName being null in functional test.
Change 3156721 on 2016/10/10 by Nick.Darnell
Automation - FunctionalAITest now implements IsReady to check if the navigation mesh has finished being built.
Change 3156748 on 2016/10/10 by Nick.Darnell
Autopmation - Fixing a warning.
Change 3156943 on 2016/10/10 by Alex.Delesky
Fixed an issue where closing out the "Add Code" window with an active toast stating that an IDE was downloading would prevent the toast from clearing correctly.
#jira none
Change 3156946 on 2016/10/10 by Alex.Delesky
#jira UE-36414 - Adding support for the P4Changelist command line argument to the P4 operations that were missing it.
Change 3158215 on 2016/10/11 by Nick.Darnell
Automation - Continued work on the screenshot comparison, fixed a crash, the system now reports if the screenshot was new, as well as similar, so that the script can react and warn when new screenshots are produced. Manually fired screenshots now properly wait until they've been compared before the test moves forward.
Change 3158322 on 2016/10/11 by Michael.Dupuis
#jira UE-36063 If the collection is not shown when trying to save one, force show them so the user understand what is going on
Change 3158333 on 2016/10/11 by Alex.Delesky
#jira UE-36829 - Rebuilt SVN 1.9.4 libs for Windows with CyrusSASL 2.1.26 and SWIG 3.0.10 support.
Change 3158399 on 2016/10/11 by Nick.Darnell
Automation - TTF Font log statements that were not warnings are no longer warnings.
Change 3158406 on 2016/10/11 by Nick.Darnell
Automation - Updating some automation scripts in the engnine that were using file paths to now use FStringAssetReferences, that cleaned up a lot of nasty convert filepath to asset reference code in the tests. Also introducing some maps, and setting up the configs to use them to try and appease some of the existing tests that were expecting them.
Change 3158419 on 2016/10/11 by Alex.Delesky
#jira UE-36829 - SVN 1.9.4 libraries, but also with Java 8u101 support.
Change 3158537 on 2016/10/11 by Nick.Darnell
Automation - Updating some automation scripts in the engnine that were using file paths to now use FStringAssetReferences, that cleaned up a lot of nasty convert filepath to asset reference code in the tests. Also introducing some maps, and setting up the configs to use them to try and appease some of the existing tests that were expecting them.
Adding some missing files.
Change 3158726 on 2016/10/11 by Michael.Dupuis
#jira UE-37001 Perform manual migration of UICurve to proper config category
Change 3158728 on 2016/10/11 by Nick.Darnell
Automation - Fixing some warnings. Adding more testing to the Domino map to serve as a better example.
Change 3158753 on 2016/10/11 by Michael.Dupuis
#jira UE-26261 change it's by its
Change 3158984 on 2016/10/11 by Alexis.Matte
Fix D&D folder import in content browser. We have to expand the root directory to have the correct path.
#jira UE-32155
Change 3159640 on 2016/10/12 by Jamie.Dale
Split localized package redirection out of FCoreDelegates::PackageNameResolvers
They're different enough in behavior that the delegate resolution was breaking the localized package resolution by resolving in too many places and causing the localized package to be loaded with its real localized name as well as the fake non-localized name.
#jira UE-37119
Change 3159741 on 2016/10/12 by Nick.Darnell
Slate - Fixing the SGraphPanel's mouse offset calculations so that it works with HDPI mode.
Change 3159762 on 2016/10/12 by Nick.Darnell
Automation - Adding a way to take a screenshot with the UI, not great yet - it doesn't really obey the rules of resolution, because of the method it uses.
Change 3160210 on 2016/10/12 by Gareth.Martin
Fixed crash when changing Landscape LOD while using "Grass use Landscape Lightmap"
Change 3160216 on 2016/10/12 by Gareth.Martin
Removed unused FLandscapeComponentSceneProxy::LayerNames and made LayerColors editor-only
Fixed negative LODBias on landscape components to actually do anything
Change 3160239 on 2016/10/12 by Gareth.Martin
Removed an unused variable
Change 3160455 on 2016/10/12 by Jamie.Dale
Fixed FText properties exported to asset tags displaying in their NSLOCTEXT form in the asset tooltips
Change 3160457 on 2016/10/12 by Jamie.Dale
Localization automation now groups everything into a single CL and reverts PO files without significant changes
Change 3160554 on 2016/10/12 by Nick.Darnell
UMG - Fixing some panning logic to work with HDPI mode in the designer.
Change 3161712 on 2016/10/13 by Jamie.Dale
Fixed TSharedMapView using hard-coded types
Change 3163044 on 2016/10/14 by Jamie.Dale
Fixed line-break iterators incorrectly breaking words in CJK
Change 3163046 on 2016/10/14 by Jamie.Dale
Text layout no longer creates break candidates when wrapping is disabled
Change 3163217 on 2016/10/14 by Jamie.Dale
Fixed ensure caused by FMediaTextureResource::GetResourceSizeEx
Change 3163641 on 2016/10/14 by Alex.Delesky
#jira UE-36829 - Updated Mac SVN libraries, along with a more accurate changelog for Windows SVN libs
Change 3164428 on 2016/10/17 by Nick.Darnell
Slate - Making the FReply for SetMousePos easier to debug, since that option is potentially very frustrating to debug when someone is changing it.
Change 3164833 on 2016/10/17 by Jamie.Dale
Fixed ParseNumber consuming strings with multiple sequential dots as valid numbers, eg) "10..."
Change 3164868 on 2016/10/17 by Alexis.Matte
Remove re-import material and LOD import material
#jira UE-36640
Change 3164874 on 2016/10/17 by Alexis.Matte
Fix fbx scene re-import of staticmesh loosing there materials
#jira UE-37032
Change 3165080 on 2016/10/17 by Alexis.Matte
Remove skinxx workflow for static mesh
#jira UE-37262
Change 3165232 on 2016/10/17 by Nick.Darnell
Automation - Adding some sub-level testing.
Change 3165822 on 2016/10/18 by Nick.Darnell
Slate - Add a counter to track how much time we spend drawing custom verts each frame.
Change 3165934 on 2016/10/18 by Nick.Darnell
Slate - Addding cycle counters to SInvalidationPanel's Tick and Paint.
Change 3165947 on 2016/10/18 by Nick.Darnell
Slate - Addding very verbose slate stats behind a compiler flag to avoid the large overhead of these stats. To enable them you'll need to set WITH_VERY_VERBOSE_SLATE_STATS to 1, added a guide on debugging slate performance to the SlateGlobals.h
// HOW TO GET AN IN-DEPTH PERFORMANCE ANALYSIS OF SLATE
//
// Step 1)
// Set WITH_VERY_VERBOSE_SLATE_STATS to 1.
//
// Step 2)
// When running the game (outside of the editor), run these commandline options
// in order and you'll get a large dump of where all the time is going in Slate.
//
// stat group enable slateverbose
// stat group enable slateveryverbose
// stat dumpave -root=stat_slate -num=120 -ms=0
Change 3165962 on 2016/10/18 by Nick.Darnell
UMG - Play first frame of sequence in UMG immediately when told to play an animation.
Change 3165981 on 2016/10/18 by Nick.Darnell
Core - GetDisplayNameText now stores the FName for DisplayName in a static instead of using TEXT("DisplayName").
Change 3166000 on 2016/10/18 by Jamie.Dale
Removed bulk-data from fonts
The main complaints about composite fonts have always been:
1) They use too much memory at runtime.
2) They bloat if you use the same font face twice.
3) They often break when used outside the game thread.
This change aims to address all of these issues by removing bulk-data from fonts (which was the cause of the memory bloat and threading issues), and introduces UFontFace assets (which allow you to re-use the same font face in different entries within a composite font).
No existing font data is lost during this transition, however you must manually update your UFont assets to reference external UFontFace assets before you're able to edit the existing data (which is automatically upgraded to UFontFace assets *within* the UFont package). This upgrade can be done via the composite font editor.
During cook these UFontFace assets write out the actual TTF/OTF font data as a .ufont file, which is what FreeType actually loads at runtime (the internals of the Slate font cache are now completely independent of UObjects and their lifetimes and loading concerns).
Since we're now always loading files from disk, we can also give the user an option of whether to "pre-load" (which will load the entire font into memory, like bulk-data always used to), or "stream" the font from disk (which has minimal memory overhead, but needs decent I/O performance).
Change 3166001 on 2016/10/18 by Jamie.Dale
Updated the Launcher to no longer use bulk-data for fonts
Change 3166003 on 2016/10/18 by Jamie.Dale
Updated the Engine fonts to use UFontFace assets
Change 3166028 on 2016/10/18 by Alex.Delesky
#jira UE-37021 - The scrollbar will now remain at the bottom of the output log after specifying a filter.
Change 3166071 on 2016/10/18 by Nick.Darnell
Slate - Fixing a warning about hiding an inherited member.
Change 3166213 on 2016/10/18 by Jamie.Dale
Fixing crash caused by accessing a zeroed FText
Change 3166222 on 2016/10/18 by Nick.Darnell
Automation - Adding some code to end the sub level test when it starts.
Change 3166231 on 2016/10/18 by Nick.Darnell
Editor - Fixing the build warning, SOutputLog.cpp:748:4: warning: field 'TextLayout' will be initialized after field 'CachedNumMessages'
Change 3166717 on 2016/10/18 by Nick.Darnell
Automation - Removing references to old options that are no longer file paths, and are now StringAssetReferences these options were not being used by anyone as far as I can tell.
#jira UE-37482
Change 3167279 on 2016/10/19 by Jamie.Dale
Fixed text render component regression with custom MIDs
#jira UE-37305
Change 3167356 on 2016/10/19 by Alexis.Matte
Make sure the old asset are build correctly
#jira UE-37461
Change 3167359 on 2016/10/19 by Alexis.Matte
Fix re-import of mesh material assignment regression
#jira UE-37479
[CL 3168049 by Matt Kuhlenschmidt in Main branch]
2016-10-19 15:01:48 -04:00
FWidgetPath WidgetPath ;
if ( FSlateApplication : : Get ( ) . GeneratePathToWidgetUnchecked ( AsShared ( ) , WidgetPath , EVisibility : : All ) ) // since the collection window can be hidden, we need to manually search the path with a EVisibility::All instead of the default EVisibility::Visible
{
FSlateApplication : : Get ( ) . PushMenu (
AsShared ( ) ,
WidgetPath ,
MenuBuilder . MakeWidget ( ) ,
FSlateApplication : : Get ( ) . GetCursorPos ( ) ,
FPopupTransitionEffect ( FPopupTransitionEffect : : TopMenu )
2015-07-09 09:59:51 -04:00
) ;
Copying //UE4/Dev-Editor to //UE4/Dev-Main (Source: //UE4/Dev-Editor @ 3167359)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3152124 on 2016/10/05 by Jamie.Dale
Fixed SOutputLog filter not handling OnTextCommitted
Change 3152255 on 2016/10/05 by Michael.Dupuis
#jira UE-28173 Support \" properly in FName
Change 3152273 on 2016/10/05 by Nick.Darnell
Core - The module manager is now thread safer, we had a critical section around the internal module list - but we were incrementing/decrementing shared pointers to module data shared pointers that were not thread safe outside of the critical section. Ran into a crash working on some heavily threaded code in automation.
Change 3152314 on 2016/10/05 by Nick.Darnell
Automation - Continued work to rough out the automation workflow for screenshot. Still lots of work remaining, but it appears the basic of approving images might be working as of this CL.
Change 3152316 on 2016/10/05 by Michael.Dupuis
#jira UE-30346 Update selection when in tree view mode
Change 3152317 on 2016/10/05 by Nick.Darnell
Automation - Adding some test shots to compare against to EngineTest for screenshot approval.
Change 3152319 on 2016/10/05 by Michael.Dupuis
#jira UE-29817 StringAssetReference will now only open an Asset picker (not actor picker) as the goal is to reference an asset
Change 3152521 on 2016/10/05 by Nick.Darnell
Automation - Fixing some issues with where it reads the screenshot compare rules.
Change 3152536 on 2016/10/05 by Alexis.Matte
Fix FBX automation test.
- Make sure the fbx test can avoid automatic detection of the mesh type
- Avoid to log the warning when the importer set the material usage after creating a material for skeletalmesh.
Change 3152572 on 2016/10/05 by Nick.Darnell
Automation - The GameProjectAutomationTests now do some pre-run house cleaning to make sure the project doesn't already exist, and tries to remove it if it was created previously but not deleted.
Change 3152591 on 2016/10/05 by Nick.Darnell
Automation - Changing the game project errors to be errors.
Change 3153115 on 2016/10/06 by Jamie.Dale
Removed superflous padding when SPropertyEditorAsset had no buttons
Change 3153215 on 2016/10/06 by Michael.Dupuis
Fixed build warning
Change 3153248 on 2016/10/06 by Nick.Darnell
Automation - Working on solving projects not being generated, suspect UBT isn't built or isn't available.
Change 3153255 on 2016/10/06 by Nick.Darnell
PR #2835: Fix TestEqual AddError Message in FAutomationTestBase (Contributed by dorgonman)
#jira UE-36922
Change 3153300 on 2016/10/06 by Nick.Darnell
Automation - Enabled verbose logging to automation build farm.
Change 3153343 on 2016/10/06 by Matt.Kuhlenschmidt
PR #2825: More project launcher progress improvements (Contributed by projectgheist)
Change 3153506 on 2016/10/06 by Gareth.Martin
Fixed crash trying to edit landscape with r.LightPropagationVolume=1 enabled
#jira UE-36933
Change 3153752 on 2016/10/06 by tim.gautier
Add toggle button to UMG_Behavior. Set Level Blueprint for TM-UMG to AllWidget
Change 3153763 on 2016/10/06 by Nick.Darnell
Automation - Disable verbose logging.
Change 3153778 on 2016/10/06 by Nick.Darnell
PR #2837: Fixed engine compilation with defined LOG_SLATE_EVENTS (Contributed by Pierdek)
#jira UE-36940
Change 3153943 on 2016/10/06 by Nick.Darnell
Automation - Disabling some broken tests.
Change 3154035 on 2016/10/06 by Nick.Darnell
Automation - Fixing re-runs for tests that want them. Previously this wasn't working for any test that was run using the Reprostring method of being executed.
Change 3154039 on 2016/10/06 by Nick.Darnell
Automation - Updating some test assets in the EngineTest project.
Change 3154476 on 2016/10/07 by Richard.TalbotWatkin
Fix to regression where vertex color view in Mesh Paint Mode no longer worked correctly. We now allow selected static meshes to go down the dynamic path if VertexColors show mode is active.
#jira UE-36772 - Selecting a channel in Vertex Paint mode does not show the channel color
Change 3154650 on 2016/10/07 by Alexis.Matte
Add new front axis facing X option to fbx importer
Change 3154785 on 2016/10/07 by Nick.Darnell
Automation - Continued work on automation, ripping out the message bus from the screenshot manager, that's causing the screenshot manager to recieve shots from every machine ever running tests. The Automation Controller is now in charge, and will tell the screenshot manager whatever it needs.
Change 3155131 on 2016/10/07 by Michael.Dupuis
#jira UE-36509 Do not disabled inverse filter when doing a sync to asset
Change 3155141 on 2016/10/07 by Michael.Dupuis
#jira UE-36056 Do not open the Actor Picker if we're working on an archetype object
Change 3155262 on 2016/10/07 by Michael.Dupuis
#jira UE-19737 reset ctrl key when resetting state to None
Change 3156326 on 2016/10/09 by Matt.Kuhlenschmidt
Fixed crash when asset picker is used without a property editor (usually a heavily customized property).
Change 3156473 on 2016/10/10 by Richard.TalbotWatkin
Attempt to make geometry render / rebuild more robust in the hope of catching UE-36265.
#jira UE-36265 - [CrashReport] UE4Editor_Engine!FModelSceneProxy::HasSelectedSurfaces() [modelrender.cpp:538]
Change 3156479 on 2016/10/10 by Richard.TalbotWatkin
Fixed non-editor build.
Change 3156579 on 2016/10/10 by Alexis.Matte
Add a check to make sure curve pointer is valid.
#jira UE-36177
Change 3156585 on 2016/10/10 by Ben.Marsh
Fix line endings for screenshot settings.
Change 3156617 on 2016/10/10 by Matt.Kuhlenschmidt
Disable per-pixel blending of menus by default. Causes artifacts on windows versions and we are not using it.
Change 3156674 on 2016/10/10 by Nick.Darnell
Automation - Continued work on the automation workflow. Now screenshot functional test actors actually have the screenshot processed for differences during the test back on the test controller machine, and then waits for the results of the comparison to be performed.
Change 3156709 on 2016/10/10 by Alexis.Matte
#jira UE-16337
Make sure the base mesh import data transform is used when we import a LOD.
Change 3156714 on 2016/10/10 by Nick.Darnell
Automation - Fixing -game crash due to TestName being null in functional test.
Change 3156721 on 2016/10/10 by Nick.Darnell
Automation - FunctionalAITest now implements IsReady to check if the navigation mesh has finished being built.
Change 3156748 on 2016/10/10 by Nick.Darnell
Autopmation - Fixing a warning.
Change 3156943 on 2016/10/10 by Alex.Delesky
Fixed an issue where closing out the "Add Code" window with an active toast stating that an IDE was downloading would prevent the toast from clearing correctly.
#jira none
Change 3156946 on 2016/10/10 by Alex.Delesky
#jira UE-36414 - Adding support for the P4Changelist command line argument to the P4 operations that were missing it.
Change 3158215 on 2016/10/11 by Nick.Darnell
Automation - Continued work on the screenshot comparison, fixed a crash, the system now reports if the screenshot was new, as well as similar, so that the script can react and warn when new screenshots are produced. Manually fired screenshots now properly wait until they've been compared before the test moves forward.
Change 3158322 on 2016/10/11 by Michael.Dupuis
#jira UE-36063 If the collection is not shown when trying to save one, force show them so the user understand what is going on
Change 3158333 on 2016/10/11 by Alex.Delesky
#jira UE-36829 - Rebuilt SVN 1.9.4 libs for Windows with CyrusSASL 2.1.26 and SWIG 3.0.10 support.
Change 3158399 on 2016/10/11 by Nick.Darnell
Automation - TTF Font log statements that were not warnings are no longer warnings.
Change 3158406 on 2016/10/11 by Nick.Darnell
Automation - Updating some automation scripts in the engnine that were using file paths to now use FStringAssetReferences, that cleaned up a lot of nasty convert filepath to asset reference code in the tests. Also introducing some maps, and setting up the configs to use them to try and appease some of the existing tests that were expecting them.
Change 3158419 on 2016/10/11 by Alex.Delesky
#jira UE-36829 - SVN 1.9.4 libraries, but also with Java 8u101 support.
Change 3158537 on 2016/10/11 by Nick.Darnell
Automation - Updating some automation scripts in the engnine that were using file paths to now use FStringAssetReferences, that cleaned up a lot of nasty convert filepath to asset reference code in the tests. Also introducing some maps, and setting up the configs to use them to try and appease some of the existing tests that were expecting them.
Adding some missing files.
Change 3158726 on 2016/10/11 by Michael.Dupuis
#jira UE-37001 Perform manual migration of UICurve to proper config category
Change 3158728 on 2016/10/11 by Nick.Darnell
Automation - Fixing some warnings. Adding more testing to the Domino map to serve as a better example.
Change 3158753 on 2016/10/11 by Michael.Dupuis
#jira UE-26261 change it's by its
Change 3158984 on 2016/10/11 by Alexis.Matte
Fix D&D folder import in content browser. We have to expand the root directory to have the correct path.
#jira UE-32155
Change 3159640 on 2016/10/12 by Jamie.Dale
Split localized package redirection out of FCoreDelegates::PackageNameResolvers
They're different enough in behavior that the delegate resolution was breaking the localized package resolution by resolving in too many places and causing the localized package to be loaded with its real localized name as well as the fake non-localized name.
#jira UE-37119
Change 3159741 on 2016/10/12 by Nick.Darnell
Slate - Fixing the SGraphPanel's mouse offset calculations so that it works with HDPI mode.
Change 3159762 on 2016/10/12 by Nick.Darnell
Automation - Adding a way to take a screenshot with the UI, not great yet - it doesn't really obey the rules of resolution, because of the method it uses.
Change 3160210 on 2016/10/12 by Gareth.Martin
Fixed crash when changing Landscape LOD while using "Grass use Landscape Lightmap"
Change 3160216 on 2016/10/12 by Gareth.Martin
Removed unused FLandscapeComponentSceneProxy::LayerNames and made LayerColors editor-only
Fixed negative LODBias on landscape components to actually do anything
Change 3160239 on 2016/10/12 by Gareth.Martin
Removed an unused variable
Change 3160455 on 2016/10/12 by Jamie.Dale
Fixed FText properties exported to asset tags displaying in their NSLOCTEXT form in the asset tooltips
Change 3160457 on 2016/10/12 by Jamie.Dale
Localization automation now groups everything into a single CL and reverts PO files without significant changes
Change 3160554 on 2016/10/12 by Nick.Darnell
UMG - Fixing some panning logic to work with HDPI mode in the designer.
Change 3161712 on 2016/10/13 by Jamie.Dale
Fixed TSharedMapView using hard-coded types
Change 3163044 on 2016/10/14 by Jamie.Dale
Fixed line-break iterators incorrectly breaking words in CJK
Change 3163046 on 2016/10/14 by Jamie.Dale
Text layout no longer creates break candidates when wrapping is disabled
Change 3163217 on 2016/10/14 by Jamie.Dale
Fixed ensure caused by FMediaTextureResource::GetResourceSizeEx
Change 3163641 on 2016/10/14 by Alex.Delesky
#jira UE-36829 - Updated Mac SVN libraries, along with a more accurate changelog for Windows SVN libs
Change 3164428 on 2016/10/17 by Nick.Darnell
Slate - Making the FReply for SetMousePos easier to debug, since that option is potentially very frustrating to debug when someone is changing it.
Change 3164833 on 2016/10/17 by Jamie.Dale
Fixed ParseNumber consuming strings with multiple sequential dots as valid numbers, eg) "10..."
Change 3164868 on 2016/10/17 by Alexis.Matte
Remove re-import material and LOD import material
#jira UE-36640
Change 3164874 on 2016/10/17 by Alexis.Matte
Fix fbx scene re-import of staticmesh loosing there materials
#jira UE-37032
Change 3165080 on 2016/10/17 by Alexis.Matte
Remove skinxx workflow for static mesh
#jira UE-37262
Change 3165232 on 2016/10/17 by Nick.Darnell
Automation - Adding some sub-level testing.
Change 3165822 on 2016/10/18 by Nick.Darnell
Slate - Add a counter to track how much time we spend drawing custom verts each frame.
Change 3165934 on 2016/10/18 by Nick.Darnell
Slate - Addding cycle counters to SInvalidationPanel's Tick and Paint.
Change 3165947 on 2016/10/18 by Nick.Darnell
Slate - Addding very verbose slate stats behind a compiler flag to avoid the large overhead of these stats. To enable them you'll need to set WITH_VERY_VERBOSE_SLATE_STATS to 1, added a guide on debugging slate performance to the SlateGlobals.h
// HOW TO GET AN IN-DEPTH PERFORMANCE ANALYSIS OF SLATE
//
// Step 1)
// Set WITH_VERY_VERBOSE_SLATE_STATS to 1.
//
// Step 2)
// When running the game (outside of the editor), run these commandline options
// in order and you'll get a large dump of where all the time is going in Slate.
//
// stat group enable slateverbose
// stat group enable slateveryverbose
// stat dumpave -root=stat_slate -num=120 -ms=0
Change 3165962 on 2016/10/18 by Nick.Darnell
UMG - Play first frame of sequence in UMG immediately when told to play an animation.
Change 3165981 on 2016/10/18 by Nick.Darnell
Core - GetDisplayNameText now stores the FName for DisplayName in a static instead of using TEXT("DisplayName").
Change 3166000 on 2016/10/18 by Jamie.Dale
Removed bulk-data from fonts
The main complaints about composite fonts have always been:
1) They use too much memory at runtime.
2) They bloat if you use the same font face twice.
3) They often break when used outside the game thread.
This change aims to address all of these issues by removing bulk-data from fonts (which was the cause of the memory bloat and threading issues), and introduces UFontFace assets (which allow you to re-use the same font face in different entries within a composite font).
No existing font data is lost during this transition, however you must manually update your UFont assets to reference external UFontFace assets before you're able to edit the existing data (which is automatically upgraded to UFontFace assets *within* the UFont package). This upgrade can be done via the composite font editor.
During cook these UFontFace assets write out the actual TTF/OTF font data as a .ufont file, which is what FreeType actually loads at runtime (the internals of the Slate font cache are now completely independent of UObjects and their lifetimes and loading concerns).
Since we're now always loading files from disk, we can also give the user an option of whether to "pre-load" (which will load the entire font into memory, like bulk-data always used to), or "stream" the font from disk (which has minimal memory overhead, but needs decent I/O performance).
Change 3166001 on 2016/10/18 by Jamie.Dale
Updated the Launcher to no longer use bulk-data for fonts
Change 3166003 on 2016/10/18 by Jamie.Dale
Updated the Engine fonts to use UFontFace assets
Change 3166028 on 2016/10/18 by Alex.Delesky
#jira UE-37021 - The scrollbar will now remain at the bottom of the output log after specifying a filter.
Change 3166071 on 2016/10/18 by Nick.Darnell
Slate - Fixing a warning about hiding an inherited member.
Change 3166213 on 2016/10/18 by Jamie.Dale
Fixing crash caused by accessing a zeroed FText
Change 3166222 on 2016/10/18 by Nick.Darnell
Automation - Adding some code to end the sub level test when it starts.
Change 3166231 on 2016/10/18 by Nick.Darnell
Editor - Fixing the build warning, SOutputLog.cpp:748:4: warning: field 'TextLayout' will be initialized after field 'CachedNumMessages'
Change 3166717 on 2016/10/18 by Nick.Darnell
Automation - Removing references to old options that are no longer file paths, and are now StringAssetReferences these options were not being used by anyone as far as I can tell.
#jira UE-37482
Change 3167279 on 2016/10/19 by Jamie.Dale
Fixed text render component regression with custom MIDs
#jira UE-37305
Change 3167356 on 2016/10/19 by Alexis.Matte
Make sure the old asset are build correctly
#jira UE-37461
Change 3167359 on 2016/10/19 by Alexis.Matte
Fix re-import of mesh material assignment regression
#jira UE-37479
[CL 3168049 by Matt Kuhlenschmidt in Main branch]
2016-10-19 15:01:48 -04:00
}
2015-07-09 09:59:51 -04:00
}
2014-03-14 14:13:41 -04:00
bool SCollectionView : : ShouldAllowSelectionChangedDelegate ( ) const
{
return PreventSelectionChangedDelegateCount = = 0 ;
}
FReply SCollectionView : : MakeAddCollectionMenu ( )
{
// Get all menu extenders for this context menu from the content browser module
FContentBrowserModule & ContentBrowserModule = FModuleManager : : GetModuleChecked < FContentBrowserModule > ( TEXT ( " ContentBrowser " ) ) ;
TArray < FContentBrowserMenuExtender > MenuExtenderDelegates = ContentBrowserModule . GetAllCollectionViewContextMenuExtenders ( ) ;
TArray < TSharedPtr < FExtender > > Extenders ;
for ( int32 i = 0 ; i < MenuExtenderDelegates . Num ( ) ; + + i )
{
if ( MenuExtenderDelegates [ i ] . IsBound ( ) )
{
Extenders . Add ( MenuExtenderDelegates [ i ] . Execute ( ) ) ;
}
}
TSharedPtr < FExtender > MenuExtender = FExtender : : Combine ( Extenders ) ;
FMenuBuilder MenuBuilder ( /*bInShouldCloseWindowAfterMenuSelection=*/ true , NULL , MenuExtender , true ) ;
CollectionContextMenu - > UpdateProjectSourceControl ( ) ;
2015-07-09 09:59:51 -04:00
CollectionContextMenu - > MakeNewCollectionSubMenu ( MenuBuilder , ECollectionStorageMode : : Static , SCollectionView : : FCreateCollectionPayload ( ) ) ;
2014-03-14 14:13:41 -04:00
FSlateApplication : : Get ( ) . PushMenu (
AsShared ( ) ,
2015-06-05 20:19:33 -04:00
FWidgetPath ( ) ,
2014-03-14 14:13:41 -04:00
MenuBuilder . MakeWidget ( ) ,
FSlateApplication : : Get ( ) . GetCursorPos ( ) ,
FPopupTransitionEffect ( FPopupTransitionEffect : : TopMenu )
) ;
return FReply : : Handled ( ) ;
}
2015-05-26 10:11:32 -04:00
EVisibility SCollectionView : : GetCollectionsTitleTextVisibility ( ) const
{
// Only show the title text if we have an expansion area, but are collapsed
return ( CollectionsExpandableAreaPtr . IsValid ( ) & & ! CollectionsExpandableAreaPtr - > IsExpanded ( ) ) ? EVisibility : : Visible : EVisibility : : Collapsed ;
}
EVisibility SCollectionView : : GetCollectionsSearchBoxVisibility ( ) const
{
// Only show the search box if we have an expanded expansion area, or aren't currently using an expansion area
return ( ! CollectionsExpandableAreaPtr . IsValid ( ) | | CollectionsExpandableAreaPtr - > IsExpanded ( ) ) ? EVisibility : : Visible : EVisibility : : Collapsed ;
}
2014-03-14 14:13:41 -04:00
EVisibility SCollectionView : : GetAddCollectionButtonVisibility ( ) const
{
return ( bAllowCollectionButtons & & ( ! CollectionsExpandableAreaPtr . IsValid ( ) | | CollectionsExpandableAreaPtr - > IsExpanded ( ) ) ) ? EVisibility : : Visible : EVisibility : : Collapsed ;
}
2015-07-09 09:59:51 -04:00
void SCollectionView : : CreateCollectionItem ( ECollectionShareType : : Type CollectionType , ECollectionStorageMode : : Type StorageMode , const FCreateCollectionPayload & InCreationPayload )
2014-03-14 14:13:41 -04:00
{
if ( ensure ( CollectionType ! = ECollectionShareType : : CST_All ) )
{
2015-06-01 10:04:42 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
2014-03-14 14:13:41 -04:00
const FName BaseCollectionName = * LOCTEXT ( " NewCollectionName " , " NewCollection " ) . ToString ( ) ;
FName CollectionName ;
CollectionManagerModule . Get ( ) . CreateUniqueCollectionName ( BaseCollectionName , CollectionType , CollectionName ) ;
2015-06-01 09:29:31 -04:00
TSharedPtr < FCollectionItem > NewItem = MakeShareable ( new FCollectionItem ( CollectionName , CollectionType ) ) ;
2015-07-09 09:59:51 -04:00
NewItem - > StorageMode = StorageMode ;
2014-03-14 14:13:41 -04:00
2015-05-21 14:47:20 -04:00
// Adding a new collection now, so clear any filter we may have applied
SearchBoxPtr - > SetText ( FText : : GetEmpty ( ) ) ;
2015-07-09 09:59:51 -04:00
if ( InCreationPayload . ParentCollection . IsSet ( ) )
2015-07-02 06:52:21 -04:00
{
2015-07-09 09:59:51 -04:00
TSharedPtr < FCollectionItem > ParentCollectionItem = AvailableCollections . FindRef ( InCreationPayload . ParentCollection . GetValue ( ) ) ;
2015-07-02 06:52:21 -04:00
if ( ParentCollectionItem . IsValid ( ) )
{
ParentCollectionItem - > ChildCollections . Add ( NewItem ) ;
NewItem - > ParentCollection = ParentCollectionItem ;
// Make sure the parent is expanded so we can see its newly added child item
CollectionTreePtr - > SetItemExpansion ( ParentCollectionItem , true ) ;
}
}
2014-03-14 14:13:41 -04:00
// Mark the new collection for rename and that it is new so it will be created upon successful rename
NewItem - > bRenaming = true ;
NewItem - > bNewCollection = true ;
2015-07-09 09:59:51 -04:00
NewItem - > OnCollectionCreatedEvent = InCreationPayload . OnCollectionCreatedEvent ;
2014-03-14 14:13:41 -04:00
2015-06-19 07:33:02 -04:00
AvailableCollections . Add ( FCollectionNameType ( NewItem - > CollectionName , NewItem - > CollectionType ) , NewItem ) ;
2015-06-10 13:19:26 -04:00
UpdateFilteredCollectionItems ( ) ;
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > RequestScrollIntoView ( NewItem ) ;
CollectionTreePtr - > SetSelection ( NewItem ) ;
2014-03-14 14:13:41 -04:00
}
}
void SCollectionView : : RenameCollectionItem ( const TSharedPtr < FCollectionItem > & ItemToRename )
{
if ( ensure ( ItemToRename . IsValid ( ) ) )
{
ItemToRename - > bRenaming = true ;
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > RequestScrollIntoView ( ItemToRename ) ;
2014-03-14 14:13:41 -04:00
}
}
2015-06-19 07:33:02 -04:00
void SCollectionView : : DeleteCollectionItems ( const TArray < TSharedPtr < FCollectionItem > > & ItemsToDelete )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
if ( ItemsToDelete . Num ( ) = = 0 )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
return ;
}
2014-03-14 14:13:41 -04:00
2015-06-19 07:33:02 -04:00
// Before we delete anything (as this will trigger a tree update) we need to work out what our new selection should be in the case that
// all of the selected items are removed
const TArray < TSharedPtr < FCollectionItem > > PreviouslySelectedItems = CollectionTreePtr - > GetSelectedItems ( ) ;
// Get the first selected item that will be deleted so we can find a suitable new selection
TSharedPtr < FCollectionItem > FirstSelectedItemDeleted ;
for ( const auto & ItemToDelete : ItemsToDelete )
{
if ( PreviouslySelectedItems . Contains ( ItemToDelete ) )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
FirstSelectedItemDeleted = ItemToDelete ;
break ;
2014-03-14 14:13:41 -04:00
}
}
2015-06-19 07:33:02 -04:00
// Build up an array of potential new selections (in the case that we're deleting everything that's selected)
// Earlier items should be considered first, we base this list on the first selected item that will be deleted, and include previous siblings, and then all parents and roots
TArray < FCollectionNameType > PotentialNewSelections ;
if ( FirstSelectedItemDeleted . IsValid ( ) )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
TSharedPtr < FCollectionItem > RootSelectedItemDeleted = FirstSelectedItemDeleted ;
TSharedPtr < FCollectionItem > ParentCollectionItem = FirstSelectedItemDeleted - > ParentCollection . Pin ( ) ;
if ( ParentCollectionItem . IsValid ( ) )
{
// Add all the siblings until we find the item that will be deleted
for ( const auto & ChildItemWeakPtr : ParentCollectionItem - > ChildCollections )
{
TSharedPtr < FCollectionItem > ChildItem = ChildItemWeakPtr . Pin ( ) ;
if ( ChildItem . IsValid ( ) )
{
if ( ChildItem = = FirstSelectedItemDeleted )
{
break ;
}
// We add siblings as the start, as the closest sibling should be the first match
PotentialNewSelections . Insert ( FCollectionNameType ( ChildItem - > CollectionName , ChildItem - > CollectionType ) , 0 ) ;
}
}
// Now add this parent, and all other parents too
do
{
PotentialNewSelections . Add ( FCollectionNameType ( ParentCollectionItem - > CollectionName , ParentCollectionItem - > CollectionType ) ) ;
RootSelectedItemDeleted = ParentCollectionItem ;
ParentCollectionItem = ParentCollectionItem - > ParentCollection . Pin ( ) ;
}
while ( ParentCollectionItem . IsValid ( ) ) ;
}
if ( RootSelectedItemDeleted . IsValid ( ) )
{
// Add all the root level items before this one
const int32 InsertionPoint = PotentialNewSelections . Num ( ) ;
for ( const auto & RootItem : VisibleRootCollectionItems )
{
if ( RootItem = = RootSelectedItemDeleted )
{
break ;
}
// Add each root item at the insertion point, as the closest item should be a better match
PotentialNewSelections . Insert ( FCollectionNameType ( RootItem - > CollectionName , RootItem - > CollectionType ) , InsertionPoint ) ;
}
}
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
// Delete all given collections
int32 NumSelectedItemsDeleted = 0 ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
for ( const TSharedPtr < FCollectionItem > & ItemToDelete : ItemsToDelete )
{
if ( CollectionManagerModule . Get ( ) . DestroyCollection ( ItemToDelete - > CollectionName , ItemToDelete - > CollectionType ) )
{
if ( PreviouslySelectedItems . Contains ( ItemToDelete ) )
{
+ + NumSelectedItemsDeleted ;
}
}
else
{
// Display a warning
const FVector2D & CursorPos = FSlateApplication : : Get ( ) . GetCursorPos ( ) ;
FSlateRect MessageAnchor ( CursorPos . X , CursorPos . Y , CursorPos . X , CursorPos . Y ) ;
ContentBrowserUtils : : DisplayMessage (
FText : : Format ( LOCTEXT ( " CollectionDestroyFailed " , " Failed to destroy collection. {0} " ) , CollectionManagerModule . Get ( ) . GetLastError ( ) ) ,
MessageAnchor ,
CollectionTreePtr . ToSharedRef ( )
) ;
}
}
// DestroyCollection will have triggered a notification that will have updated the tree, we now need to apply a suitable selection...
// Did this delete change the list of selected items?
if ( NumSelectedItemsDeleted > 0 | | PreviouslySelectedItems . Num ( ) = = 0 )
{
// If we removed everything that was selected, we need to try and find a suitable replacement...
if ( NumSelectedItemsDeleted > = PreviouslySelectedItems . Num ( ) & & VisibleCollections . Num ( ) > 1 )
{
// Include the first visible item as an absolute last resort should everything else suitable have been removed from the tree
PotentialNewSelections . Add ( * VisibleCollections . CreateConstIterator ( ) ) ;
// Check the potential new selections array and try and select the first one that's still visible in the tree
TArray < FCollectionNameType > NewItemSelection ;
for ( const FCollectionNameType & PotentialNewSelection : PotentialNewSelections )
{
if ( VisibleCollections . Contains ( PotentialNewSelection ) )
{
NewItemSelection . Add ( PotentialNewSelection ) ;
break ;
}
}
SetSelectedCollections ( NewItemSelection , true ) ;
}
// Broadcast the new selection
const TArray < TSharedPtr < FCollectionItem > > UpdatedSelectedItems = CollectionTreePtr - > GetSelectedItems ( ) ;
CollectionSelectionChanged ( ( UpdatedSelectedItems . Num ( ) > 0 ) ? UpdatedSelectedItems [ 0 ] : nullptr , ESelectInfo : : Direct ) ;
}
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
EVisibility SCollectionView : : GetCollectionTreeVisibility ( ) const
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
return AvailableCollections . Num ( ) > 0 ? EVisibility : : Visible : EVisibility : : Collapsed ;
}
const FSlateBrush * SCollectionView : : GetCollectionViewDropTargetBorder ( ) const
{
return bDraggedOver ? FEditorStyle : : GetBrush ( " ContentBrowser.CollectionTreeDragDropBorder " ) : FEditorStyle : : GetBrush ( " NoBorder " ) ;
2014-03-14 14:13:41 -04:00
}
TSharedRef < ITableRow > SCollectionView : : GenerateCollectionRow ( TSharedPtr < FCollectionItem > CollectionItem , const TSharedRef < STableViewBase > & OwnerTable )
{
check ( CollectionItem . IsValid ( ) ) ;
2015-05-29 13:15:40 -04:00
// Only bind the check box callbacks if we're allowed to show check boxes
TAttribute < bool > IsCollectionCheckBoxEnabledAttribute ;
TAttribute < ECheckBoxState > IsCollectionCheckedAttribute ;
FOnCheckStateChanged OnCollectionCheckStateChangedDelegate ;
if ( QuickAssetManagement . IsValid ( ) )
{
2015-07-09 09:59:51 -04:00
// Can only manage assets for static collections
if ( CollectionItem - > StorageMode = = ECollectionStorageMode : : Static )
{
IsCollectionCheckBoxEnabledAttribute . Bind ( TAttribute < bool > : : FGetter : : CreateSP ( this , & SCollectionView : : IsCollectionCheckBoxEnabled , CollectionItem ) ) ;
IsCollectionCheckedAttribute . Bind ( TAttribute < ECheckBoxState > : : FGetter : : CreateSP ( this , & SCollectionView : : IsCollectionChecked , CollectionItem ) ) ;
OnCollectionCheckStateChangedDelegate . BindSP ( this , & SCollectionView : : OnCollectionCheckStateChanged , CollectionItem ) ;
}
else
{
IsCollectionCheckBoxEnabledAttribute . Bind ( TAttribute < bool > : : FGetter : : CreateLambda ( [ ] { return false ; } ) ) ;
IsCollectionCheckedAttribute . Bind ( TAttribute < ECheckBoxState > : : FGetter : : CreateLambda ( [ ] { return ECheckBoxState : : Unchecked ; } ) ) ;
}
2015-05-29 13:15:40 -04:00
}
2015-06-19 07:33:02 -04:00
TSharedPtr < STableRow < TSharedPtr < FCollectionItem > > > TableRow = SNew ( STableRow < TSharedPtr < FCollectionItem > > , OwnerTable )
. OnDragDetected ( this , & SCollectionView : : OnCollectionDragDetected ) ;
2014-03-14 14:13:41 -04:00
TableRow - > SetContent
(
2015-06-19 07:33:02 -04:00
SNew ( SCollectionTreeItem )
2014-03-14 14:13:41 -04:00
. ParentWidget ( SharedThis ( this ) )
. CollectionItem ( CollectionItem )
. OnNameChangeCommit ( this , & SCollectionView : : CollectionNameChangeCommit )
. OnVerifyRenameCommit ( this , & SCollectionView : : CollectionVerifyRenameCommit )
2015-06-19 07:33:02 -04:00
. OnValidateDragDrop ( this , & SCollectionView : : ValidateDragDropOnCollectionItem )
. OnHandleDragDrop ( this , & SCollectionView : : HandleDragDropOnCollectionItem )
. IsSelected ( TableRow . Get ( ) , & STableRow < TSharedPtr < FCollectionItem > > : : IsSelectedExclusively )
. IsReadOnly ( this , & SCollectionView : : IsCollectionNameReadOnly )
. HighlightText ( this , & SCollectionView : : GetCollectionsSearchFilterText )
. IsCheckBoxEnabled ( IsCollectionCheckBoxEnabledAttribute )
. IsCollectionChecked ( IsCollectionCheckedAttribute )
. OnCollectionCheckStateChanged ( OnCollectionCheckStateChangedDelegate )
2014-03-14 14:13:41 -04:00
) ;
return TableRow . ToSharedRef ( ) ;
}
2015-06-19 07:33:02 -04:00
void SCollectionView : : GetCollectionItemChildren ( TSharedPtr < FCollectionItem > InParentItem , TArray < TSharedPtr < FCollectionItem > > & OutChildItems ) const
{
for ( const auto & ChildItemWeakPtr : InParentItem - > ChildCollections )
{
TSharedPtr < FCollectionItem > ChildItem = ChildItemWeakPtr . Pin ( ) ;
if ( ChildItem . IsValid ( ) & & VisibleCollections . Contains ( FCollectionNameType ( ChildItem - > CollectionName , ChildItem - > CollectionType ) ) )
{
OutChildItems . Add ( ChildItem ) ;
}
}
OutChildItems . Sort ( FCollectionItem : : FCompareFCollectionItemByName ( ) ) ;
}
FReply SCollectionView : : OnCollectionDragDetected ( const FGeometry & Geometry , const FPointerEvent & MouseEvent )
{
if ( bAllowCollectionDrag & & MouseEvent . IsMouseButtonDown ( EKeys : : LeftMouseButton ) )
{
const TArray < FCollectionNameType > SelectedCollections = GetSelectedCollections ( ) ;
if ( SelectedCollections . Num ( ) > 0 )
{
TSharedRef < FCollectionDragDropOp > DragDropOp = FCollectionDragDropOp : : New ( SelectedCollections ) ;
CurrentCollectionDragDropOp = DragDropOp ;
return FReply : : Handled ( ) . BeginDragDrop ( DragDropOp ) ;
}
}
return FReply : : Unhandled ( ) ;
}
bool SCollectionView : : ValidateDragDropOnCollectionTree ( const FGeometry & Geometry , const FDragDropEvent & DragDropEvent , bool & OutIsKnownDragOperation )
{
OutIsKnownDragOperation = false ;
TSharedPtr < FDragDropOperation > Operation = DragDropEvent . GetOperation ( ) ;
if ( ! Operation . IsValid ( ) )
{
return false ;
}
if ( Operation - > IsOfType < FCollectionDragDropOp > ( ) )
{
OutIsKnownDragOperation = true ;
return true ;
}
return false ;
}
FReply SCollectionView : : HandleDragDropOnCollectionTree ( const FGeometry & Geometry , const FDragDropEvent & DragDropEvent )
{
// Should have already called ValidateDragDropOnCollectionTree prior to calling this...
TSharedPtr < FDragDropOperation > Operation = DragDropEvent . GetOperation ( ) ;
check ( Operation . IsValid ( ) ) ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
if ( Operation - > IsOfType < FCollectionDragDropOp > ( ) )
{
TSharedPtr < FCollectionDragDropOp > DragDropOp = StaticCastSharedPtr < FCollectionDragDropOp > ( Operation ) ;
// Reparent all of the collections in the drag drop so that they are root level items
for ( const FCollectionNameType & NewChildCollection : DragDropOp - > Collections )
{
if ( ! CollectionManagerModule . Get ( ) . ReparentCollection (
NewChildCollection . Name , NewChildCollection . Type ,
NAME_None , ECollectionShareType : : CST_All
) )
{
ContentBrowserUtils : : DisplayMessage ( CollectionManagerModule . Get ( ) . GetLastError ( ) , Geometry . GetClippingRect ( ) , SharedThis ( this ) ) ;
}
}
return FReply : : Handled ( ) ;
}
return FReply : : Unhandled ( ) ;
}
bool SCollectionView : : ValidateDragDropOnCollectionItem ( TSharedRef < FCollectionItem > CollectionItem , const FGeometry & Geometry , const FDragDropEvent & DragDropEvent , bool & OutIsKnownDragOperation )
{
OutIsKnownDragOperation = false ;
TSharedPtr < FDragDropOperation > Operation = DragDropEvent . GetOperation ( ) ;
if ( ! Operation . IsValid ( ) )
{
return false ;
}
bool bIsValidDrag = false ;
TOptional < EMouseCursor : : Type > NewDragCursor ;
if ( Operation - > IsOfType < FCollectionDragDropOp > ( ) )
{
TSharedPtr < FCollectionDragDropOp > DragDropOp = StaticCastSharedPtr < FCollectionDragDropOp > ( Operation ) ;
OutIsKnownDragOperation = true ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
bIsValidDrag = true ;
for ( const FCollectionNameType & PotentialChildCollection : DragDropOp - > Collections )
{
bIsValidDrag = CollectionManagerModule . Get ( ) . IsValidParentCollection (
PotentialChildCollection . Name , PotentialChildCollection . Type ,
CollectionItem - > CollectionName , CollectionItem - > CollectionType
) ;
if ( ! bIsValidDrag )
{
DragDropOp - > SetToolTip ( CollectionManagerModule . Get ( ) . GetLastError ( ) , FEditorStyle : : GetBrush ( TEXT ( " Graph.ConnectorFeedback.Error " ) ) ) ;
break ;
}
}
// If we are dragging over a child collection item, then this view as a whole should not be marked as dragged over
bDraggedOver = false ;
}
else if ( Operation - > IsOfType < FAssetDragDropOp > ( ) )
{
TSharedPtr < FAssetDragDropOp > DragDropOp = StaticCastSharedPtr < FAssetDragDropOp > ( Operation ) ;
OutIsKnownDragOperation = true ;
bIsValidDrag = DragDropOp - > AssetData . Num ( ) > 0 ;
}
// Set the default slashed circle if this drag is invalid and a drag operation hasn't set NewDragCursor to something custom
if ( ! bIsValidDrag & & ! NewDragCursor . IsSet ( ) )
{
NewDragCursor = EMouseCursor : : SlashedCircle ;
}
Operation - > SetCursorOverride ( NewDragCursor ) ;
return bIsValidDrag ;
}
FReply SCollectionView : : HandleDragDropOnCollectionItem ( TSharedRef < FCollectionItem > CollectionItem , const FGeometry & Geometry , const FDragDropEvent & DragDropEvent )
{
// Should have already called ValidateDragDropOnCollectionItem prior to calling this...
TSharedPtr < FDragDropOperation > Operation = DragDropEvent . GetOperation ( ) ;
check ( Operation . IsValid ( ) ) ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
if ( Operation - > IsOfType < FCollectionDragDropOp > ( ) )
{
TSharedPtr < FCollectionDragDropOp > DragDropOp = StaticCastSharedPtr < FCollectionDragDropOp > ( Operation ) ;
// Make sure our drop item is marked as expanded so that we'll be able to see the newly added children
CollectionTreePtr - > SetItemExpansion ( CollectionItem , true ) ;
// Reparent all of the collections in the drag drop so that they are our immediate children
for ( const FCollectionNameType & NewChildCollection : DragDropOp - > Collections )
{
if ( ! CollectionManagerModule . Get ( ) . ReparentCollection (
NewChildCollection . Name , NewChildCollection . Type ,
CollectionItem - > CollectionName , CollectionItem - > CollectionType
) )
{
ContentBrowserUtils : : DisplayMessage ( CollectionManagerModule . Get ( ) . GetLastError ( ) , Geometry . GetClippingRect ( ) , SharedThis ( this ) ) ;
}
}
return FReply : : Handled ( ) ;
}
else if ( Operation - > IsOfType < FAssetDragDropOp > ( ) )
{
TSharedPtr < FAssetDragDropOp > DragDropOp = StaticCastSharedPtr < FAssetDragDropOp > ( Operation ) ;
TArray < FName > ObjectPaths ;
ObjectPaths . Reserve ( DragDropOp - > AssetData . Num ( ) ) ;
for ( const FAssetData & AssetData : DragDropOp - > AssetData )
{
ObjectPaths . Add ( AssetData . ObjectPath ) ;
}
int32 NumAdded = 0 ;
FText Message ;
if ( CollectionManagerModule . Get ( ) . AddToCollection ( CollectionItem - > CollectionName , CollectionItem - > CollectionType , ObjectPaths , & NumAdded ) )
{
if ( DragDropOp - > AssetData . Num ( ) = = 1 )
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " AssetName " ) , FText : : FromName ( DragDropOp - > AssetData [ 0 ] . AssetName ) ) ;
Args . Add ( TEXT ( " CollectionName " ) , FText : : FromName ( CollectionItem - > CollectionName ) ) ;
2016-01-07 11:21:22 -05:00
Message = FText : : Format ( LOCTEXT ( " CollectionAssetAdded " , " Added {AssetName} to {CollectionName} " ) , Args ) ;
2015-06-19 07:33:02 -04:00
}
else
{
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " Number " ) , NumAdded ) ;
Args . Add ( TEXT ( " CollectionName " ) , FText : : FromName ( CollectionItem - > CollectionName ) ) ;
Message = FText : : Format ( LOCTEXT ( " CollectionAssetsAdded " , " Added {Number} asset(s) to {CollectionName} " ) , Args ) ;
}
}
else
{
Message = CollectionManagerModule . Get ( ) . GetLastError ( ) ;
}
// Added items to the collection or failed. Either way, display the message.
ContentBrowserUtils : : DisplayMessage ( Message , Geometry . GetClippingRect ( ) , SharedThis ( this ) ) ;
return FReply : : Handled ( ) ;
}
return FReply : : Unhandled ( ) ;
}
void SCollectionView : : ExpandParentItems ( const TSharedRef < FCollectionItem > & InCollectionItem )
{
for ( TSharedPtr < FCollectionItem > CollectionItemToExpand = InCollectionItem - > ParentCollection . Pin ( ) ;
CollectionItemToExpand . IsValid ( ) ;
CollectionItemToExpand = CollectionItemToExpand - > ParentCollection . Pin ( )
)
{
CollectionTreePtr - > SetItemExpansion ( CollectionItemToExpand , true ) ;
}
}
TSharedPtr < SWidget > SCollectionView : : MakeCollectionTreeContextMenu ( )
2014-03-14 14:13:41 -04:00
{
if ( ! bAllowRightClickMenu )
{
return NULL ;
}
2015-06-19 07:33:02 -04:00
return CollectionContextMenu - > MakeCollectionTreeContextMenu ( Commands ) ;
2014-03-14 14:13:41 -04:00
}
2015-05-29 13:15:40 -04:00
bool SCollectionView : : IsCollectionCheckBoxEnabled ( TSharedPtr < FCollectionItem > CollectionItem ) const
{
2015-06-01 09:29:31 -04:00
return QuickAssetManagement . IsValid ( ) & & QuickAssetManagement - > IsCollectionEnabled ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-05-29 13:15:40 -04:00
}
ECheckBoxState SCollectionView : : IsCollectionChecked ( TSharedPtr < FCollectionItem > CollectionItem ) const
{
if ( QuickAssetManagement . IsValid ( ) )
{
2015-06-01 09:29:31 -04:00
return QuickAssetManagement - > GetCollectionCheckState ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-05-29 13:15:40 -04:00
}
return ECheckBoxState : : Unchecked ;
}
void SCollectionView : : OnCollectionCheckStateChanged ( ECheckBoxState NewState , TSharedPtr < FCollectionItem > CollectionItem )
{
if ( QuickAssetManagement . IsValid ( ) )
{
switch ( NewState )
{
case ECheckBoxState : : Checked :
2015-06-01 09:29:31 -04:00
QuickAssetManagement - > AddCurrentAssetsToCollection ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-05-29 13:15:40 -04:00
break ;
case ECheckBoxState : : Unchecked :
2015-06-01 09:29:31 -04:00
QuickAssetManagement - > RemoveCurrentAssetsFromCollection ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-05-29 13:15:40 -04:00
break ;
default :
break ;
}
}
}
2014-03-14 14:13:41 -04:00
void SCollectionView : : CollectionSelectionChanged ( TSharedPtr < FCollectionItem > CollectionItem , ESelectInfo : : Type /*SelectInfo*/ )
{
if ( ShouldAllowSelectionChangedDelegate ( ) & & OnCollectionSelected . IsBound ( ) )
{
if ( CollectionItem . IsValid ( ) )
{
2015-06-01 09:29:31 -04:00
OnCollectionSelected . Execute ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2014-03-14 14:13:41 -04:00
}
else
{
OnCollectionSelected . Execute ( FCollectionNameType ( NAME_None , ECollectionShareType : : CST_All ) ) ;
}
}
}
void SCollectionView : : CollectionItemScrolledIntoView ( TSharedPtr < FCollectionItem > CollectionItem , const TSharedPtr < ITableRow > & Widget )
{
if ( CollectionItem - > bRenaming & & Widget . IsValid ( ) & & Widget - > GetContent ( ) . IsValid ( ) )
{
CollectionItem - > OnRenamedRequestEvent . Broadcast ( ) ;
}
}
2015-06-19 07:33:02 -04:00
bool SCollectionView : : IsCollectionNameReadOnly ( ) const
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
// We can't rename collections while they're being dragged
TSharedPtr < FCollectionDragDropOp > DragDropOp = CurrentCollectionDragDropOp . Pin ( ) ;
if ( DragDropOp . IsValid ( ) )
{
TArray < TSharedPtr < FCollectionItem > > SelectedCollectionItems = CollectionTreePtr - > GetSelectedItems ( ) ;
for ( const auto & SelectedCollectionItem : SelectedCollectionItems )
{
if ( DragDropOp - > Collections . Contains ( FCollectionNameType ( SelectedCollectionItem - > CollectionName , SelectedCollectionItem - > CollectionType ) ) )
{
return true ;
}
}
}
2014-03-14 14:13:41 -04:00
CollectionContextMenu - > UpdateProjectSourceControl ( ) ;
2014-04-23 18:13:40 -04:00
return ! CollectionContextMenu - > CanRenameSelectedCollections ( ) ;
2014-03-14 14:13:41 -04:00
}
bool SCollectionView : : CollectionNameChangeCommit ( const TSharedPtr < FCollectionItem > & CollectionItem , const FString & NewName , bool bChangeConfirmed , FText & OutWarningMessage )
{
2015-06-01 10:04:42 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
2014-03-14 14:13:41 -04:00
// If new name is empty, set it back to the original name
2015-06-01 09:29:31 -04:00
const FName NewNameFinal ( NewName . IsEmpty ( ) ? CollectionItem - > CollectionName : FName ( * NewName ) ) ;
2014-03-14 14:13:41 -04:00
if ( CollectionItem - > bNewCollection )
{
CollectionItem - > bNewCollection = false ;
2015-07-02 06:52:21 -04:00
// Cache this here as CreateCollection will invalidate the current parent pointer
TOptional < FCollectionNameType > NewCollectionParentKey ;
TSharedPtr < FCollectionItem > ParentCollectionItem = CollectionItem - > ParentCollection . Pin ( ) ;
if ( ParentCollectionItem . IsValid ( ) )
{
NewCollectionParentKey = FCollectionNameType ( ParentCollectionItem - > CollectionName , ParentCollectionItem - > CollectionType ) ;
}
2014-03-14 14:13:41 -04:00
2015-07-02 06:52:21 -04:00
// If we canceled the name change when creating a new asset, we want to silently remove it
2014-03-14 14:13:41 -04:00
if ( ! bChangeConfirmed )
{
2015-06-19 07:33:02 -04:00
AvailableCollections . Remove ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-06-10 13:19:26 -04:00
UpdateFilteredCollectionItems ( ) ;
2014-03-14 14:13:41 -04:00
return false ;
}
2015-07-09 09:59:51 -04:00
if ( ! CollectionManagerModule . Get ( ) . CreateCollection ( NewNameFinal , CollectionItem - > CollectionType , CollectionItem - > StorageMode ) )
2014-03-14 14:13:41 -04:00
{
// Failed to add the collection, remove it from the list
2015-06-19 07:33:02 -04:00
AvailableCollections . Remove ( FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ) ;
2015-06-10 13:19:26 -04:00
UpdateFilteredCollectionItems ( ) ;
2014-03-14 14:13:41 -04:00
OutWarningMessage = FText : : Format ( LOCTEXT ( " CreateCollectionFailed " , " Failed to create the collection. {0} " ) , CollectionManagerModule . Get ( ) . GetLastError ( ) ) ;
return false ;
}
2015-07-02 06:52:21 -04:00
2015-07-24 11:43:16 -04:00
// Since we're really adding a new collection (as our placeholder item is currently transient), we don't get a rename event from the collections manager
// We'll spoof one here that so that our placeholder tree item is updated with the final name - this will preserve its expansion and selection state
HandleCollectionRenamed (
FCollectionNameType ( CollectionItem - > CollectionName , CollectionItem - > CollectionType ) ,
FCollectionNameType ( NewNameFinal , CollectionItem - > CollectionType )
) ;
2015-07-02 06:52:21 -04:00
if ( NewCollectionParentKey . IsSet ( ) )
{
// Try and set the parent correctly (if this fails for any reason, the collection will still be added, but will just appear at the root)
2015-07-09 09:59:51 -04:00
CollectionManagerModule . Get ( ) . ReparentCollection ( NewNameFinal , CollectionItem - > CollectionType , NewCollectionParentKey - > Name , NewCollectionParentKey - > Type ) ;
}
// Notify anything that cares that this collection has been created now
if ( CollectionItem - > OnCollectionCreatedEvent . IsBound ( ) )
{
CollectionItem - > OnCollectionCreatedEvent . Execute ( FCollectionNameType ( NewNameFinal , CollectionItem - > CollectionType ) ) ;
CollectionItem - > OnCollectionCreatedEvent . Unbind ( ) ;
2015-07-02 06:52:21 -04:00
}
2014-03-14 14:13:41 -04:00
}
else
{
// If the old name is the same as the new name, just early exit here.
if ( CollectionItem - > CollectionName = = NewNameFinal )
{
return true ;
}
2015-05-21 14:47:20 -04:00
// If the new name doesn't pass our current filter, we need to clear it
2015-07-09 09:59:51 -04:00
if ( ! CollectionItemTextFilter - > PassesFilter ( FCollectionItem ( NewNameFinal , CollectionItem - > CollectionType ) ) )
2015-05-21 14:47:20 -04:00
{
SearchBoxPtr - > SetText ( FText : : GetEmpty ( ) ) ;
}
2014-03-14 14:13:41 -04:00
// Otherwise perform the rename
2015-07-09 09:59:51 -04:00
if ( ! CollectionManagerModule . Get ( ) . RenameCollection ( CollectionItem - > CollectionName , CollectionItem - > CollectionType , NewNameFinal , CollectionItem - > CollectionType ) )
2014-03-14 14:13:41 -04:00
{
// Failed to rename the collection
OutWarningMessage = FText : : Format ( LOCTEXT ( " RenameCollectionFailed " , " Failed to rename the collection. {0} " ) , CollectionManagerModule . Get ( ) . GetLastError ( ) ) ;
return false ;
}
}
// At this point CollectionItem is no longer a member of the CollectionItems list (as the list is repopulated by
// UpdateCollectionItems, which is called by a broadcast from CollectionManagerModule::RenameCollection, above).
// So search again for the item by name and type.
2015-07-09 09:59:51 -04:00
auto NewCollectionItemPtr = AvailableCollections . Find ( FCollectionNameType ( NewNameFinal , CollectionItem - > CollectionType ) ) ;
2014-03-14 14:13:41 -04:00
// Reselect the path to notify that the selection has changed
{
FScopedPreventSelectionChangedDelegate DelegatePrevention ( SharedThis ( this ) ) ;
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > ClearSelection ( ) ;
2014-03-14 14:13:41 -04:00
}
// Set the selection
if ( NewCollectionItemPtr )
{
const auto & NewCollectionItem = * NewCollectionItemPtr ;
2015-06-19 07:33:02 -04:00
CollectionTreePtr - > RequestScrollIntoView ( NewCollectionItem ) ;
CollectionTreePtr - > SetItemSelection ( NewCollectionItem , true ) ;
2014-03-14 14:13:41 -04:00
}
return true ;
}
bool SCollectionView : : CollectionVerifyRenameCommit ( const TSharedPtr < FCollectionItem > & CollectionItem , const FString & NewName , const FSlateRect & MessageAnchor , FText & OutErrorMessage )
{
// If the new name is the same as the old name, consider this to be unchanged, and accept it.
2015-07-02 12:20:22 -04:00
if ( CollectionItem - > CollectionName . ToString ( ) = = NewName )
2014-03-14 14:13:41 -04:00
{
return true ;
}
2015-06-01 10:04:42 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
2014-03-14 14:13:41 -04:00
2015-07-02 12:20:22 -04:00
if ( ! CollectionManagerModule . Get ( ) . IsValidCollectionName ( NewName , ECollectionShareType : : CST_Shared ) )
2014-03-14 14:13:41 -04:00
{
2015-07-02 12:20:22 -04:00
OutErrorMessage = CollectionManagerModule . Get ( ) . GetLastError ( ) ;
2014-03-14 14:13:41 -04:00
return false ;
}
return true ;
}
# undef LOCTEXT_NAMESPACE