49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
|
||
|
|
#include "DialogueEditorMode.h"
|
||
|
|
#include "DialogueAssetEditor.h"
|
||
|
|
#include "DialogueGraphTabSummoner.h"
|
||
|
|
#include "DialogueDetailsTabSummoner.h"
|
||
|
|
|
||
|
|
FDialogueEditorMode::FDialogueEditorMode(TSharedPtr<FDialogueAssetEditor> InDialogueEditor)
|
||
|
|
: FApplicationMode(TEXT("DialogueEditorMode"))
|
||
|
|
{
|
||
|
|
DialogueEditor = InDialogueEditor;
|
||
|
|
|
||
|
|
// 注册Tab工厂
|
||
|
|
TabFactories.RegisterFactory(MakeShared<FDialogueGraphTabSummoner>(InDialogueEditor));
|
||
|
|
TabFactories.RegisterFactory(MakeShared<FDialogueDetailsTabSummoner>(InDialogueEditor));
|
||
|
|
|
||
|
|
// 定义布局
|
||
|
|
TabLayout = FTabManager::NewLayout("Standalone_DialogueEditor_Layout_v1")
|
||
|
|
->AddArea
|
||
|
|
(
|
||
|
|
FTabManager::NewPrimaryArea()
|
||
|
|
->SetOrientation(Orient_Vertical)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
FTabManager::NewSplitter()
|
||
|
|
->SetOrientation(Orient_Horizontal)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.7f)
|
||
|
|
->AddTab(FName(TEXT("DialogueGraphTabId")), ETabState::OpenedTab)
|
||
|
|
)
|
||
|
|
->Split
|
||
|
|
(
|
||
|
|
FTabManager::NewStack()
|
||
|
|
->SetSizeCoefficient(0.3f)
|
||
|
|
->AddTab(FName(TEXT("DialogueDetailsTabId")), ETabState::OpenedTab)
|
||
|
|
)
|
||
|
|
)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
void FDialogueEditorMode::RegisterTabFactories(TSharedPtr<FTabManager> InTabManager)
|
||
|
|
{
|
||
|
|
TSharedPtr<FDialogueAssetEditor> Editor = DialogueEditor.Pin();
|
||
|
|
Editor->PushTabFactories(TabFactories);
|
||
|
|
FApplicationMode::RegisterTabFactories(InTabManager);
|
||
|
|
}
|