Files
UnrealEngineUWP/Engine/Source/Editor/BspMode/Private/BspModeModule.cpp

101 lines
4.3 KiB
C++
Raw Normal View History

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "BspModeModule.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "Modules/ModuleManager.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Textures/SlateIcon.h"
#include "EditorStyleSet.h"
#include "Engine/BrushBuilder.h"
#include "Builders/ConeBuilder.h"
#include "Builders/CubeBuilder.h"
#include "Builders/CurvedStairBuilder.h"
#include "Builders/CylinderBuilder.h"
#include "Builders/LinearStairBuilder.h"
#include "Builders/SpiralStairBuilder.h"
#include "Builders/TetrahedronBuilder.h"
#include "Widgets/SWidget.h"
#include "EditorModeRegistry.h"
#include "EditorModes.h"
#include "BspModeStyle.h"
#include "BspMode.h"
#include "SBspPalette.h"
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) ========================== MAJOR FEATURES + CHANGES ========================== Change 2800717 on 2015/12/11 by Max.Chen Sequencer: Sort the key times for drawing to fix path trajectory. #jira UE-24331 Change 2803299 on 2015/12/15 by Max.Chen Sequencer: Fix property names so that they're the display names. For example, "DepthOfFieldFStop" now reads as "Aperture F Stop" Change 2804586 on 2015/12/15 by Max.Chen Sequencer: Add zoom in/out with shortcuts underscore and equals. Change 2811823 on 2015/12/23 by Max.Preussner Editor: Added UI action for creating new content browser folders; code cleanup; removed dead code Based on GitHub PR #1809 by artemavrin (https://github.com/EpicGames/UnrealEngine/pull/1809) #github: 1809 Change 2811839 on 2015/12/23 by Max.Preussner StereoPanorama: Code cleanup pass Based on GitHub PR# 1756 by ETayrienHBO (https://github.com/EpicGames/UnrealEngine/pull/1756) Also: - NULL to nullptr - namespaced enums to enum classes - consistent whitespace, line breaks and parentheses #github: 1756 Change 2819172 on 2016/01/07 by Andrew.Rodham Sequencer: Marquee and move modes are now automatically activated based on sequencer hotspot Change 2819176 on 2016/01/07 by Andrew.Rodham Sequencer: Various cosmetic fixes - Added icons to tracks - Removed SAnimationOutlinerTreeNode dependency from FSequencerDisplayNode (to enable future customization of shot/event track etc) - Added spacer nodes between top level display nodes - Various hover states and highlights Change 2819445 on 2016/01/07 by Andrew.Rodham Sequencer: Rendering out a capture from the composition graph now renders at the correct size even if r.ScreenPercentage is not 100. #jira UE-24920 Change 2820747 on 2016/01/08 by Andrew.Rodham Sequencer: Added option to close the editor when capturing starts #jira UE-21932 Change 2827701 on 2016/01/13 by Max.Preussner Media: Updating audio track specs each frame to better support streaming media and variable streams. Change 2828465 on 2016/01/14 by Max.Preussner Media: Better visualization of unknown media durations Change 2828469 on 2016/01/14 by Max.Preussner Media: Checking URL scheme on URLs that didn't pass the file extension filter Change 2834888 on 2016/01/19 by Max.Preussner Core: TQueue modernization pass Change 2834934 on 2016/01/19 by Max.Preussner Core: Implemented TTripleBuffer for triple buffers. Change 2834950 on 2016/01/19 by Max.Preussner Core: Added unit tests for TTripleBuffer dirty flag Change 2835488 on 2016/01/20 by Max.Preussner Core: More descriptive method names, initialization constructor, unit tests for TTripleBuffer Change 2837515 on 2016/01/20 by Max.Chen Sequencer: Command line options for custom passes. Change 2837517 on 2016/01/20 by Max.Chen Sequencer: Fix crash in visibility track instance on PIE. Change 2837518 on 2016/01/20 by Max.Chen Sequencer: Add option to lock to frame rate while playing. #jira UETOOL-475 Change 2837523 on 2016/01/20 by Max.Chen Sequencer: Capture thumbnail on level sequence asset save. Change 2837527 on 2016/01/20 by Max.Chen Sequencer: Added preroll for subsequences. Refactor instance update to combine data in EMovieSceneUpdateData. #jira UE-25380 Change 2837537 on 2016/01/20 by Max.Chen Sequencer: Add sequencer transport controls back into viewports. #jira UE-25460 Change 2837561 on 2016/01/20 by Max.Chen Sequencer: Added ability to convert a possessable to a spawnable - This option is available for any root-level possessable object bindings - It will currently delete the existing possessable (we could make this behaviour optional in future) - There is currently no check to sett if the actor is possessed by subsequent sub-sequences. If this is the case, using a possessable, or externally owned spawnable would be a better bet. Change 2837565 on 2016/01/20 by Max.Chen [CL 2858958 by Max Chen in Main branch]
2016-02-08 13:35:28 -05:00
#include "IPlacementModeModule.h"
#define LOCTEXT_NAMESPACE "BspMode"
void FBspModeModule::StartupModule()
{
FBspModeStyle::Initialize();
FEditorModeRegistry::Get().RegisterMode<FBspMode>(
FBuiltinEditorModes::EM_Bsp,
NSLOCTEXT("GeometryMode", "DisplayName", "Geometry Editing"),
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BspMode", "LevelEditor.BspMode.Small"),
false, // Visible
100 // UI priority order
);
RegisterBspBuilderType(UCubeBuilder::StaticClass(), LOCTEXT("CubeBuilderName", "Box"), LOCTEXT("CubeBuilderToolTip", "Make a box brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.BoxBrush")));
RegisterBspBuilderType(UConeBuilder::StaticClass(), LOCTEXT("ConeBuilderName", "Cone"), LOCTEXT("ConeBuilderToolTip", "Make a cone brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.ConeBrush")));
RegisterBspBuilderType(UCylinderBuilder::StaticClass(), LOCTEXT("CylinderBuilderName", "Cylinder"), LOCTEXT("CylinderBuilderToolTip", "Make a cylinder brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.CylinderBrush")));
RegisterBspBuilderType(UCurvedStairBuilder::StaticClass(), LOCTEXT("CurvedStairBuilderName", "Curved Stair"), LOCTEXT("CurvedStairBuilderToolTip", "Make a curved stair brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.CurvedStairBrush")));
RegisterBspBuilderType(ULinearStairBuilder::StaticClass(), LOCTEXT("LinearStairBuilderName", "Linear Stair"), LOCTEXT("LinearStairBuilderToolTip", "Make a linear stair brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.LinearStairBrush")));
RegisterBspBuilderType(USpiralStairBuilder::StaticClass(), LOCTEXT("SpiralStairBuilderName", "Spiral Stair"), LOCTEXT("SpiralStairBuilderToolTip", "Make a spiral stair brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.SpiralStairBrush")));
RegisterBspBuilderType(UTetrahedronBuilder::StaticClass(), LOCTEXT("SphereBuilderName", "Sphere"), LOCTEXT("SphereBuilderToolTip", "Make a sphere brush"), FBspModeStyle::Get().GetBrush(TEXT("BspMode.SphereBrush")));
Copying //UE4/Dev-Sequencer to Dev-Main (//UE4/Dev-Main) ========================== MAJOR FEATURES + CHANGES ========================== Change 2800717 on 2015/12/11 by Max.Chen Sequencer: Sort the key times for drawing to fix path trajectory. #jira UE-24331 Change 2803299 on 2015/12/15 by Max.Chen Sequencer: Fix property names so that they're the display names. For example, "DepthOfFieldFStop" now reads as "Aperture F Stop" Change 2804586 on 2015/12/15 by Max.Chen Sequencer: Add zoom in/out with shortcuts underscore and equals. Change 2811823 on 2015/12/23 by Max.Preussner Editor: Added UI action for creating new content browser folders; code cleanup; removed dead code Based on GitHub PR #1809 by artemavrin (https://github.com/EpicGames/UnrealEngine/pull/1809) #github: 1809 Change 2811839 on 2015/12/23 by Max.Preussner StereoPanorama: Code cleanup pass Based on GitHub PR# 1756 by ETayrienHBO (https://github.com/EpicGames/UnrealEngine/pull/1756) Also: - NULL to nullptr - namespaced enums to enum classes - consistent whitespace, line breaks and parentheses #github: 1756 Change 2819172 on 2016/01/07 by Andrew.Rodham Sequencer: Marquee and move modes are now automatically activated based on sequencer hotspot Change 2819176 on 2016/01/07 by Andrew.Rodham Sequencer: Various cosmetic fixes - Added icons to tracks - Removed SAnimationOutlinerTreeNode dependency from FSequencerDisplayNode (to enable future customization of shot/event track etc) - Added spacer nodes between top level display nodes - Various hover states and highlights Change 2819445 on 2016/01/07 by Andrew.Rodham Sequencer: Rendering out a capture from the composition graph now renders at the correct size even if r.ScreenPercentage is not 100. #jira UE-24920 Change 2820747 on 2016/01/08 by Andrew.Rodham Sequencer: Added option to close the editor when capturing starts #jira UE-21932 Change 2827701 on 2016/01/13 by Max.Preussner Media: Updating audio track specs each frame to better support streaming media and variable streams. Change 2828465 on 2016/01/14 by Max.Preussner Media: Better visualization of unknown media durations Change 2828469 on 2016/01/14 by Max.Preussner Media: Checking URL scheme on URLs that didn't pass the file extension filter Change 2834888 on 2016/01/19 by Max.Preussner Core: TQueue modernization pass Change 2834934 on 2016/01/19 by Max.Preussner Core: Implemented TTripleBuffer for triple buffers. Change 2834950 on 2016/01/19 by Max.Preussner Core: Added unit tests for TTripleBuffer dirty flag Change 2835488 on 2016/01/20 by Max.Preussner Core: More descriptive method names, initialization constructor, unit tests for TTripleBuffer Change 2837515 on 2016/01/20 by Max.Chen Sequencer: Command line options for custom passes. Change 2837517 on 2016/01/20 by Max.Chen Sequencer: Fix crash in visibility track instance on PIE. Change 2837518 on 2016/01/20 by Max.Chen Sequencer: Add option to lock to frame rate while playing. #jira UETOOL-475 Change 2837523 on 2016/01/20 by Max.Chen Sequencer: Capture thumbnail on level sequence asset save. Change 2837527 on 2016/01/20 by Max.Chen Sequencer: Added preroll for subsequences. Refactor instance update to combine data in EMovieSceneUpdateData. #jira UE-25380 Change 2837537 on 2016/01/20 by Max.Chen Sequencer: Add sequencer transport controls back into viewports. #jira UE-25460 Change 2837561 on 2016/01/20 by Max.Chen Sequencer: Added ability to convert a possessable to a spawnable - This option is available for any root-level possessable object bindings - It will currently delete the existing possessable (we could make this behaviour optional in future) - There is currently no check to sett if the actor is possessed by subsequent sub-sequences. If this is the case, using a possessable, or externally owned spawnable would be a better bet. Change 2837565 on 2016/01/20 by Max.Chen [CL 2858958 by Max Chen in Main branch]
2016-02-08 13:35:28 -05:00
IPlacementModeModule& PlacementModeModule = IPlacementModeModule::Get();
FPlacementCategoryInfo CategoryInfo(LOCTEXT("PlacementMode_Geometry", "Geometry"), "Geometry", TEXT("PMGeometry"), 35);
CategoryInfo.CustomGenerator = []() -> TSharedRef<SWidget> { return SNew(SBspPalette); };
PlacementModeModule.RegisterPlacementCategory(CategoryInfo);
}
void FBspModeModule::ShutdownModule()
{
FEditorModeRegistry::Get().UnregisterMode( FBuiltinEditorModes::EM_Bsp );
BspBuilderTypes.Empty();
}
void FBspModeModule::RegisterBspBuilderType( class UClass* InBuilderClass, const FText& InBuilderName, const FText& InBuilderTooltip, const FSlateBrush* InBuilderIcon )
{
check(InBuilderClass->IsChildOf(UBrushBuilder::StaticClass()));
BspBuilderTypes.Add(MakeShareable(new FBspBuilderType(InBuilderClass, InBuilderName, InBuilderTooltip, InBuilderIcon)));
}
void FBspModeModule::UnregisterBspBuilderType( class UClass* InBuilderClass )
{
BspBuilderTypes.RemoveAll(
[InBuilderClass] ( const TSharedPtr<FBspBuilderType>& RemovalCandidate ) -> bool
{
return (RemovalCandidate->BuilderClass == InBuilderClass);
}
);
}
const TArray< TSharedPtr<FBspBuilderType> >& FBspModeModule::GetBspBuilderTypes()
{
return BspBuilderTypes;
}
TSharedPtr<FBspBuilderType> FBspModeModule::FindBspBuilderType(UClass* InBuilderClass) const
{
const TSharedPtr<FBspBuilderType>* FoundBuilder = BspBuilderTypes.FindByPredicate(
[InBuilderClass] ( const TSharedPtr<FBspBuilderType>& FindCandidate ) -> bool
{
return (FindCandidate->BuilderClass == InBuilderClass);
}
);
return FoundBuilder != nullptr ? *FoundBuilder : TSharedPtr<FBspBuilderType>();
}
IMPLEMENT_MODULE( FBspModeModule, BspMode );
#undef LOCTEXT_NAMESPACE