You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
92 lines
3.1 KiB
C++
92 lines
3.1 KiB
C++
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
||
|
|
|
||
|
|
#include "AnimationBlueprintTemplateEditorMode.h"
|
||
|
|
#include "BlueprintEditorTabs.h"
|
||
|
|
#include "PersonaModule.h"
|
||
|
|
#include "SBlueprintEditorToolbar.h"
|
||
|
|
#include "ToolMenus.h"
|
||
|
|
|
||
|
|
FAnimationBlueprintTemplateEditorMode::FAnimationBlueprintTemplateEditorMode(const TSharedRef<FAnimationBlueprintEditor>& InAnimationBlueprintEditor)
|
||
|
|
: FBlueprintEditorApplicationMode(InAnimationBlueprintEditor, FAnimationBlueprintEditorModes::AnimationBlueprintTemplateEditorMode, FAnimationBlueprintEditorModes::GetLocalizedMode)
|
||
|
|
{
|
||
|
|
AnimBlueprintPtr = CastChecked<UAnimBlueprint>(InAnimationBlueprintEditor->GetBlueprintObj());
|
||
|
|
|
||
|
|
TabLayout = FTabManager::NewLayout( "Standalone_AnimationBlueprintTemplateEditMode_Layout_v1.0" )
|
||
|
|
->AddArea
|
||
|
|
(
|
||
|
|
FTabManager::NewPrimaryArea()
|
||
|
|
->SetOrientation(Orient_Vertical)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Main application area
|
||
|
|
FTabManager::NewSplitter()
|
||
|
|
->SetOrientation(Orient_Horizontal)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Left - My Blueprint
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.25f)
|
||
|
|
->AddTab(FBlueprintEditorTabs::MyBlueprintID, ETabState::OpenedTab)
|
||
|
|
)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Middle
|
||
|
|
FTabManager::NewSplitter()
|
||
|
|
->SetOrientation(Orient_Vertical)
|
||
|
|
->SetSizeCoefficient(0.55f)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Middle top - document edit area
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.8f)
|
||
|
|
->AddTab("Document", ETabState::ClosedTab)
|
||
|
|
)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Middle bottom - compiler results & find
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.2f)
|
||
|
|
->AddTab(FBlueprintEditorTabs::CompilerResultsID, ETabState::ClosedTab)
|
||
|
|
->AddTab(FBlueprintEditorTabs::FindResultsID, ETabState::ClosedTab)
|
||
|
|
)
|
||
|
|
)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
// Right top - selection details panel
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.2f)
|
||
|
|
->AddTab(FBlueprintEditorTabs::DetailsID, ETabState::OpenedTab)
|
||
|
|
)
|
||
|
|
)
|
||
|
|
);
|
||
|
|
|
||
|
|
FPersonaModule& PersonaModule = FModuleManager::LoadModuleChecked<FPersonaModule>("Persona");
|
||
|
|
|
||
|
|
ToolbarExtender = MakeShareable(new FExtender);
|
||
|
|
|
||
|
|
if (UToolMenu* Toolbar = InAnimationBlueprintEditor->RegisterModeToolbarIfUnregistered(GetModeName()))
|
||
|
|
{
|
||
|
|
InAnimationBlueprintEditor->GetToolbarBuilder()->AddCompileToolbar(Toolbar);
|
||
|
|
InAnimationBlueprintEditor->GetToolbarBuilder()->AddScriptingToolbar(Toolbar);
|
||
|
|
InAnimationBlueprintEditor->GetToolbarBuilder()->AddBlueprintGlobalOptionsToolbar(Toolbar);
|
||
|
|
InAnimationBlueprintEditor->GetToolbarBuilder()->AddDebuggingToolbar(Toolbar);
|
||
|
|
}
|
||
|
|
|
||
|
|
PersonaModule.OnRegisterTabs().Broadcast(TabFactories, InAnimationBlueprintEditor);
|
||
|
|
LayoutExtender = MakeShared<FLayoutExtender>();
|
||
|
|
PersonaModule.OnRegisterLayoutExtensions().Broadcast(*LayoutExtender.Get());
|
||
|
|
TabLayout->ProcessExtensions(*LayoutExtender.Get());
|
||
|
|
}
|
||
|
|
|
||
|
|
void FAnimationBlueprintTemplateEditorMode::RegisterTabFactories(TSharedPtr<FTabManager> InTabManager)
|
||
|
|
{
|
||
|
|
TSharedPtr<FBlueprintEditor> BP = MyBlueprintEditor.Pin();
|
||
|
|
|
||
|
|
BP->RegisterToolbarTab(InTabManager.ToSharedRef());
|
||
|
|
|
||
|
|
// Mode-specific setup
|
||
|
|
BP->PushTabFactories(CoreTabFactories);
|
||
|
|
BP->PushTabFactories(BlueprintEditorTabFactories);
|
||
|
|
BP->PushTabFactories(TabFactories);
|
||
|
|
}
|