You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
UMG - Open to the designer by default, add canvas if no other widgets have been added.
[CL 2108579 by Nick Darnell in Main branch]
This commit is contained in:
@@ -29,7 +29,7 @@ void FAssetTypeActions_WidgetBlueprint::OpenAssetEditor( const TArray<UObject*>&
|
||||
|
||||
TArray<UBlueprint*> Blueprints;
|
||||
Blueprints.Add(Blueprint);
|
||||
NewBlueprintEditor->InitWidgetBlueprintEditor(Mode, EditWithinLevelEditor, Blueprints, ShouldUseDataOnlyEditor(Blueprint));
|
||||
NewBlueprintEditor->InitWidgetBlueprintEditor(Mode, EditWithinLevelEditor, Blueprints, true);
|
||||
|
||||
//FBlueprintEditorModule& BlueprintEditorModule = FModuleManager::LoadModuleChecked<FBlueprintEditorModule>( "Kismet" );
|
||||
//TSharedRef< IBlueprintEditor > NewKismetEditor = BlueprintEditorModule.CreateBlueprintEditor( Mode, EditWithinLevelEditor, Blueprint, ShouldUseDataOnlyEditor(Blueprint) );
|
||||
|
||||
@@ -68,7 +68,7 @@ void SUMGEditorTree::Construct(const FArguments& InArgs, TSharedPtr<FWidgetBluep
|
||||
|
||||
BlueprintEditor.Pin()->OnSelectedWidgetsChanged.AddRaw(this, &SUMGEditorTree::OnEditorSelectionChanged);
|
||||
|
||||
RefreshTree();
|
||||
bRefreshRequested = true;
|
||||
}
|
||||
|
||||
SUMGEditorTree::~SUMGEditorTree()
|
||||
|
||||
@@ -76,6 +76,14 @@ void FWidgetBlueprintEditor::InitWidgetBlueprintEditor(const EToolkitMode::Type
|
||||
{
|
||||
InitBlueprintEditor(Mode, InitToolkitHost, InBlueprints, bShouldOpenInDefaultsMode);
|
||||
|
||||
UWidgetBlueprint* Blueprint = GetWidgetBlueprintObj();
|
||||
|
||||
// If this blueprint is empty, add a canvas panel as the root widget.
|
||||
if ( Blueprint->WidgetTree->WidgetTemplates.Num() == 0 )
|
||||
{
|
||||
Blueprint->WidgetTree->ConstructWidget<UCanvasPanel>(UCanvasPanel::StaticClass());
|
||||
}
|
||||
|
||||
UpdatePreview(GetWidgetBlueprintObj(), true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user