Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Public/LevelViewportTabContent.h
brooke hubert 5b46ca629b Fix a crash when changing layout or viewport type in Level editor viewports and running various exec commands that used typed element common actions.
#preflight 625f1a14fd255ad9e2ee4664
#Jira UE-149401
#rb lauren.barnes
#lockdown jeanmichel.dignard, cristina.riveron

#ROBOMERGE-AUTHOR: brooke.hubert
#ROBOMERGE-SOURCE: CL 19848657 in //UE5/Release-5.0/... via CL 19853509
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19855245 by brooke hubert in ue5-main branch]
2022-04-21 16:28:19 -04:00

40 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "LevelViewportLayout.h"
#include "EditorViewportTabContent.h"
class ILevelEditor;
class FEditorViewportLayout;
/**
* Represents the content in a viewport tab in the level editor.
* Each SDockTab holding viewports in the level editor contains and owns one of these.
*/
class LEVELEDITOR_API FLevelViewportTabContent : public FEditorViewportTabContent
{
public:
~FLevelViewportTabContent();
/** Starts the tab content object and creates the initial layout based on the layout string */
virtual void Initialize(AssetEditorViewportFactoryFunction Func, TSharedPtr<SDockTab> InParentTab, const FString& InLayoutString) override;
virtual void BindViewportLayoutCommands(FUICommandList& InOutCommandList, FName ViewportConfigKey) override;
protected:
virtual TSharedPtr<FEditorViewportLayout> FactoryViewportLayout(bool bIsSwitchingLayouts) override;
virtual FName GetLayoutTypeNameFromLayoutString() const override;
void OnLayoutStartChange(bool bSwitchingLayouts);
void OnLayoutChanged();
private:
void OnUIActionSetViewportConfiguration(FName InConfigurationName);
FName GetViewportTypeWithinLayout(FName InConfigKey) const;
void OnUIActionSetViewportTypeWithinLayout(FName InConfigKey, FName InLayoutType);
bool IsViewportTypeWithinLayoutEqual(FName InConfigName, FName InLayoutType) const;
bool IsViewportConfigurationChecked(FName InLayoutType) const;
};