Files
UnrealEngineUWP/Engine/Source/Editor/ActorPickerMode/Public/ActorPickerMode.h
T
brooke hubert 1cab67f804 [Backout] - CL33723201
Original CL Desc
-----------------------------------------------------------------
[Mode Manager] Fix some singleton startup pattern that was allocating at incorrect timings to speculatively fix some allocate on shutdown crash(es)

Also move some of the global access to the level editor mode manager to pipe through the level editor where there were some early accessors on startup.

#jira UE-213541
#rb patrick.enfedaque ross.smith2


#p4v-cherrypick 33703049

[CL 33736118 by brooke hubert in ue5-main branch]
2024-05-17 16:28:49 -04:00

50 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
class AActor;
class FEditorModeTools;
DECLARE_DELEGATE_OneParam( FOnGetAllowedClasses, TArray<const UClass*>& );
DECLARE_DELEGATE_OneParam( FOnActorSelected, AActor* );
DECLARE_DELEGATE_RetVal_OneParam(bool, FOnShouldFilterActor, const AActor*);
/**
* Actor picker mode module
*/
class ACTORPICKERMODE_API FActorPickerModeModule : public IModuleInterface
{
public:
// IModuleInterface
virtual void StartupModule() override;
virtual void ShutdownModule() override;
// End of IModuleInterface
/**
* Enter actor picking mode (note: will cancel any current actor picking)
* @param InOnGetAllowedClasses Delegate used to only allow actors using a particular set of classes (empty to accept all actor classes; works alongside InOnShouldFilterActor)
* @param InOnShouldFilterActor Delegate used to only allow particular actors (empty to accept all actors; works alongside InOnGetAllowedClasses)
* @param InOnActorSelected Delegate to call when a valid actor is selected
*/
void BeginActorPickingMode(FOnGetAllowedClasses InOnGetAllowedClasses, FOnShouldFilterActor InOnShouldFilterActor, FOnActorSelected InOnActorSelected) const;
/** Exit actor picking mode */
void EndActorPickingMode() const;
/** @return Whether or not actor picking mode is currently active */
bool IsInActorPickingMode() const;
private:
/** Handler for when the application is deactivated. */
void OnApplicationDeactivated(const bool IsActive) const;
static FEditorModeTools* GetLevelEditorModeManager();
private:
FDelegateHandle OnApplicationDeactivatedHandle;
};