2019-12-26 15:33:43 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
# include "CollectionContextMenu.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 "Modules/ModuleManager.h"
# include "Framework/Application/SlateApplication.h"
# include "Textures/SlateIcon.h"
# include "Framework/Commands/UIAction.h"
# include "Framework/MultiBox/MultiBoxExtender.h"
# include "Framework/MultiBox/MultiBoxBuilder.h"
# include "Widgets/Input/SButton.h"
# include "Widgets/Colors/SColorBlock.h"
2022-05-09 13:12:28 -04:00
# include "Styling/AppStyle.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 "ISourceControlProvider.h"
2014-03-14 14:13:41 -04:00
# include "ISourceControlModule.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 "ICollectionManager.h"
# include "CollectionManagerModule.h"
# include "ContentBrowserUtils.h"
# include "CollectionViewUtils.h"
2014-03-14 14:13:41 -04:00
# 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/Colors/SColorPicker.h"
# include "Framework/Commands/GenericCommands.h"
# include "Settings/ContentBrowserSettings.h"
2014-03-14 14:13:41 -04:00
# define LOCTEXT_NAMESPACE "ContentBrowser"
2014-08-27 20:50:23 -04:00
2014-03-14 14:13:41 -04:00
FCollectionContextMenu : : FCollectionContextMenu ( const TWeakPtr < SCollectionView > & InCollectionView )
: CollectionView ( InCollectionView )
, bProjectUnderSourceControl ( false )
{
}
void FCollectionContextMenu : : BindCommands ( TSharedPtr < FUICommandList > InCommandList )
{
InCommandList - > MapAction ( FGenericCommands : : Get ( ) . Rename , FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteRenameCollection ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteRenameCollection )
) ) ;
}
2015-06-19 07:33:02 -04:00
TSharedPtr < SWidget > FCollectionContextMenu : : MakeCollectionTreeContextMenu ( TSharedPtr < FUICommandList > InCommandList )
2014-03-14 14:13:41 -04:00
{
// Get all menu extenders for this context menu from the content browser module
FContentBrowserModule & ContentBrowserModule = FModuleManager : : GetModuleChecked < FContentBrowserModule > ( TEXT ( " ContentBrowser " ) ) ;
TArray < FContentBrowserMenuExtender > MenuExtenderDelegates = ContentBrowserModule . GetAllCollectionListContextMenuExtenders ( ) ;
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 , InCommandList , MenuExtender ) ;
UpdateProjectSourceControl ( ) ;
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2014-03-14 14:13:41 -04:00
2015-07-03 13:54:34 -04:00
bool bAnyManagedBySCC = false ;
bool bAnyNeedSCCUpdate = false ;
bool bAnyNeedSave = false ;
for ( int32 CollectionIdx = 0 ; CollectionIdx < SelectedCollections . Num ( ) ; + + CollectionIdx )
{
bAnyManagedBySCC | = SelectedCollections [ CollectionIdx ] - > CollectionType ! = ECollectionShareType : : CST_Local ;
bAnyNeedSCCUpdate | = SelectedCollections [ CollectionIdx ] - > CurrentStatus = = ECollectionItemStatus : : IsOutOfDate ;
bAnyNeedSave | = SelectedCollections [ CollectionIdx ] - > CurrentStatus = = ECollectionItemStatus : : HasLocalChanges ;
if ( bAnyManagedBySCC & & bAnyNeedSCCUpdate & & bAnyNeedSave )
{
// Found collections to turn all options on, break now
break ;
}
}
2014-03-14 14:13:41 -04:00
MenuBuilder . BeginSection ( " CollectionOptions " , LOCTEXT ( " CollectionListOptionsMenuHeading " , " Collection Options " ) ) ;
{
2015-07-03 13:54:34 -04:00
const bool bHasSingleSelectedCollection = SelectedCollections . Num ( ) = = 1 ;
2015-07-09 09:59:51 -04:00
const bool bIsFirstSelectedCollectionStatic = SelectedCollections . Num ( ) > 0 & & SelectedCollections [ 0 ] - > StorageMode = = ECollectionStorageMode : : Static ;
2015-07-03 13:54:34 -04:00
2015-08-03 09:13:32 -04:00
{
TOptional < FCollectionNameType > ParentCollection ;
if ( SelectedCollections . Num ( ) > 0 )
{
ParentCollection = FCollectionNameType ( SelectedCollections [ 0 ] - > CollectionName , SelectedCollections [ 0 ] - > CollectionType ) ;
}
// New... (submenu)
MenuBuilder . AddSubMenu (
LOCTEXT ( " NewChildCollection " , " New... " ) ,
LOCTEXT ( " NewChildCollectionTooltip " , " Create child a collection. " ) ,
FNewMenuDelegate : : CreateRaw ( this , & FCollectionContextMenu : : MakeNewCollectionSubMenu , ECollectionStorageMode : : Static , SCollectionView : : FCreateCollectionPayload ( ParentCollection ) ) ,
FUIAction (
FExecuteAction ( ) ,
FCanExecuteAction : : CreateLambda ( [ = ] { return bHasSingleSelectedCollection & & bIsFirstSelectedCollectionStatic ; } )
) ,
NAME_None ,
EUserInterfaceActionType : : Button
) ;
}
2015-07-03 13:54:34 -04:00
// Rename
MenuBuilder . AddMenuEntry ( FGenericCommands : : Get ( ) . Rename , NAME_None , LOCTEXT ( " RenameCollection " , " Rename " ) , LOCTEXT ( " RenameCollectionTooltip " , " Rename this collection. " ) ) ;
// Set Share Type
MenuBuilder . AddSubMenu (
LOCTEXT ( " SetCollectionShareType " , " Set Share Type " ) ,
LOCTEXT ( " SetCollectionShareTypeTooltip " , " Change the share type of this collection. " ) ,
FNewMenuDelegate : : CreateRaw ( this , & FCollectionContextMenu : : MakeCollectionShareTypeSubMenu ) ,
FUIAction (
FExecuteAction ( ) ,
FCanExecuteAction : : CreateLambda ( [ = ] { return bHasSingleSelectedCollection ; } )
) ,
NAME_None ,
EUserInterfaceActionType : : Button
) ;
// If any colors have already been set, display color options as a sub menu
2019-10-01 20:41:42 -04:00
if ( CollectionViewUtils : : HasCustomColors ( ) & & CanExecuteColorChange ( ) )
2015-07-02 06:52:21 -04:00
{
2015-07-03 13:54:34 -04:00
// Set Color (submenu)
2015-07-02 06:52:21 -04:00
MenuBuilder . AddSubMenu (
2015-07-03 13:54:34 -04:00
LOCTEXT ( " SetColor " , " Set Color " ) ,
LOCTEXT ( " SetCollectionColorTooltip " , " Sets the color this collection should appear as. " ) ,
FNewMenuDelegate : : CreateRaw ( this , & FCollectionContextMenu : : MakeSetColorSubMenu )
2015-07-02 06:52:21 -04:00
) ;
}
2015-07-03 13:54:34 -04:00
else
2014-03-14 14:13:41 -04:00
{
2015-07-03 13:54:34 -04:00
// Set Color
MenuBuilder . AddMenuEntry (
LOCTEXT ( " SetColor " , " Set Color " ) ,
LOCTEXT ( " SetCollectionColorTooltip " , " Sets the color this collection should appear as. " ) ,
FSlateIcon ( ) ,
2019-10-01 20:41:42 -04:00
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecutePickColor ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteColorChange )
)
2015-07-03 13:54:34 -04:00
) ;
}
}
MenuBuilder . EndSection ( ) ;
2014-03-14 14:13:41 -04:00
2015-07-03 13:54:34 -04:00
if ( SelectedCollections . Num ( ) > 0 )
{
MenuBuilder . BeginSection ( " CollectionBulkOperations " , LOCTEXT ( " CollectionListBulkOperationsMenuHeading " , " Bulk Operations " ) ) ;
{
// Save
MenuBuilder . AddMenuEntry (
LOCTEXT ( " SaveCollection " , " Save " ) ,
LOCTEXT ( " SaveCollectionTooltip " , " Save this collection. " ) ,
FSlateIcon ( ) ,
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSaveCollection ) ,
FCanExecuteAction : : CreateLambda ( [ = ] { return bAnyNeedSave ; } )
)
) ;
2014-03-14 14:13:41 -04:00
// Delete
MenuBuilder . AddMenuEntry (
LOCTEXT ( " DestroyCollection " , " Delete " ) ,
LOCTEXT ( " DestroyCollectionTooltip " , " Delete this collection. " ) ,
FSlateIcon ( ) ,
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteDestroyCollection ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteDestroyCollection , bAnyManagedBySCC )
)
) ;
2014-04-23 18:13:40 -04:00
2015-07-03 13:54:34 -04:00
// Update
MenuBuilder . AddMenuEntry (
LOCTEXT ( " UpdateCollection " , " Update " ) ,
LOCTEXT ( " UpdateCollectionTooltip " , " Update this collection to make sure it's using the latest version from source control. " ) ,
FSlateIcon ( ) ,
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteUpdateCollection ) ,
FCanExecuteAction : : CreateLambda ( [ = ] { return bAnyNeedSCCUpdate ; } )
)
) ;
Copying //UE4/Dev-Editor to //UE4/Main
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2756103 on 2015/11/05 by Jamie.Dale
Implemented UFont::GetResourceSize to work correctly with the Size Map tool
Change 2756104 on 2015/11/05 by Jamie.Dale
Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font
The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text.
Change 2756105 on 2015/11/05 by Jamie.Dale
Fixed a crash when using an empty FKey property with a Data Table
FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows.
I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values).
#jira UE-22897
Change 2757015 on 2015/11/06 by Joe.Tidmarsh
SSProgressBar marquee tint. Accounts for widget color and opacity.
PR #1698
Change 2757156 on 2015/11/06 by Joe.Tidmarsh
Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor.
When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel.
* Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet.
#rb Ben.Cosh
#jira UE-20170
Change 2757181 on 2015/11/06 by Jamie.Dale
Cleaned up some duplication in UMG text widgets, and exposed the text shaping options
The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this.
The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers).
This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does
Change 2757734 on 2015/11/06 by David.Nikdel
#UE4 #Editor
- Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>.
- This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found).
#CodeReview: Matt.Kuhlenschmidt
Change 2758786 on 2015/11/09 by Joe.Tidmarsh
Border widget now correctly synchronizes padding property
#jira UE-23070
Change 2758791 on 2015/11/09 by Joe.Tidmarsh
Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138)
#jira UE-21623
#1608
#rb Simon.Tovey, Bruce.Nesbit
Change 2758813 on 2015/11/09 by Joe.Tidmarsh
UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation.
[UE-22921] [CrashReport] Parenting multiple actors under border crashes editor
#jira UE-22921
Change 2759234 on 2015/11/09 by Nick.Darnell
Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more.
#codereview Matt.Kuhlenschmidt, Bob.Tellez
Change 2760954 on 2015/11/10 by Nick.Darnell
Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do.
#jira UE-23118
Change 2761129 on 2015/11/10 by Nick.Darnell
Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet.
Change 2761391 on 2015/11/10 by Alexis.Matte
jira UE-20281 and UE-22259
Fbx scene Re-import workflow
- First draft of the reimport workflow using a reimport asset in the content browser
#codereview nick.darnell
Change 2762323 on 2015/11/11 by Alexis.Matte
fix build compilation
Change 2762407 on 2015/11/11 by Jamie.Dale
UDataTable::SaveStructData now writes out dummy data when RowStruct is null
This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again.
This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting).
#jira UE-22789
Change 2762508 on 2015/11/11 by Nick.Darnell
UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers.
Change 2763241 on 2015/11/11 by Nick.Darnell
Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes.
#jira UE-20336
2015-12-12 08:54:23 -05:00
// Refresh
MenuBuilder . AddMenuEntry (
LOCTEXT ( " RefreshCollection " , " Refresh " ) ,
LOCTEXT ( " RefreshCollectionTooltip " , " Refresh the source control status of this collection. " ) ,
FSlateIcon ( ) ,
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteRefreshCollection ) ,
FCanExecuteAction : : CreateLambda ( [ = ] { return bAnyManagedBySCC ; } )
)
) ;
2014-03-14 14:13:41 -04:00
}
2015-07-03 13:54:34 -04:00
MenuBuilder . EndSection ( ) ;
2014-03-14 14:13:41 -04:00
}
return MenuBuilder . MakeWidget ( ) ;
}
2015-07-09 09:59:51 -04:00
void FCollectionContextMenu : : MakeNewCollectionSubMenu ( FMenuBuilder & MenuBuilder , ECollectionStorageMode : : Type StorageMode , SCollectionView : : FCreateCollectionPayload InCreationPayload )
2014-03-14 14:13:41 -04:00
{
2015-07-09 09:59:51 -04:00
const FText MenuHeading = FText : : Format (
( InCreationPayload . ParentCollection . IsSet ( ) ) ? LOCTEXT ( " NewXChildCollectionMenuHeading " , " New {0} Child Collection " ) : LOCTEXT ( " NewXCollectionMenuHeading " , " New {0} Collection " ) ,
ECollectionStorageMode : : ToText ( StorageMode )
) ;
2015-07-02 06:52:21 -04:00
MenuBuilder . BeginSection ( " CollectionNewCollection " , MenuHeading ) ;
2014-03-14 14:13:41 -04:00
{
2015-07-09 09:59:51 -04:00
const bool bCanCreateSharedChildren = ! InCreationPayload . ParentCollection . IsSet ( ) | | ECollectionShareType : : IsValidChildType ( InCreationPayload . ParentCollection - > Type , ECollectionShareType : : CST_Shared ) ;
2014-03-14 14:13:41 -04:00
MenuBuilder . AddMenuEntry (
LOCTEXT ( " NewCollection_Shared " , " Shared Collection " ) ,
LOCTEXT ( " NewCollection_SharedTooltip " , " Create a collection that can be seen by anyone. " ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Shared ) ) ,
2014-03-14 14:13:41 -04:00
FUIAction (
2015-07-09 09:59:51 -04:00
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteNewCollection , ECollectionShareType : : CST_Shared , StorageMode , InCreationPayload ) ,
2015-07-02 06:52:21 -04:00
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteNewCollection , ECollectionShareType : : CST_Shared , bCanCreateSharedChildren )
2015-06-01 08:45:51 -04:00
)
2014-03-14 14:13:41 -04:00
) ;
2015-07-09 09:59:51 -04:00
const bool bCanCreatePrivateChildren = ! InCreationPayload . ParentCollection . IsSet ( ) | | ECollectionShareType : : IsValidChildType ( InCreationPayload . ParentCollection - > Type , ECollectionShareType : : CST_Private ) ;
2014-03-14 14:13:41 -04:00
MenuBuilder . AddMenuEntry (
LOCTEXT ( " NewCollection_Private " , " Private Collection " ) ,
LOCTEXT ( " NewCollection_PrivateTooltip " , " Create a collection that can only be seen by you. " ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Private ) ) ,
2014-03-14 14:13:41 -04:00
FUIAction (
2015-07-09 09:59:51 -04:00
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteNewCollection , ECollectionShareType : : CST_Private , StorageMode , InCreationPayload ) ,
2015-07-02 06:52:21 -04:00
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteNewCollection , ECollectionShareType : : CST_Private , bCanCreatePrivateChildren )
2015-06-01 08:45:51 -04:00
)
2014-03-14 14:13:41 -04:00
) ;
2015-07-09 09:59:51 -04:00
const bool bCanCreateLocalChildren = ! InCreationPayload . ParentCollection . IsSet ( ) | | ECollectionShareType : : IsValidChildType ( InCreationPayload . ParentCollection - > Type , ECollectionShareType : : CST_Local ) ;
2014-03-14 14:13:41 -04:00
MenuBuilder . AddMenuEntry (
LOCTEXT ( " NewCollection_Local " , " Local Collection " ) ,
LOCTEXT ( " NewCollection_LocalTooltip " , " Create a collection that is not in source control and can only be seen by you. " ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Local ) ) ,
2014-03-14 14:13:41 -04:00
FUIAction (
2015-07-09 09:59:51 -04:00
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteNewCollection , ECollectionShareType : : CST_Local , StorageMode , InCreationPayload ) ,
2015-07-02 06:52:21 -04:00
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteNewCollection , ECollectionShareType : : CST_Local , bCanCreateLocalChildren )
2015-06-01 08:45:51 -04:00
)
) ;
}
MenuBuilder . EndSection ( ) ;
}
2015-07-09 09:59:51 -04:00
void FCollectionContextMenu : : MakeSaveDynamicCollectionSubMenu ( FMenuBuilder & MenuBuilder , FText InSearchQuery )
{
auto OnCollectionCreated = FCollectionItem : : FCollectionCreatedEvent : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSaveDynamicCollection , InSearchQuery ) ;
// Create new root level collection
MakeNewCollectionSubMenu ( MenuBuilder , ECollectionStorageMode : : Dynamic , SCollectionView : : FCreateCollectionPayload ( OnCollectionCreated ) ) ;
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
TArray < FCollectionNameType > AvailableCollections ;
CollectionManagerModule . Get ( ) . GetCollections ( AvailableCollections ) ;
AvailableCollections . Sort ( [ ] ( const FCollectionNameType & One , const FCollectionNameType & Two ) - > bool
{
2019-04-16 07:16:12 -04:00
return One . Name . LexicalLess ( Two . Name ) ;
2015-07-09 09:59:51 -04:00
} ) ;
if ( AvailableCollections . Num ( ) > 0 )
{
MenuBuilder . BeginSection ( " CollectionReplaceCollection " , LOCTEXT ( " OverwriteDynamicCollectionMenuHeading " , " Overwrite Dynamic Collection " ) ) ;
for ( const FCollectionNameType & AvailableCollection : AvailableCollections )
{
// Never display system collections
if ( AvailableCollection . Type = = ECollectionShareType : : CST_System )
{
continue ;
}
// Can only overwrite dynamic collections
ECollectionStorageMode : : Type StorageMode = ECollectionStorageMode : : Static ;
CollectionManagerModule . Get ( ) . GetCollectionStorageMode ( AvailableCollection . Name , AvailableCollection . Type , StorageMode ) ;
if ( StorageMode ! = ECollectionStorageMode : : Dynamic )
{
continue ;
}
MenuBuilder . AddMenuEntry (
FText : : FromName ( AvailableCollection . Name ) ,
FText : : Format ( LOCTEXT ( " SaveDynamicCollection_OverwriteExistingCollectionToolTip " , " Overwrite '{0}' with the current search query " ) , FText : : FromName ( AvailableCollection . Name ) ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( AvailableCollection . Type ) ) ,
2015-07-09 09:59:51 -04:00
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSaveDynamicCollection , AvailableCollection , InSearchQuery ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteSaveDynamicCollection , AvailableCollection )
)
) ;
}
MenuBuilder . EndSection ( ) ;
}
}
2015-06-01 08:45:51 -04:00
void FCollectionContextMenu : : MakeCollectionShareTypeSubMenu ( FMenuBuilder & MenuBuilder )
{
MenuBuilder . BeginSection ( " CollectionShareType " , LOCTEXT ( " CollectionShareTypeMenuHeading " , " Collection Share Type " ) ) ;
{
MenuBuilder . AddMenuEntry (
ECollectionShareType : : ToText ( ECollectionShareType : : CST_Shared ) ,
ECollectionShareType : : GetDescription ( ECollectionShareType : : CST_Shared ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Shared ) ) ,
2015-06-01 08:45:51 -04:00
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSetCollectionShareType , ECollectionShareType : : CST_Shared ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteSetCollectionShareType , ECollectionShareType : : CST_Shared ) ,
FIsActionChecked : : CreateSP ( this , & FCollectionContextMenu : : IsSetCollectionShareTypeChecked , ECollectionShareType : : CST_Shared )
) ,
NAME_None ,
EUserInterfaceActionType : : Check
) ;
MenuBuilder . AddMenuEntry (
ECollectionShareType : : ToText ( ECollectionShareType : : CST_Private ) ,
ECollectionShareType : : GetDescription ( ECollectionShareType : : CST_Private ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Private ) ) ,
2015-06-01 08:45:51 -04:00
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSetCollectionShareType , ECollectionShareType : : CST_Private ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteSetCollectionShareType , ECollectionShareType : : CST_Private ) ,
FIsActionChecked : : CreateSP ( this , & FCollectionContextMenu : : IsSetCollectionShareTypeChecked , ECollectionShareType : : CST_Private )
) ,
NAME_None ,
EUserInterfaceActionType : : Check
) ;
MenuBuilder . AddMenuEntry (
ECollectionShareType : : ToText ( ECollectionShareType : : CST_Local ) ,
ECollectionShareType : : GetDescription ( ECollectionShareType : : CST_Local ) ,
2022-05-09 13:12:28 -04:00
FSlateIcon ( FAppStyle : : GetAppStyleSetName ( ) , ECollectionShareType : : GetIconStyleName ( ECollectionShareType : : CST_Local ) ) ,
2015-06-01 08:45:51 -04:00
FUIAction (
FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteSetCollectionShareType , ECollectionShareType : : CST_Local ) ,
FCanExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : CanExecuteSetCollectionShareType , ECollectionShareType : : CST_Local ) ,
FIsActionChecked : : CreateSP ( this , & FCollectionContextMenu : : IsSetCollectionShareTypeChecked , ECollectionShareType : : CST_Local )
) ,
NAME_None ,
EUserInterfaceActionType : : Check
2014-03-14 14:13:41 -04:00
) ;
}
MenuBuilder . EndSection ( ) ;
}
2014-04-23 18:13:40 -04:00
void FCollectionContextMenu : : MakeSetColorSubMenu ( FMenuBuilder & MenuBuilder )
{
// New Color
MenuBuilder . AddMenuEntry (
LOCTEXT ( " NewColor " , " New Color " ) ,
LOCTEXT ( " NewCollectionColorTooltip " , " Changes the color this collection should appear as. " ) ,
FSlateIcon ( ) ,
FUIAction ( FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecutePickColor ) )
) ;
// Clear Color (only required if any of the selection has one)
if ( SelectedHasCustomColors ( ) )
{
MenuBuilder . AddMenuEntry (
LOCTEXT ( " ClearColor " , " Clear Color " ) ,
LOCTEXT ( " ClearCollectionColorTooltip " , " Resets the color this collection appears as. " ) ,
FSlateIcon ( ) ,
FUIAction ( FExecuteAction : : CreateSP ( this , & FCollectionContextMenu : : ExecuteResetColor ) )
) ;
}
// Add all the custom colors the user has chosen so far
TArray < FLinearColor > CustomColors ;
if ( CollectionViewUtils : : HasCustomColors ( & CustomColors ) )
{
MenuBuilder . BeginSection ( " PathContextCustomColors " , LOCTEXT ( " CustomColorsExistingColors " , " Existing Colors " ) ) ;
{
for ( int32 ColorIndex = 0 ; ColorIndex < CustomColors . Num ( ) ; ColorIndex + + )
{
const FLinearColor & Color = CustomColors [ ColorIndex ] ;
MenuBuilder . AddWidget (
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
. Padding ( 2 , 0 , 0 , 0 )
[
SNew ( SButton )
2022-05-09 13:12:28 -04:00
. ButtonStyle ( FAppStyle : : Get ( ) , " Menu.Button " )
2014-04-23 18:13:40 -04:00
. OnClicked ( this , & FCollectionContextMenu : : OnColorClicked , Color )
[
SNew ( SColorBlock )
. Color ( Color )
. Size ( FVector2D ( 77 , 16 ) )
]
] ,
2018-09-05 01:46:04 -04:00
FText : : GetEmpty ( ) ,
2014-04-23 18:13:40 -04:00
/*bNoIndent=*/ true
) ;
}
}
MenuBuilder . EndSection ( ) ;
}
}
2014-03-14 14:13:41 -04:00
void FCollectionContextMenu : : UpdateProjectSourceControl ( )
{
// Force update of source control so that we're always showing the valid options
bProjectUnderSourceControl = false ;
if ( ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) & & FPaths : : IsProjectFilePathSet ( ) )
{
FSourceControlStatePtr SourceControlState = ISourceControlModule : : Get ( ) . GetProvider ( ) . GetState ( FPaths : : GetProjectFilePath ( ) , EStateCacheUsage : : ForceUpdate ) ;
bProjectUnderSourceControl = ( SourceControlState - > IsSourceControlled ( ) & & ! SourceControlState - > IsIgnored ( ) & & ! SourceControlState - > IsUnknown ( ) ) ;
}
}
2014-04-23 18:13:40 -04:00
bool FCollectionContextMenu : : CanRenameSelectedCollections ( ) const
{
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2014-04-23 18:13:40 -04:00
2015-06-19 07:33:02 -04:00
if ( SelectedCollections . Num ( ) = = 1 )
2014-04-23 18:13:40 -04:00
{
2015-06-19 07:33:02 -04:00
return ! ( SelectedCollections [ 0 ] - > CollectionType ! = ECollectionShareType : : CST_Local ) | | ( bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ) ;
2014-04-23 18:13:40 -04:00
}
return false ;
}
2015-07-09 09:59:51 -04:00
void FCollectionContextMenu : : ExecuteNewCollection ( ECollectionShareType : : Type CollectionType , ECollectionStorageMode : : Type StorageMode , SCollectionView : : FCreateCollectionPayload InCreationPayload )
2014-03-14 14:13:41 -04:00
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
2015-07-09 09:59:51 -04:00
CollectionView . Pin ( ) - > CreateCollectionItem ( CollectionType , StorageMode , InCreationPayload ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-01 08:45:51 -04:00
void FCollectionContextMenu : : ExecuteSetCollectionShareType ( ECollectionShareType : : Type CollectionType )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2015-06-01 08:45:51 -04:00
2015-06-19 07:33:02 -04:00
if ( ! ensure ( SelectedCollections . Num ( ) = = 1 ) )
2015-06-01 08:45:51 -04:00
{
return ;
}
2015-06-01 10:04:42 -04:00
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
2015-06-01 08:45:51 -04:00
2015-06-19 07:33:02 -04:00
CollectionManagerModule . Get ( ) . RenameCollection ( SelectedCollections [ 0 ] - > CollectionName , SelectedCollections [ 0 ] - > CollectionType , SelectedCollections [ 0 ] - > CollectionName , CollectionType ) ;
2015-06-01 08:45:51 -04:00
}
2015-07-09 09:59:51 -04:00
void FCollectionContextMenu : : ExecuteSaveDynamicCollection ( FCollectionNameType InCollection , FText InSearchQuery )
{
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
CollectionManagerModule . Get ( ) . SetDynamicQueryText ( InCollection . Name , InCollection . Type , InSearchQuery . ToString ( ) ) ;
}
2014-03-14 14:13:41 -04:00
void FCollectionContextMenu : : ExecuteRenameCollection ( )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2014-03-14 14:13:41 -04:00
2015-06-19 07:33:02 -04:00
if ( ! ensure ( SelectedCollections . Num ( ) = = 1 ) )
2014-03-14 14:13:41 -04:00
{
return ;
}
2015-06-19 07:33:02 -04:00
CollectionView . Pin ( ) - > RenameCollectionItem ( SelectedCollections [ 0 ] ) ;
2014-03-14 14:13:41 -04:00
}
2015-07-03 13:54:34 -04:00
void FCollectionContextMenu : : ExecuteUpdateCollection ( )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
for ( const auto & SelectedCollection : SelectedCollections )
{
CollectionManagerModule . Get ( ) . UpdateCollection ( SelectedCollection - > CollectionName , SelectedCollection - > CollectionType ) ;
}
}
Copying //UE4/Dev-Editor to //UE4/Main
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2756103 on 2015/11/05 by Jamie.Dale
Implemented UFont::GetResourceSize to work correctly with the Size Map tool
Change 2756104 on 2015/11/05 by Jamie.Dale
Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font
The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text.
Change 2756105 on 2015/11/05 by Jamie.Dale
Fixed a crash when using an empty FKey property with a Data Table
FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows.
I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values).
#jira UE-22897
Change 2757015 on 2015/11/06 by Joe.Tidmarsh
SSProgressBar marquee tint. Accounts for widget color and opacity.
PR #1698
Change 2757156 on 2015/11/06 by Joe.Tidmarsh
Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor.
When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel.
* Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet.
#rb Ben.Cosh
#jira UE-20170
Change 2757181 on 2015/11/06 by Jamie.Dale
Cleaned up some duplication in UMG text widgets, and exposed the text shaping options
The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this.
The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers).
This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does
Change 2757734 on 2015/11/06 by David.Nikdel
#UE4 #Editor
- Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>.
- This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found).
#CodeReview: Matt.Kuhlenschmidt
Change 2758786 on 2015/11/09 by Joe.Tidmarsh
Border widget now correctly synchronizes padding property
#jira UE-23070
Change 2758791 on 2015/11/09 by Joe.Tidmarsh
Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138)
#jira UE-21623
#1608
#rb Simon.Tovey, Bruce.Nesbit
Change 2758813 on 2015/11/09 by Joe.Tidmarsh
UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation.
[UE-22921] [CrashReport] Parenting multiple actors under border crashes editor
#jira UE-22921
Change 2759234 on 2015/11/09 by Nick.Darnell
Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more.
#codereview Matt.Kuhlenschmidt, Bob.Tellez
Change 2760954 on 2015/11/10 by Nick.Darnell
Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do.
#jira UE-23118
Change 2761129 on 2015/11/10 by Nick.Darnell
Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet.
Change 2761391 on 2015/11/10 by Alexis.Matte
jira UE-20281 and UE-22259
Fbx scene Re-import workflow
- First draft of the reimport workflow using a reimport asset in the content browser
#codereview nick.darnell
Change 2762323 on 2015/11/11 by Alexis.Matte
fix build compilation
Change 2762407 on 2015/11/11 by Jamie.Dale
UDataTable::SaveStructData now writes out dummy data when RowStruct is null
This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again.
This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting).
#jira UE-22789
Change 2762508 on 2015/11/11 by Nick.Darnell
UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers.
Change 2763241 on 2015/11/11 by Nick.Darnell
Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes.
#jira UE-20336
2015-12-12 08:54:23 -05:00
void FCollectionContextMenu : : ExecuteRefreshCollection ( )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
ISourceControlProvider & SourceControlProvider = ISourceControlModule : : Get ( ) . GetProvider ( ) ;
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
TArray < FString > CollectionFilesToRefresh ;
for ( const auto & SelectedCollection : SelectedCollections )
{
FCollectionStatusInfo StatusInfo ;
if ( CollectionManagerModule . Get ( ) . GetCollectionStatusInfo ( SelectedCollection - > CollectionName , SelectedCollection - > CollectionType , StatusInfo ) )
{
if ( StatusInfo . bUseSCC & & StatusInfo . SCCState . IsValid ( ) & & StatusInfo . SCCState - > IsSourceControlled ( ) )
{
// Forcing a status update will refresh the collection state
SourceControlProvider . GetState ( StatusInfo . SCCState - > GetFilename ( ) , EStateCacheUsage : : ForceUpdate ) ;
}
}
}
}
2015-07-03 13:54:34 -04:00
void FCollectionContextMenu : : ExecuteSaveCollection ( )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
FCollectionManagerModule & CollectionManagerModule = FCollectionManagerModule : : GetModule ( ) ;
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
for ( const auto & SelectedCollection : SelectedCollections )
{
CollectionManagerModule . Get ( ) . SaveCollection ( SelectedCollection - > CollectionName , SelectedCollection - > CollectionType ) ;
}
}
2014-03-14 14:13:41 -04:00
void FCollectionContextMenu : : ExecuteDestroyCollection ( )
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return ;
}
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2014-03-14 14:13:41 -04:00
FText Prompt ;
2015-06-19 07:33:02 -04:00
if ( SelectedCollections . Num ( ) = = 1 )
2014-03-14 14:13:41 -04:00
{
2015-06-19 07:33:02 -04:00
Prompt = FText : : Format ( LOCTEXT ( " CollectionDestroyConfirm_Single " , " Delete {0}? " ) , FText : : FromName ( SelectedCollections [ 0 ] - > CollectionName ) ) ;
2014-03-14 14:13:41 -04:00
}
else
{
2015-06-19 07:33:02 -04:00
Prompt = FText : : Format ( LOCTEXT ( " CollectionDestroyConfirm_Multiple " , " Delete {0} Collections? " ) , FText : : AsNumber ( SelectedCollections . Num ( ) ) ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-19 07:33:02 -04:00
FOnClicked OnYesClicked = FOnClicked : : CreateSP ( this , & FCollectionContextMenu : : ExecuteDestroyCollectionConfirmed , SelectedCollections ) ;
2014-03-14 14:13:41 -04:00
ContentBrowserUtils : : DisplayConfirmationPopup (
Prompt ,
LOCTEXT ( " CollectionDestroyConfirm_Yes " , " Delete " ) ,
LOCTEXT ( " CollectionDestroyConfirm_No " , " Cancel " ) ,
CollectionView . Pin ( ) . ToSharedRef ( ) ,
OnYesClicked ) ;
}
FReply FCollectionContextMenu : : ExecuteDestroyCollectionConfirmed ( TArray < TSharedPtr < FCollectionItem > > CollectionList )
{
2015-06-19 07:33:02 -04:00
CollectionView . Pin ( ) - > DeleteCollectionItems ( CollectionList ) ;
2014-03-14 14:13:41 -04:00
return FReply : : Handled ( ) ;
}
2014-04-23 18:13:40 -04:00
void FCollectionContextMenu : : ExecuteResetColor ( )
{
ResetColors ( ) ;
}
void FCollectionContextMenu : : ExecutePickColor ( )
{
TSharedPtr < SCollectionView > CollectionViewPtr = CollectionView . Pin ( ) ;
TArray < FCollectionNameType > SelectedCollections = CollectionViewPtr - > GetSelectedCollections ( ) ;
2019-10-01 20:41:42 -04:00
FLinearColor InitialColor = FLinearColor : : White ;
if ( SelectedCollections . Num ( ) > 0 )
2014-04-23 18:13:40 -04:00
{
2019-10-01 20:41:42 -04:00
const FCollectionNameType & SelectedCollection = SelectedCollections [ 0 ] ;
InitialColor = CollectionViewUtils : : ResolveColor ( SelectedCollection . Name , SelectedCollection . Type ) ;
2014-04-23 18:13:40 -04:00
}
2019-10-01 20:41:42 -04:00
FColorPickerArgs PickerArgs ;
PickerArgs . bIsModal = true ; // TODO: Allow live color updates via a proxy?
PickerArgs . ParentWidget = CollectionViewPtr ;
PickerArgs . InitialColorOverride = InitialColor ;
PickerArgs . OnColorCommitted . BindSP ( this , & FCollectionContextMenu : : OnColorCommitted ) ;
2014-04-23 18:13:40 -04:00
OpenColorPicker ( PickerArgs ) ;
}
2015-07-02 06:52:21 -04:00
bool FCollectionContextMenu : : CanExecuteNewCollection ( ECollectionShareType : : Type CollectionType , bool bIsValidChildType ) const
2014-03-14 14:13:41 -04:00
{
2015-07-02 06:52:21 -04:00
return bIsValidChildType & & ( CollectionType = = ECollectionShareType : : CST_Local | | ( bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ) ) ;
2014-03-14 14:13:41 -04:00
}
2015-06-01 08:45:51 -04:00
bool FCollectionContextMenu : : CanExecuteSetCollectionShareType ( ECollectionShareType : : Type CollectionType ) const
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return false ;
}
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2015-06-01 08:45:51 -04:00
2015-06-19 07:33:02 -04:00
if ( ! ensure ( SelectedCollections . Num ( ) = = 1 ) )
2015-06-01 08:45:51 -04:00
{
return false ;
}
const bool bIsSourceControlAvailable = bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ;
2015-06-19 07:33:02 -04:00
const bool bIsCurrentTypeLocal = SelectedCollections [ 0 ] - > CollectionType = = ECollectionShareType : : CST_Local ;
2015-06-01 08:45:51 -04:00
const bool bIsNewTypeLocal = CollectionType = = ECollectionShareType : : CST_Local ;
2015-06-19 07:33:02 -04:00
const bool bIsNewShareTypeDifferent = SelectedCollections [ 0 ] - > CollectionType ! = CollectionType ;
2015-06-01 08:45:51 -04:00
return bIsNewShareTypeDifferent & & ( ( bIsCurrentTypeLocal & & bIsNewTypeLocal ) | | bIsSourceControlAvailable ) ;
}
bool FCollectionContextMenu : : IsSetCollectionShareTypeChecked ( ECollectionShareType : : Type CollectionType ) const
{
if ( ! ensure ( CollectionView . IsValid ( ) ) )
{
return false ;
}
2015-06-19 07:33:02 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
2015-06-01 08:45:51 -04:00
2015-06-19 07:33:02 -04:00
if ( ! ensure ( SelectedCollections . Num ( ) = = 1 ) )
2015-06-01 08:45:51 -04:00
{
return false ;
}
2015-06-19 07:33:02 -04:00
return SelectedCollections [ 0 ] - > CollectionType = = CollectionType ;
2015-06-01 08:45:51 -04:00
}
2015-07-09 09:59:51 -04:00
bool FCollectionContextMenu : : CanExecuteSaveDynamicCollection ( FCollectionNameType InCollection ) const
{
return InCollection . Type = = ECollectionShareType : : CST_Local | | ( bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ) ;
}
2014-03-14 14:13:41 -04:00
bool FCollectionContextMenu : : CanExecuteRenameCollection ( ) const
{
2014-04-23 18:13:40 -04:00
return CanRenameSelectedCollections ( ) ;
2014-03-14 14:13:41 -04:00
}
bool FCollectionContextMenu : : CanExecuteDestroyCollection ( bool bAnyManagedBySCC ) const
{
return ! bAnyManagedBySCC | | ( bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ) ;
}
2014-04-23 18:13:40 -04:00
bool FCollectionContextMenu : : SelectedHasCustomColors ( ) const
{
TSharedPtr < SCollectionView > CollectionViewPtr = CollectionView . Pin ( ) ;
TArray < FCollectionNameType > SelectedCollections = CollectionViewPtr - > GetSelectedCollections ( ) ;
for ( const FCollectionNameType & SelectedCollection : SelectedCollections )
{
// Ignore any that are the default color
2019-10-01 20:41:42 -04:00
const TOptional < FLinearColor > Color = CollectionViewUtils : : GetCustomColor ( SelectedCollection . Name , SelectedCollection . Type ) ;
if ( Color )
2014-04-23 18:13:40 -04:00
{
return true ;
}
}
return false ;
}
2019-10-01 20:41:42 -04:00
bool FCollectionContextMenu : : CanExecuteColorChange ( ) const
2014-04-23 18:13:40 -04:00
{
2019-10-01 20:41:42 -04:00
TArray < TSharedPtr < FCollectionItem > > SelectedCollections = CollectionView . Pin ( ) - > CollectionTreePtr - > GetSelectedItems ( ) ;
const bool bIsSourceControlValid = bProjectUnderSourceControl & & ISourceControlModule : : Get ( ) . IsEnabled ( ) & & ISourceControlModule : : Get ( ) . GetProvider ( ) . IsAvailable ( ) ;
2014-04-23 18:13:40 -04:00
2019-10-01 20:41:42 -04:00
bool bCanChangeColor = false ;
for ( TSharedPtr < FCollectionItem > SelectedCollection : SelectedCollections )
2014-04-23 18:13:40 -04:00
{
2019-10-01 20:41:42 -04:00
bCanChangeColor | = ( SelectedCollection - > CollectionType = = ECollectionShareType : : CST_Local | | bIsSourceControlValid ) ;
2014-04-23 18:13:40 -04:00
}
2019-10-01 20:41:42 -04:00
return bCanChangeColor ;
2014-04-23 18:13:40 -04:00
}
FReply FCollectionContextMenu : : OnColorClicked ( const FLinearColor InColor )
{
2019-10-01 20:41:42 -04:00
OnColorCommitted ( InColor ) ;
2014-04-23 18:13:40 -04:00
// Dismiss the menu here, as we can't make the 'clear' option appear if a folder has just had a color set for the first time
FSlateApplication : : Get ( ) . DismissAllMenus ( ) ;
return FReply : : Handled ( ) ;
}
2019-10-01 20:41:42 -04:00
void FCollectionContextMenu : : OnColorCommitted ( const FLinearColor InColor )
{
TSharedPtr < SCollectionView > CollectionViewPtr = CollectionView . Pin ( ) ;
TArray < FCollectionNameType > SelectedCollections = CollectionViewPtr - > GetSelectedCollections ( ) ;
// Make sure an color entry exists for all the collections, otherwise it can't save correctly
for ( const FCollectionNameType & SelectedCollection : SelectedCollections )
{
CollectionViewUtils : : SetCustomColor ( SelectedCollection . Name , SelectedCollection . Type , InColor ) ;
}
}
2014-04-23 18:13:40 -04:00
void FCollectionContextMenu : : ResetColors ( )
{
TSharedPtr < SCollectionView > CollectionViewPtr = CollectionView . Pin ( ) ;
TArray < FCollectionNameType > SelectedCollections = CollectionViewPtr - > GetSelectedCollections ( ) ;
// Clear the custom colors for all the selected collections
for ( const FCollectionNameType & SelectedCollection : SelectedCollections )
{
2019-10-01 20:41:42 -04:00
CollectionViewUtils : : SetCustomColor ( SelectedCollection . Name , SelectedCollection . Type , TOptional < FLinearColor > ( ) ) ;
2014-04-23 18:13:40 -04:00
}
}
2014-03-14 14:13:41 -04:00
# undef LOCTEXT_NAMESPACE