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:
Nick Darnell
2014-06-17 17:47:12 -04:00
committed by UnrealBot
parent 4ce27d2228
commit edfef387c3
3 changed files with 10 additions and 2 deletions

View File

@@ -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) );

View File

@@ -68,7 +68,7 @@ void SUMGEditorTree::Construct(const FArguments& InArgs, TSharedPtr<FWidgetBluep
BlueprintEditor.Pin()->OnSelectedWidgetsChanged.AddRaw(this, &SUMGEditorTree::OnEditorSelectionChanged);
RefreshTree();
bRefreshRequested = true;
}
SUMGEditorTree::~SUMGEditorTree()

View File

@@ -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);
}