From 80309ea017621c18fa13afd365fc74a232dffd22 Mon Sep 17 00:00:00 2001 From: Lucas Peter Date: Wed, 18 Sep 2024 15:30:30 +0200 Subject: [PATCH] Working subsystem --- SkyPortal.uplugin | 3 ++- Source/SkyPortal/Private/SkyPortal.cpp | 13 ++----------- Source/SkyPortal/Private/SkyPortalSubsystem.cpp | 16 ++++++++++++++++ Source/SkyPortal/Public/SkyPortal.h | 9 ++------- Source/SkyPortal/Public/SkyPortalSubsystem.h | 16 ++++++++++++++++ Source/SkyPortal/SkyPortal.Build.cs | 8 +------- 6 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 Source/SkyPortal/Private/SkyPortalSubsystem.cpp create mode 100644 Source/SkyPortal/Public/SkyPortalSubsystem.h diff --git a/SkyPortal.uplugin b/SkyPortal.uplugin index c1c8075..10a316e 100644 --- a/SkyPortal.uplugin +++ b/SkyPortal.uplugin @@ -10,8 +10,9 @@ "DocsURL": "", "MarketplaceURL": "", "SupportURL": "", - "CanContainContent": false, + "CanContainContent": true, "IsBetaVersion": true, + "IsExperimentalVersion": false, "Installed": false, "Modules": [ { diff --git a/Source/SkyPortal/Private/SkyPortal.cpp b/Source/SkyPortal/Private/SkyPortal.cpp index b4e6ecd..e540ab4 100644 --- a/Source/SkyPortal/Private/SkyPortal.cpp +++ b/Source/SkyPortal/Private/SkyPortal.cpp @@ -2,28 +2,19 @@ #include "SkyPortal.h" -//TODO: Need to make a raw input viewer -//maybe even a view of the different objects detected -static const FName SkyPortalTabName("Portal Input Viewer"); - #define LOCTEXT_NAMESPACE "FSkyPortalModule" void FSkyPortalModule::StartupModule() { // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module - //SkyPortalSubsystem = GEngine->GetEngineSubsystem(); - } void FSkyPortalModule::ShutdownModule() { // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, // we call this function before unloading the module. - - } #undef LOCTEXT_NAMESPACE - -IMPLEMENT_MODULE(FSkyPortalModule, SkyPortal) - + +IMPLEMENT_MODULE(FSkyPortalModule, SkyPortal) \ No newline at end of file diff --git a/Source/SkyPortal/Private/SkyPortalSubsystem.cpp b/Source/SkyPortal/Private/SkyPortalSubsystem.cpp new file mode 100644 index 0000000..6e051df --- /dev/null +++ b/Source/SkyPortal/Private/SkyPortalSubsystem.cpp @@ -0,0 +1,16 @@ +#include "SkyPortalSubsystem.h" +#include "Engine/Engine.h" + +void USkyPortalSubsystem::Initialize(FSubsystemCollectionBase& Collection) +{ + Super::Initialize(Collection); + // Custom initialization logic + UE_LOG(LogTemp, Warning, TEXT("SkyPortalSubsystem Initialized")); +} + +void USkyPortalSubsystem::Deinitialize() +{ + // Custom cleanup logic + UE_LOG(LogTemp, Warning, TEXT("SkyPortalSubsystem Deinitialized")); + Super::Deinitialize(); +} \ No newline at end of file diff --git a/Source/SkyPortal/Public/SkyPortal.h b/Source/SkyPortal/Public/SkyPortal.h index e04c5d8..279d11e 100644 --- a/Source/SkyPortal/Public/SkyPortal.h +++ b/Source/SkyPortal/Public/SkyPortal.h @@ -1,11 +1,10 @@ // Copyright Epic Games, Inc. All Rights Reserved. -// This plugin will try to make a complete plug n play subsystem for skylanders portals #pragma once #include "CoreMinimal.h" #include "Modules/ModuleManager.h" - +#include "SkyPortalSubsystem.h" class FSkyPortalModule : public IModuleInterface { @@ -14,8 +13,4 @@ public: /** IModuleInterface implementation */ virtual void StartupModule() override; virtual void ShutdownModule() override; - -private: - -}; - +}; \ No newline at end of file diff --git a/Source/SkyPortal/Public/SkyPortalSubsystem.h b/Source/SkyPortal/Public/SkyPortalSubsystem.h new file mode 100644 index 0000000..539d36a --- /dev/null +++ b/Source/SkyPortal/Public/SkyPortalSubsystem.h @@ -0,0 +1,16 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Subsystems/EngineSubsystem.h" +#include "SkyPortalSubsystem.generated.h" + +UCLASS() +class SKYPORTAL_API USkyPortalSubsystem : public UEngineSubsystem +{ + GENERATED_BODY() + +public: + // Override initialization and deinitialization methods + virtual void Initialize(FSubsystemCollectionBase& Collection) override; + virtual void Deinitialize() override; +}; diff --git a/Source/SkyPortal/SkyPortal.Build.cs b/Source/SkyPortal/SkyPortal.Build.cs index 5c96679..532bde5 100644 --- a/Source/SkyPortal/SkyPortal.Build.cs +++ b/Source/SkyPortal/SkyPortal.Build.cs @@ -27,7 +27,7 @@ public class SkyPortal : ModuleRules { "Core", "CoreUObject", - "Engine", + "Engine" // ... add other public dependencies that you statically link with here ... } ); @@ -36,12 +36,6 @@ public class SkyPortal : ModuleRules PrivateDependencyModuleNames.AddRange( new string[] { - "Projects", - "InputCore", - "EditorSubsystem", - "EditorFramework", - "UnrealEd", - "ToolMenus", "CoreUObject", "Engine", "Slate",