Edit code for build
This commit is contained in:
parent
b5ae2b567f
commit
f89b26f6f1
@ -9,12 +9,17 @@ public class Pawn : ModuleRules {
|
|||||||
"CoreUObject",
|
"CoreUObject",
|
||||||
"Engine",
|
"Engine",
|
||||||
"InputCore",
|
"InputCore",
|
||||||
"EditorStyle",
|
|
||||||
"Slate",
|
"Slate",
|
||||||
"SlateCore",
|
"SlateCore"
|
||||||
"PropertyEditor"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||||
|
|
||||||
|
if (Target.bBuildEditor) {
|
||||||
|
PublicDependencyModuleNames.AddRange(new[] {
|
||||||
|
"EditorStyle",
|
||||||
|
"PropertyEditor"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,24 +1,9 @@
|
|||||||
#include "PawnModule.h"
|
#include "PawnModule.h"
|
||||||
|
|
||||||
#include "PropertyEditorModule.h"
|
|
||||||
#include "Interaction/PwnInteractableActor.h"
|
|
||||||
#include "Interaction/PwnInteractableActorCustomization.h"
|
|
||||||
#include "Modules/ModuleManager.h"
|
#include "Modules/ModuleManager.h"
|
||||||
|
|
||||||
IMPLEMENT_PRIMARY_GAME_MODULE(FPawnModule, Pawn, "Pawn");
|
IMPLEMENT_PRIMARY_GAME_MODULE(FPawnModule, Pawn, "Pawn");
|
||||||
|
|
||||||
void FPawnModule::StartupModule() {
|
void FPawnModule::StartupModule() {}
|
||||||
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
||||||
PropertyModule.RegisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName(),
|
|
||||||
FOnGetPropertyTypeCustomizationInstance::CreateStatic(
|
|
||||||
&UPwnInteractableActorCustomization::MakeInstance));
|
|
||||||
PropertyModule.NotifyCustomizationModuleChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FPawnModule::ShutdownModule() {
|
void FPawnModule::ShutdownModule() {}
|
||||||
if (FModuleManager::Get().IsModuleLoaded("PropertyEditor")) {
|
|
||||||
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
|
||||||
PropertyModule.UnregisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName());
|
|
||||||
PropertyModule.NotifyCustomizationModuleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "Interaction/PwnInteractableActorCustomization.h"
|
#include "PawnEditor/Customization/PwnInteractableActorCustomization.h"
|
||||||
|
|
||||||
#include "PropertyCustomizationHelpers.h"
|
#include "PropertyCustomizationHelpers.h"
|
||||||
#include "PropertyHandle.h"
|
#include "PropertyHandle.h"
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "IPropertyTypeCustomization.h"
|
#include "IPropertyTypeCustomization.h"
|
||||||
|
|
||||||
class PAWN_API UPwnInteractableActorCustomization : public IPropertyTypeCustomization {
|
class UPwnInteractableActorCustomization : public IPropertyTypeCustomization {
|
||||||
public:
|
public:
|
||||||
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
|
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
|
||||||
|
|
||||||
@ -35,7 +35,9 @@ public class PawnEditor : ModuleRules {
|
|||||||
"MainFrame",
|
"MainFrame",
|
||||||
"PropertyEditor",
|
"PropertyEditor",
|
||||||
"ComponentVisualizers",
|
"ComponentVisualizers",
|
||||||
"Pawn"
|
"EditorStyle",
|
||||||
|
"PropertyEditor",
|
||||||
|
"Pawn",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,14 +1,26 @@
|
|||||||
#include "PawnEditorModule.h"
|
#include "PawnEditorModule.h"
|
||||||
|
|
||||||
#include "PwnStyle.h"
|
#include "PwnStyle.h"
|
||||||
|
#include "Customization/PwnInteractableActorCustomization.h"
|
||||||
|
#include "Interaction/PwnInteractableActor.h"
|
||||||
#include "Modules/ModuleManager.h"
|
#include "Modules/ModuleManager.h"
|
||||||
|
|
||||||
IMPLEMENT_MODULE(FPawnEditorModule, PawnEditor)
|
IMPLEMENT_MODULE(FPawnEditorModule, PawnEditor)
|
||||||
|
|
||||||
void FPawnEditorModule::StartupModule() {
|
void FPawnEditorModule::StartupModule() {
|
||||||
FPwnStyle::Initialize();
|
FPwnStyle::Initialize();
|
||||||
|
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
||||||
|
PropertyModule.RegisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName(),
|
||||||
|
FOnGetPropertyTypeCustomizationInstance::CreateStatic(
|
||||||
|
&UPwnInteractableActorCustomization::MakeInstance));
|
||||||
|
PropertyModule.NotifyCustomizationModuleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FPawnEditorModule::ShutdownModule() {
|
void FPawnEditorModule::ShutdownModule() {
|
||||||
FPwnStyle::Shutdown();
|
FPwnStyle::Shutdown();
|
||||||
|
if (FModuleManager::Get().IsModuleLoaded("PropertyEditor")) {
|
||||||
|
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
||||||
|
PropertyModule.UnregisterCustomPropertyTypeLayout(FPwnInteractableActor::StaticStruct()->GetFName());
|
||||||
|
PropertyModule.NotifyCustomizationModuleChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user