Setup SwordNGun editor module
This commit is contained in:
parent
1501e35ad7
commit
0eaaa562be
@ -8,7 +8,7 @@ public class SwordNGun : ModuleRules
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysicsCore", "UnrealEd", "AssetTools" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysicsCore"});
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
|
@ -9,6 +9,6 @@ public class SwordNGunEditorTarget : TargetRules
|
||||
{
|
||||
Type = TargetType.Editor;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V2;
|
||||
ExtraModuleNames.AddRange( new string[] { "SwordNGun" } );
|
||||
ExtraModuleNames.AddRange( new string[] { "SwordNGunEditor" } );
|
||||
}
|
||||
}
|
||||
|
23
SwordNGun/Source/SwordNGunEditor/ISNGModuleInterface.cpp
Normal file
23
SwordNGun/Source/SwordNGunEditor/ISNGModuleInterface.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Project Sword & Gun Copyright © 2021 Kevin Poretti
|
||||
|
||||
#include "ISNGModuleInterface.h"
|
||||
|
||||
void ISNGModuleInterface::StartupModule()
|
||||
{
|
||||
if(IsRunningCommandlet())
|
||||
{
|
||||
AddModuleListeners();
|
||||
for (int32 i = 0; i < ModuleListeners.Num(); i++)
|
||||
{
|
||||
ModuleListeners[i]->OnStartupModule();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ISNGModuleInterface::ShutdownModule()
|
||||
{
|
||||
for (int32 i = 0; i < ModuleListeners.Num(); i++)
|
||||
{
|
||||
ModuleListeners[i]->OnShutdownModule();
|
||||
}
|
||||
}
|
23
SwordNGun/Source/SwordNGunEditor/ISNGModuleInterface.h
Normal file
23
SwordNGun/Source/SwordNGunEditor/ISNGModuleInterface.h
Normal file
@ -0,0 +1,23 @@
|
||||
// Project Sword & Gun Copyright © 2021 Kevin Poretti
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class ISNGModuleListenerInterface
|
||||
{
|
||||
public:
|
||||
virtual void OnStartupModule() {};
|
||||
virtual void OnShutdownModule() {};
|
||||
};
|
||||
|
||||
class ISNGModuleInterface : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
virtual void AddModuleListeners() {};
|
||||
|
||||
protected:
|
||||
TArray<TSharedRef<ISNGModuleListenerInterface>> ModuleListeners;
|
||||
};
|
23
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.Build.cs
Normal file
23
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.Build.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Project Sword & Gun Copyright © 2021 Kevin Poretti
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class SwordNGunEditor : ModuleRules
|
||||
{
|
||||
public SwordNGunEditor(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "PhysicsCore", "UnrealEd", "AssetTools", "SwordNGun" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
// Uncomment if you are using Slate UI
|
||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||
|
||||
// Uncomment if you are using online features
|
||||
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
||||
|
||||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
||||
}
|
||||
}
|
18
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.cpp
Normal file
18
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "SwordNGunEditor.h"
|
||||
|
||||
IMPLEMENT_GAME_MODULE(FSwordNGunEditor, SwordNGunEditor)
|
||||
|
||||
void FSwordNGunEditor::StartupModule()
|
||||
{
|
||||
ISNGModuleInterface::StartupModule();
|
||||
}
|
||||
|
||||
void FSwordNGunEditor::ShutdownModule()
|
||||
{
|
||||
ISNGModuleInterface::ShutdownModule();
|
||||
}
|
||||
|
||||
void FSwordNGunEditor::AddModuleListeners()
|
||||
{
|
||||
// add tools later
|
||||
}
|
22
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.h
Normal file
22
SwordNGun/Source/SwordNGunEditor/SwordNGunEditor.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
#include "ISNGModuleInterface.h"
|
||||
|
||||
class FSwordNGunEditor : public ISNGModuleInterface
|
||||
{
|
||||
public:
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
virtual void AddModuleListeners() override;
|
||||
|
||||
static FSwordNGunEditor& Get()
|
||||
{
|
||||
return FModuleManager::LoadModuleChecked<FSwordNGunEditor>("SwordNGunEditor");
|
||||
}
|
||||
|
||||
static bool IsAvailable()
|
||||
{
|
||||
return FModuleManager::Get().IsModuleLoaded("SwordNGunEditor");
|
||||
}
|
||||
};
|
@ -13,6 +13,14 @@
|
||||
"CoreUObject",
|
||||
"UnrealEd"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "SwordNGunEditor",
|
||||
"Type": "Editor",
|
||||
"LoadingPhase": "PostEngineInit",
|
||||
"AdditionalDependencies": [
|
||||
"Engine"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Plugins": [
|
||||
|
Loading…
Reference in New Issue
Block a user