// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Engine/EngineBaseTypes.h" #include "Widgets/SWidget.h" #include "Framework/Commands/Commands.h" #include "EditorStyleSet.h" #include "Engine/TextureStreamingTypes.h" class FUICommandList; /** * Class containing commands for editor viewport actions common to all viewports */ class UNREALED_API FEditorViewportCommands: public TCommands { public: FEditorViewportCommands(); /** Viewport pane configurations */ TSharedPtr ViewportConfig_OnePane; TSharedPtr ViewportConfig_TwoPanesH; TSharedPtr ViewportConfig_TwoPanesV; TSharedPtr ViewportConfig_ThreePanesLeft; TSharedPtr ViewportConfig_ThreePanesRight; TSharedPtr ViewportConfig_ThreePanesTop; TSharedPtr ViewportConfig_ThreePanesBottom; TSharedPtr ViewportConfig_FourPanesLeft; TSharedPtr ViewportConfig_FourPanesRight; TSharedPtr ViewportConfig_FourPanesTop; TSharedPtr ViewportConfig_FourPanesBottom; TSharedPtr ViewportConfig_FourPanes2x2; /** Changes the viewport to perspective view */ TSharedPtr Perspective; /** Changes the viewport to top view */ TSharedPtr Top; /** Changes the viewport to bottom view */ TSharedPtr Bottom; /** Changes the viewport to left view */ TSharedPtr Left; /** Changes the viewport to right view */ TSharedPtr Right; /** Changes the viewport to front view */ TSharedPtr Front; /** Changes the viewport to back view */ TSharedPtr Back; /** Rotate through viewport view options */ TSharedPtr Next; /** Changes the viewport to wireframe */ TSharedPtr WireframeMode; /** Changes the viewport to unlit mode */ TSharedPtr UnlitMode; /** Changes the viewport to lit mode */ TSharedPtr LitMode; #if RHI_RAYTRACING TSharedPtr PathTracingMode; TSharedPtr RayTracingDebugMode; #endif /** Changes the viewport to detail lighting mode */ TSharedPtr DetailLightingMode; /** Changes the viewport to reflection override mode */ TSharedPtr ReflectionOverrideMode; /** Changes the viewport to lighting only */ TSharedPtr LightingOnlyMode; /** Changes the viewport to light complextiy mode */ TSharedPtr LightComplexityMode; /** Changes the viewport to shader complexity mode */ TSharedPtr ShaderComplexityMode; /** Changes the viewport to quad overdraw mode */ TSharedPtr QuadOverdrawMode; /** Changes the viewport to shader complexity with quad overdraw mode */ TSharedPtr ShaderComplexityWithQuadOverdrawMode; /** Changes the viewport to primitive distance accuracy mode */ TSharedPtr TexStreamAccPrimitiveDistanceMode; /** Changes the viewport to mesh UV density accuracy view mode */ TSharedPtr TexStreamAccMeshUVDensityMode; TSharedPtr TexStreamAccMeshUVDensityAll; // TexStreamAccMeshUVDensityMode, but used in the view mode options menu. TSharedPtr TexStreamAccMeshUVDensitySingle[TEXSTREAM_MAX_NUM_UVCHANNELS]; /** Changes the viewport to material texture scale accuracy mode */ TSharedPtr TexStreamAccMaterialTextureScaleMode; TSharedPtr TexStreamAccMaterialTextureScaleAll; // Similar as TexStreamAccMaterialTextureScaleMode, but used in the view mode options menu. TSharedPtr TexStreamAccMaterialTextureScaleSingle[TEXSTREAM_MAX_NUM_TEXTURES_PER_MATERIAL]; TSharedPtr RequiredTextureResolutionMode; TSharedPtr RequiredTextureResolutionSingle[TEXSTREAM_MAX_NUM_TEXTURES_PER_MATERIAL]; /** Changes the viewport to stationary light overlap mode */ TSharedPtr StationaryLightOverlapMode; /** Changes the viewport to lightmap density mode */ TSharedPtr LightmapDensityMode; /** Shows the group menu item for LOD and HLOD coloration modes */ TSharedPtr GroupLODColorationMode; /** Changes the viewport to LOD index coloration mode */ TSharedPtr LODColorationMode; /** Changes the viewport to HLOD index coloration mode */ TSharedPtr HLODColorationMode; /** Changes the viewport to visualize the buffer content */ TSharedPtr VisualizeBufferMode; /** Collision Draw Mode */ TSharedPtr CollisionPawn; TSharedPtr CollisionVisibility; /** Toggles realtime rendering in the viewport */ TSharedPtr ToggleRealTime; /** Toggles showing stats in the viewport */ TSharedPtr ToggleStats; /** Toggles showing fps in the viewport */ TSharedPtr ToggleFPS; /** Allows the grid size setting to by changed by one */ TSharedPtr IncrementPositionGridSize; /** Allows the grid size setting to by changed by one */ TSharedPtr DecrementPositionGridSize; /** Allows the rotation grid size setting to by changed by one */ TSharedPtr IncrementRotationGridSize; /** Allows the rotation grid size setting to by changed by one */ TSharedPtr DecrementRotationGridSize; /** Command to capture screen */ TSharedPtr ScreenCapture; /** Captures the viewport and updates the project thumbnail png file */ TSharedPtr ScreenCaptureForProjectThumbnail; /** Translate Mode */ TSharedPtr TranslateMode; /** Rotate Mode */ TSharedPtr RotateMode; /** Scale Mode */ TSharedPtr ScaleMode; /** TranslateRotate Mode */ TSharedPtr TranslateRotateMode; /** TranslateRotate Mode */ TSharedPtr TranslateRotate2DMode; /** Shrink the level editor transform widget */ TSharedPtr ShrinkTransformWidget; /** Expand the level editor transform widget */ TSharedPtr ExpandTransformWidget; /** World relative coordinate system */ TSharedPtr RelativeCoordinateSystem_World; /** Local relative coordinate system */ TSharedPtr RelativeCoordinateSystem_Local; TSharedPtr CycleTransformGizmos; TSharedPtr CycleTransformGizmoCoordSystem; TSharedPtr FocusViewportToSelection; /** Toggle automatic exposure */ TSharedPtr ToggleAutoExposure; /** Toggle game settings exposure */ TSharedPtr ToggleInGameExposure; /** * Grid commands */ /** Enables or disables snapping to the grid when dragging objects around */ TSharedPtr LocationGridSnap; /** Enables or disables snapping to a rotational grid while rotating objects */ TSharedPtr RotationGridSnap; /** Enables or disables snapping to a 2D layer */ TSharedPtr Layer2DSnap; /** Enables or disables snapping to a scaling grid while scaling objects */ TSharedPtr ScaleGridSnap; /** Enables or disables snapping to surfaces when dragging in the viewport */ TSharedPtr SurfaceSnapping; public: /** Registers our commands with the binding system */ virtual void RegisterCommands() override; }; /** * Get the viewmode otions menu label. * * @param ViewModeIndex The current viewmode, as the options change per viewmode. * @return The label. */ UNREALED_API FText GetViewModeOptionsMenuLabel(EViewModeIndex ViewModeIndex); /** * Build the viewmode otions menu. * * @param CommandList The command list to be used with the menu builder. * @param ViewModeIndex The current viewmode, as the options change per viewmode. * @param FeatureLevel The feature level to build the option menu for. * @param ParamNameMaps A map allowing to convert from each menu index to an asset name. * @return The widget containing the viewmode options. */ UNREALED_API TSharedRef BuildViewModeOptionsMenu(TSharedPtr CommandList, EViewModeIndex ViewModeIndex, ERHIFeatureLevel::Type FeatureLevel, TMap& ParamNameMap);