void FWidgetDesignerApplicationMode::RegisterTabFactories(TSharedPtr<FTabManager> InTabManager)
{
	TSharedPtr<FWidgetBlueprintEditor> BP = GetBlueprintEditor();
	
	BP->RegisterToolbarTab(InTabManager.ToSharedRef());
	BP->PushTabFactories(TabFactories);
}
Esempio n. 2
0
    static TSharedRef<FApplicationMode> OnModeCreated(const FName ModeName, TSharedRef<FApplicationMode> InMode)
    {
        if (ModeName == FBlueprintEditorApplicationModes::BlueprintComponentsMode)
        {
            //@TODO: Bit of a lie - push GetBlueprint up, or pass in editor!
            auto LieMode = StaticCastSharedRef<FComponentsEditorModeOverride>(InMode);

            UBlueprint* BP = LieMode->GetBlueprint();
            if(	BP )
            {
                FLiveEditorManager::Get().InjectNewBlueprintEditor( LieMode->GetBlueprintEditor() );
            }
        }

        return InMode;
    }
void FWidgetGraphApplicationMode::PostActivateMode()
{
	FWidgetBlueprintApplicationMode::PostActivateMode();
	TSharedPtr<FWidgetBlueprintEditor> BP = GetBlueprintEditor();
	
	// Select associated widget variable in 'My Blueprint'.
	const TSet<FWidgetReference>& Selected = BP->GetSelectedWidgets();
	if (Selected.Num() == 1)
	{
		for (const FWidgetReference& WidgetRef : Selected)
		{
			if (WidgetRef.IsValid())
			{
				BP->SelectGraphActionItemByName(WidgetRef.GetPreview()->GetFName());
			}
		}
	}
}