Files
UnrealEngineUWP/Engine/Source/Editor/LevelInstanceEditor/Private/LevelInstanceEditorMode.h
patrick enfedaque 03bb3a2f2a - Prevent 'Save Current Level As' through editor modes
- Avoid adding newly saved level if RemoveLevelFromWorld fails

#rb richard.malo, brooke.hubert
#preflight 61e1ae58076be0fc4e15ea77

#ROBOMERGE-AUTHOR: patrick.enfedaque
#ROBOMERGE-SOURCE: CL 18620036 in //UE5/Release-5.0/... via CL 18620344 via CL 18620779
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18621059 by patrick enfedaque in ue5-main branch]
2022-01-14 14:01:23 -05:00

47 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Tools/UEdMode.h"
#include "Framework/Commands/UICommandList.h"
#include "LevelInstanceEditorMode.generated.h"
UCLASS()
class ULevelInstanceEditorMode : public UEdMode
{
GENERATED_BODY()
public:
static FEditorModeID EM_LevelInstanceEditorModeId;
/** Constructor */
ULevelInstanceEditorMode();
/** Destructor */
virtual ~ULevelInstanceEditorMode();
// Begin UEdMode
virtual void Enter() override;
virtual void Exit() override;
virtual void CreateToolkit() override;
virtual bool IsCompatibleWith(FEditorModeID OtherModeID) const override { return true; }
/** Check to see if an actor can be selected in this mode - no side effects */
virtual bool IsSelectionDisallowed(AActor* InActor, bool bInSelection) const override;
/** Only accept saving on current asset */
virtual bool IsOperationSupportedForCurrentAsset(EAssetOperation InOperation) const { return InOperation == EAssetOperation::Save; }
// End UEdMode
private:
void OnPreBeginPIE(bool bSimulate);
void UpdateEngineShowFlags();
virtual void BindCommands() override;
void ExitModeCommand();
void ToggleContextRestrictionCommand();
bool IsContextRestrictionCommandEnabled() const;
bool bContextRestriction;
};