Add DialogueSystemEditor Module for Tree Factory

This commit is contained in:
Philip W 2023-11-20 21:26:49 +00:00
parent c682f72afa
commit d736224daa
5 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,36 @@
using UnrealBuildTool;
public class DialogueSystemEditor : ModuleRules
{
public DialogueSystemEditor(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[]
{
"EndlessVendetta/DialogueSystem"
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"UnrealEd",
"GenericGraphRuntime",
"EndlessVendetta"
}
);
}
}

View File

@ -0,0 +1,17 @@
#include "DialogueSystemEditor.h"
#define LOCTEXT_NAMESPACE "FDialogueSystemEditorModule"
void FDialogueSystemEditorModule::StartupModule()
{
}
void FDialogueSystemEditorModule::ShutdownModule()
{
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FDialogueSystemEditorModule, DialogueSystemEditor)

View File

@ -0,0 +1,28 @@
#include "DialogueTreeFactory.h"
#include "DialogueTree.h"
#define LOCTEXT_NAMESPACE "DialogueSessionFactory"
UDialogueTreeFactory::UDialogueTreeFactory()
{
bCreateNew = true;
bEditAfterNew = true;
SupportedClass = UDialogueTree::StaticClass();
}
UObject* UDialogueTreeFactory::FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
return NewObject<UObject>(InParent, Class, Name, Flags | RF_Transactional);
}
FText UDialogueTreeFactory::GetDisplayName() const
{
return LOCTEXT("FactoryName", "Dialogue Tree");
}
FString UDialogueTreeFactory::GetDefaultNewAssetName() const
{
return "DialogueTree";
}
#undef LOCTEXT_NAMESPACE

View File

@ -0,0 +1,18 @@
#pragma once
#include "CoreMinimal.h"
#include "Factories/Factory.h"
#include "DialogueTreeFactory.generated.h"
UCLASS()
class UDialogueTreeFactory : public UFactory
{
GENERATED_BODY()
public:
UDialogueTreeFactory();
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
virtual FText GetDisplayName() const override;
virtual FString GetDefaultNewAssetName() const override;
};

View File

@ -0,0 +1,11 @@
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
class FDialogueSystemEditorModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};