You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
CL# 15481362 changed the behavior of ObjectsUseNameArea so that the object name was visible, and upon auditing the current use of ObjectsUseNameArea it was found that all but a few cases likely intended to use HideNameArea instead. Breaking: This change also renames FDetailsViewArgs::bShowActorLabel to FDetailsViewArgs::bShowObjectLabel to reflect what it actually does. #rb Brooke.Hubert #ROBOMERGE-SOURCE: CL 15496125 in //UE5/Release-5.0-EarlyAccess/... #ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668) [CL 15496134 by jamie dale in ue5-main branch]
85 lines
2.5 KiB
C++
85 lines
2.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SCurveEditorToolProperties.h"
|
|
#include "Modules/ModuleManager.h"
|
|
#include "IStructureDetailsView.h"
|
|
#include "PropertyEditorDelegates.h"
|
|
#include "PropertyEditorModule.h"
|
|
|
|
|
|
void SCurveEditorToolProperties::Construct(const FArguments& InArgs, TSharedRef<FCurveEditor> InCurveEditor, FCurveEditorToolID InToolId)
|
|
{
|
|
WeakCurveEditor = InCurveEditor;
|
|
ToolId = InToolId;
|
|
|
|
FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
FDetailsViewArgs DetailsViewArgs;
|
|
DetailsViewArgs.bAllowSearch = false;
|
|
DetailsViewArgs.bShowScrollBar = false;
|
|
DetailsViewArgs.NameAreaSettings = FDetailsViewArgs::HideNameArea;
|
|
|
|
FStructureDetailsViewArgs StructureDetailsViewArgs;
|
|
StructureDetailsViewArgs.bShowObjects = true;
|
|
StructureDetailsViewArgs.bShowAssets = true;
|
|
StructureDetailsViewArgs.bShowClasses = true;
|
|
StructureDetailsViewArgs.bShowInterfaces = true;
|
|
|
|
DetailsView = PropertyEditorModule.CreateStructureDetailView(DetailsViewArgs, StructureDetailsViewArgs, nullptr);
|
|
|
|
DetailsView->GetOnFinishedChangingPropertiesDelegate().AddSP(this, &SCurveEditorToolProperties::OnFinishedChangingProperties);
|
|
|
|
OnToolChanged(ToolId);
|
|
|
|
ChildSlot
|
|
[
|
|
DetailsView->GetWidget().ToSharedRef()
|
|
];
|
|
}
|
|
|
|
void SCurveEditorToolProperties::OnToolChanged(FCurveEditorToolID NewToolId)
|
|
{
|
|
ToolId = NewToolId;
|
|
|
|
TSharedPtr<FCurveEditor> CurveEditor = WeakCurveEditor.Pin();
|
|
|
|
if (CurveEditor)
|
|
{
|
|
TSharedPtr<FOnOptionsRefresh> OnOptionsRefreshDelegate;
|
|
if (CurveEditor->GetToolExtensions().Contains(ToolId))
|
|
{
|
|
CurveEditor->GetToolExtensions()[ToolId]->OnOptionsRefreshDelegate.AddSP(this, &SCurveEditorToolProperties::RebuildProperties);
|
|
}
|
|
}
|
|
RebuildProperties();
|
|
}
|
|
|
|
void SCurveEditorToolProperties::RebuildProperties()
|
|
{
|
|
TSharedPtr<FCurveEditor> CurveEditor = WeakCurveEditor.Pin();
|
|
if (CurveEditor)
|
|
{
|
|
TSharedPtr<FStructOnScope> ToolOptions;
|
|
if (CurveEditor->GetToolExtensions().Contains(ToolId))
|
|
{
|
|
ToolOptions = CurveEditor->GetToolExtensions()[ToolId]->GetToolOptions();
|
|
DetailsView->SetStructureData(ToolOptions);
|
|
}
|
|
else
|
|
{
|
|
ToolOptions = nullptr;
|
|
DetailsView->SetStructureData(nullptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SCurveEditorToolProperties::OnFinishedChangingProperties(const FPropertyChangedEvent& PropertyChangedEvent)
|
|
{
|
|
TSharedPtr<FCurveEditor> CurveEditor = WeakCurveEditor.Pin();
|
|
if (CurveEditor)
|
|
{
|
|
if (CurveEditor->GetCurrentTool())
|
|
{
|
|
CurveEditor->GetCurrentTool()->OnToolOptionsUpdated(PropertyChangedEvent);
|
|
}
|
|
}
|
|
} |