2019-12-26 15:33:43 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2018-09-25 10:11:35 -04:00
|
|
|
|
|
|
|
|
#include "CompositeCurveTableEditor.h"
|
|
|
|
|
#include "PropertyEditorModule.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
|
#include "EditorReimportHandler.h"
|
|
|
|
|
#include "CurveTableEditorModule.h"
|
|
|
|
|
#include "Widgets/Docking/SDockTab.h"
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "CompositeCurveTableEditor"
|
|
|
|
|
|
|
|
|
|
const FName FCompositeCurveTableEditor::PropertiesTabId("CompositeDataTableEditor_Properties");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FCompositeCurveTableEditor::RegisterTabSpawners(const TSharedRef<class FTabManager>& InTabManager)
|
|
|
|
|
{
|
|
|
|
|
FCurveTableEditor::RegisterTabSpawners(InTabManager);
|
|
|
|
|
|
|
|
|
|
FAssetEditorToolkit::RegisterTabSpawners(InTabManager);
|
|
|
|
|
|
|
|
|
|
CreateAndRegisterPropertiesTab(InTabManager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FCompositeCurveTableEditor::UnregisterTabSpawners(const TSharedRef<class FTabManager>& InTabManager)
|
|
|
|
|
{
|
|
|
|
|
FCurveTableEditor::UnregisterTabSpawners(InTabManager);
|
|
|
|
|
|
|
|
|
|
FAssetEditorToolkit::UnregisterTabSpawners(InTabManager);
|
|
|
|
|
|
|
|
|
|
InTabManager->UnregisterTabSpawner(PropertiesTabId);
|
|
|
|
|
|
|
|
|
|
DetailsView.Reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FCompositeCurveTableEditor::CreateAndRegisterPropertiesTab(const TSharedRef<class FTabManager>& InTabManager)
|
|
|
|
|
{
|
|
|
|
|
FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
2020-11-16 08:16:15 -04:00
|
|
|
FDetailsViewArgs DetailsViewArgs;
|
2021-02-22 19:45:57 -04:00
|
|
|
DetailsViewArgs.NameAreaSettings = FDetailsViewArgs::HideNameArea;
|
2020-11-16 08:16:15 -04:00
|
|
|
|
2018-09-25 10:11:35 -04:00
|
|
|
DetailsView = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
|
|
|
|
|
|
|
|
|
|
InTabManager->RegisterTabSpawner(PropertiesTabId, FOnSpawnTab::CreateSP(this, &FCompositeCurveTableEditor::SpawnTab_Properties))
|
|
|
|
|
.SetDisplayName(LOCTEXT("PropertiesTab", "Properties"))
|
|
|
|
|
.SetGroup(WorkspaceMenuCategory.ToSharedRef());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TSharedRef<SDockTab> FCompositeCurveTableEditor::SpawnTab_Properties(const FSpawnTabArgs& Args)
|
|
|
|
|
{
|
|
|
|
|
check(Args.GetTabId().TabType == PropertiesTabId);
|
|
|
|
|
|
|
|
|
|
return SNew(SDockTab)
|
|
|
|
|
.Label(LOCTEXT("PropertiesTitle", "Properties"))
|
|
|
|
|
.TabColorScale(GetTabColorScale())
|
|
|
|
|
[
|
|
|
|
|
DetailsView.ToSharedRef()
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FCompositeCurveTableEditor::InitCurveTableEditor( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UCurveTable* Table )
|
|
|
|
|
{
|
|
|
|
|
FCurveTableEditor::InitCurveTableEditor(Mode, InitToolkitHost, Table);
|
|
|
|
|
|
|
|
|
|
if (DetailsView.IsValid())
|
|
|
|
|
{
|
|
|
|
|
// Make sure details window is pointing to our object
|
|
|
|
|
DetailsView->SetObject(GetEditingObject());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TSharedRef< FTabManager::FLayout > FCompositeCurveTableEditor::InitCurveTableLayout()
|
|
|
|
|
{
|
2021-01-06 12:07:36 -04:00
|
|
|
return FTabManager::NewLayout("Standalone_CompositeCurveTableEditor_temp_Layout3")
|
2018-09-25 10:11:35 -04:00
|
|
|
->AddArea
|
|
|
|
|
(
|
|
|
|
|
FTabManager::NewPrimaryArea()->SetOrientation(Orient_Horizontal)
|
|
|
|
|
->Split
|
|
|
|
|
(
|
|
|
|
|
FTabManager::NewSplitter()
|
|
|
|
|
->SetOrientation(Orient_Vertical)
|
|
|
|
|
->SetSizeCoefficient(0.3f)
|
|
|
|
|
->Split
|
|
|
|
|
(
|
|
|
|
|
FTabManager::NewStack()
|
|
|
|
|
->SetHideTabWell(true)
|
|
|
|
|
->AddTab(PropertiesTabId, ETabState::OpenedTab)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
->Split
|
|
|
|
|
(
|
|
|
|
|
FTabManager::NewSplitter()
|
|
|
|
|
->SetOrientation(Orient_Vertical)
|
|
|
|
|
->Split
|
|
|
|
|
(
|
|
|
|
|
FTabManager::NewStack()
|
|
|
|
|
->AddTab(CurveTableTabId, ETabState::OpenedTab)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FName FCompositeCurveTableEditor::GetToolkitFName() const
|
|
|
|
|
{
|
|
|
|
|
return FName("CompositeCurveTableEditor");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FText FCompositeCurveTableEditor::GetBaseToolkitName() const
|
|
|
|
|
{
|
|
|
|
|
return LOCTEXT( "AppLabel", "Composite CurveTable Editor" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|