You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- World Partition support only - Property Overrides are saved as a sub-object (ULevelInstancePropertyOverrideAsset) of the LevelInstance Actor (same package) - Support for Overrides to be stored at any level of the LevelInstance hierarchy (based on root edit context) - Support for Override ActorDescs, overriden actors have override actor descs through ULevelInstanceContainerInstance/ULevelInstancePropertyOverrideContainer meaning overriden ActorDescs which will be taken into account for streaming generation - Override ActorDescs are saved as part of a FLevelInstancePropertyOverrideDesc - Add support for ActorDescs to be serialized with a base actor desc instead of a class desc - Add Level Instance Property Override Experimental setting - Remove Level Instance / Packed Level Actor Experimental setting (no longer experimental) #jira UE-191991 #rb Richard.Malo, JeanFrancois.Dube #rnx [CL 31718242 by patrick enfedaque in ue5-main branch]
116 lines
3.7 KiB
C++
116 lines
3.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "LevelInstance/ILevelInstanceEditorModule.h"
|
|
#include "PropertyEditorArchetypePolicy.h"
|
|
#include "PropertyEditorEditConstPolicy.h"
|
|
#include "Tools/Modes.h"
|
|
|
|
class AActor;
|
|
class ULevel;
|
|
enum class EMapChangeType : uint8;
|
|
|
|
/**
|
|
* The module holding all of the UI related pieces for LevelInstance management
|
|
*/
|
|
class FLevelInstanceEditorModule : public ILevelInstanceEditorModule
|
|
{
|
|
public:
|
|
virtual ~FLevelInstanceEditorModule(){}
|
|
|
|
/**
|
|
* Called right after the module DLL has been loaded and the module object has been created
|
|
*/
|
|
virtual void StartupModule();
|
|
|
|
/**
|
|
* Called before the module is unloaded, right before the module object is destroyed.
|
|
*/
|
|
virtual void ShutdownModule();
|
|
|
|
virtual void BroadcastTryExitEditorMode() override;
|
|
|
|
DECLARE_DERIVED_EVENT(FLevelInstanceEditorModule, ILevelInstanceEditorModule::FExitEditorModeEvent, FExitEditorModeEvent);
|
|
virtual FExitEditorModeEvent& OnExitEditorMode() override { return ExitEditorModeEvent; }
|
|
|
|
DECLARE_DERIVED_EVENT(FLevelInstanceEditorModule, ILevelInstanceEditorModule::FTryExitEditorModeEvent, FTryExitEditorModeEvent);
|
|
virtual FTryExitEditorModeEvent& OnTryExitEditorMode() override { return TryExitEditorModeEvent; }
|
|
|
|
virtual bool IsEditInPlaceStreamingEnabled() const override;
|
|
|
|
private:
|
|
virtual void UpdateEditorMode(bool bActivated) override;
|
|
|
|
void OnEditorModeIDChanged(const FEditorModeID& InModeID, bool bIsEnteringMode);
|
|
void OnLevelActorDeleted(AActor* Actor);
|
|
void CanMoveActorToLevel(const AActor* ActorToMove, const ULevel* DestLevel, bool& bOutCanMove);
|
|
|
|
void ExtendContextMenu();
|
|
|
|
class FPropertyEditorPolicy : public PropertyEditorPolicy::IEditConstPolicy,
|
|
public PropertyEditorPolicy::IArchetypePolicy
|
|
{
|
|
public:
|
|
FPropertyEditorPolicy(ILevelInstanceEditorModule::IPropertyOverridePolicy* InPropertyOverridePolicy)
|
|
: PropertyOverridePolicy(InPropertyOverridePolicy)
|
|
{
|
|
check(PropertyOverridePolicy);
|
|
PropertyEditorPolicy::RegisterEditConstPolicy(this);
|
|
PropertyEditorPolicy::RegisterArchetypePolicy(this);
|
|
}
|
|
|
|
virtual ~FPropertyEditorPolicy()
|
|
{
|
|
PropertyEditorPolicy::UnregisterEditConstPolicy(this);
|
|
PropertyEditorPolicy::UnregisterArchetypePolicy(this);
|
|
}
|
|
|
|
virtual UObject* GetArchetypeForObject(const UObject* Object) const override
|
|
{
|
|
return PropertyOverridePolicy->GetArchetypeForObject(Object);
|
|
}
|
|
|
|
virtual bool CanEditProperty(const FEditPropertyChain& PropertyChain, const UObject* Object) const override
|
|
{
|
|
return PropertyOverridePolicy->CanEditProperty(PropertyChain, Object);
|
|
}
|
|
|
|
virtual bool CanEditProperty(const FProperty* Property, const UObject* Object) const override
|
|
{
|
|
return PropertyOverridePolicy->CanEditProperty(Property, Object);
|
|
}
|
|
|
|
ILevelInstanceEditorModule::IPropertyOverridePolicy* PropertyOverridePolicy = nullptr;
|
|
};
|
|
|
|
TUniquePtr<FPropertyEditorPolicy> PropertyEditorPolicy;
|
|
|
|
virtual bool IsPropertyEditConst(const FEditPropertyChain& PropertyChain, UObject* Object) override
|
|
{
|
|
return PropertyEditorPolicy::IsPropertyEditConst(PropertyChain, Object);
|
|
}
|
|
|
|
virtual bool IsPropertyEditConst(const FProperty* Property, UObject* Object) override
|
|
{
|
|
return PropertyEditorPolicy::IsPropertyEditConst(Property, Object);
|
|
}
|
|
|
|
virtual UObject* GetArchetype(const UObject* Object) override
|
|
{
|
|
return PropertyEditorPolicy::GetArchetype(Object);
|
|
}
|
|
|
|
virtual void SetPropertyOverridePolicy(ILevelInstanceEditorModule::IPropertyOverridePolicy* InPropertyOverridePolicy) override
|
|
{
|
|
PropertyEditorPolicy.Reset();
|
|
if (InPropertyOverridePolicy)
|
|
{
|
|
PropertyEditorPolicy = MakeUnique<FPropertyEditorPolicy>(InPropertyOverridePolicy);
|
|
}
|
|
}
|
|
|
|
FExitEditorModeEvent ExitEditorModeEvent;
|
|
FTryExitEditorModeEvent TryExitEditorModeEvent;
|
|
};
|