You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Window menu is now sectioned and labeled based on the current editor. There's now a local workspace root member in FTabManager and a workspace category in FAssetEditorToolkit (both are FWorkspaceItem objects). Individual editors attach their local category to the tab manager's local root. Workflow app modes have their own category members that are swapped out when the mode changes.
- Finally, the AssetEditorCategory of FWorkspaceMenuStructure has been removed entirely.
- Replaced the AddMenuSeparator() call in FTabManager::PopulateSpawnerMenu_Helper() with a section of the same title as the workspace category.
- Tab spawner menu entries for the local editor now properly show the icon of the associated tab. To accomplish this it was necessary to change FWorkflowTabFactory::TabIcon to be an FSlateIcon instead of an FSlateBrush*. All factory instances have been updated accordingly.
- Added & updated lots of icons! (those missing will be TTP'd)
- The nomad tab spawner section (named "General" in the menu) has been largely compressed into the Developer Tools submenu, which has also been organized into sections for readability.
- Unreal frontend options were also moved into a context menu within the General section
- Moved all experimental tools to their own section of the Window menu. When they're no longer experimental they should register as nomads in the appropriate category
- Undo history now under Edit menu
[CL 2324285 by Dan Hertzka in Main branch]
170 lines
4.8 KiB
C++
170 lines
4.8 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "CurveTableEditorPrivatePCH.h"
|
|
|
|
#include "CurveTableEditor.h"
|
|
#include "Toolkits/IToolkitHost.h"
|
|
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "CurveTableEditor"
|
|
|
|
const FName FCurveTableEditor::CurveTableTabId( TEXT( "CurveTableEditor_CurveTable" ) );
|
|
|
|
void FCurveTableEditor::RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager)
|
|
{
|
|
WorkspaceMenuCategory = TabManager->GetLocalWorkspaceMenuRoot()->AddGroup(LOCTEXT("WorkspaceMenu_UserDefinedEnumEditor", "User-Defined Enum Editor"));
|
|
|
|
TabManager->RegisterTabSpawner( CurveTableTabId, FOnSpawnTab::CreateSP(this, &FCurveTableEditor::SpawnTab_CurveTable) )
|
|
.SetDisplayName( LOCTEXT("CurveTableTab", "Curve Table") )
|
|
.SetGroup( WorkspaceMenuCategory.ToSharedRef() );
|
|
}
|
|
|
|
void FCurveTableEditor::UnregisterTabSpawners(const TSharedRef<class FTabManager>& TabManager)
|
|
{
|
|
TabManager->UnregisterTabSpawner( CurveTableTabId );
|
|
}
|
|
|
|
FCurveTableEditor::~FCurveTableEditor()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
void FCurveTableEditor::InitCurveTableEditor( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UCurveTable* Table )
|
|
{
|
|
const TSharedRef< FTabManager::FLayout > StandaloneDefaultLayout = FTabManager::NewLayout("Standalone_CurveTableEditor_Layout")
|
|
->AddArea
|
|
(
|
|
FTabManager::NewPrimaryArea()
|
|
->Split
|
|
(
|
|
FTabManager::NewStack()
|
|
->AddTab( CurveTableTabId, ETabState::OpenedTab )
|
|
)
|
|
);
|
|
|
|
const bool bCreateDefaultStandaloneMenu = true;
|
|
const bool bCreateDefaultToolbar = false;
|
|
FAssetEditorToolkit::InitAssetEditor( Mode, InitToolkitHost, FCurveTableEditorModule::CurveTableEditorAppIdentifier, StandaloneDefaultLayout, bCreateDefaultStandaloneMenu, bCreateDefaultToolbar, Table );
|
|
|
|
FCurveTableEditorModule& CurveTableEditorModule = FModuleManager::LoadModuleChecked<FCurveTableEditorModule>( "CurveTableEditor" );
|
|
AddMenuExtender(CurveTableEditorModule.GetMenuExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
|
|
|
|
// @todo toolkit world centric editing
|
|
/*// Setup our tool's layout
|
|
if( IsWorldCentricAssetEditor() )
|
|
{
|
|
const FString TabInitializationPayload(TEXT("")); // NOTE: Payload not currently used for table properties
|
|
SpawnToolkitTab( CurveTableTabId, TabInitializationPayload, EToolkitTabSpot::Details );
|
|
}*/
|
|
|
|
// NOTE: Could fill in asset editor commands here!
|
|
}
|
|
|
|
FName FCurveTableEditor::GetToolkitFName() const
|
|
{
|
|
return FName("CurveTableEditor");
|
|
}
|
|
|
|
FText FCurveTableEditor::GetBaseToolkitName() const
|
|
{
|
|
return LOCTEXT( "AppLabel", "CurveTable Editor" );
|
|
}
|
|
|
|
|
|
FString FCurveTableEditor::GetWorldCentricTabPrefix() const
|
|
{
|
|
return LOCTEXT("WorldCentricTabPrefix", "CurveTable ").ToString();
|
|
}
|
|
|
|
|
|
FLinearColor FCurveTableEditor::GetWorldCentricTabColorScale() const
|
|
{
|
|
return FLinearColor( 0.0f, 0.0f, 0.2f, 0.5f );
|
|
}
|
|
|
|
|
|
TSharedRef<SUniformGridPanel> FCurveTableEditor::CreateGridPanel() const
|
|
{
|
|
TSharedRef<SUniformGridPanel> GridPanel = SNew(SUniformGridPanel).SlotPadding(FMargin(2.0f));
|
|
|
|
UCurveTable* Table = Cast<UCurveTable>(GetEditingObject());
|
|
if (Table != NULL)
|
|
{
|
|
int32 RowIdx = 0;
|
|
for ( auto RowIt = Table->RowMap.CreateConstIterator(); RowIt; ++RowIt )
|
|
{
|
|
const FName RowName = RowIt.Key();
|
|
const FRichCurve* RowCurve = RowIt.Value();
|
|
|
|
// Make sure this row is valid
|
|
if ( RowCurve )
|
|
{
|
|
FLinearColor RowColor = (RowIdx % 2 == 0) ? FLinearColor::Gray : FLinearColor::Black;
|
|
int32 ColumnIdx = 0;
|
|
|
|
// Row name
|
|
GridPanel->AddSlot(ColumnIdx++, RowIdx)
|
|
[
|
|
SNew(SBorder)
|
|
.Padding(1)
|
|
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
|
|
.BorderBackgroundColor(RowColor)
|
|
[
|
|
SNew(STextBlock) .Text(FText::FromName(RowName))
|
|
]
|
|
];
|
|
|
|
// Row Values
|
|
for (auto ValueIt(RowCurve->GetKeyIterator()); ValueIt; ++ValueIt)
|
|
{
|
|
GridPanel->AddSlot(ColumnIdx++, RowIdx)
|
|
[
|
|
SNew(SBorder)
|
|
.Padding(1)
|
|
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
|
|
.BorderBackgroundColor(RowColor)
|
|
[
|
|
SNew(STextBlock).Text(FText::AsNumber(ValueIt->Value))
|
|
]
|
|
];
|
|
}
|
|
|
|
RowIdx++;
|
|
}
|
|
}
|
|
}
|
|
|
|
return GridPanel;
|
|
}
|
|
|
|
|
|
TSharedRef<SDockTab> FCurveTableEditor::SpawnTab_CurveTable( const FSpawnTabArgs& Args )
|
|
{
|
|
check( Args.GetTabId().TabType == CurveTableTabId );
|
|
|
|
return SNew(SDockTab)
|
|
.Icon( FEditorStyle::GetBrush("CurveTableEditor.Tabs.Properties") )
|
|
.Label( LOCTEXT("CurveTableTitle", "Curve Table") )
|
|
.TabColorScale( GetTabColorScale() )
|
|
[
|
|
SNew(SBorder)
|
|
.Padding(2)
|
|
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
|
|
[
|
|
SNew(SScrollBox)
|
|
+ SScrollBox::Slot()
|
|
[
|
|
SNew(SBox)
|
|
.VAlign(VAlign_Top)
|
|
.HAlign(HAlign_Left)
|
|
[
|
|
CreateGridPanel()
|
|
]
|
|
]
|
|
]
|
|
];
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|