Files
TG_ARPG/Plugins/CommonGame/Source/Public/GameUIManagerSubsystem.h

55 lines
1.5 KiB
C
Raw Permalink Normal View History

2023-08-28 03:38:23 +08:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Subsystems/GameInstanceSubsystem.h"
#include "UObject/SoftObjectPtr.h"
#include "GameUIManagerSubsystem.generated.h"
2025-07-15 00:36:32 +08:00
#define UE_API COMMONGAME_API
2023-08-28 03:38:23 +08:00
class FSubsystemCollectionBase;
class UCommonLocalPlayer;
class UGameUIPolicy;
class UObject;
/**
* This manager is intended to be replaced by whatever your game needs to
* actually create, so this class is abstract to prevent it from being created.
*
* If you just need the basic functionality you will start by sublcassing this
* subsystem in your own game.
*/
2025-07-15 00:36:32 +08:00
UCLASS(MinimalAPI, Abstract, config = Game)
class UGameUIManagerSubsystem : public UGameInstanceSubsystem
2023-08-28 03:38:23 +08:00
{
GENERATED_BODY()
public:
UGameUIManagerSubsystem() { }
2025-07-15 00:36:32 +08:00
UE_API virtual void Initialize(FSubsystemCollectionBase& Collection) override;
UE_API virtual void Deinitialize() override;
UE_API virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
2023-08-28 03:38:23 +08:00
const UGameUIPolicy* GetCurrentUIPolicy() const { return CurrentPolicy; }
UGameUIPolicy* GetCurrentUIPolicy() { return CurrentPolicy; }
2025-07-15 00:36:32 +08:00
UE_API virtual void NotifyPlayerAdded(UCommonLocalPlayer* LocalPlayer);
UE_API virtual void NotifyPlayerRemoved(UCommonLocalPlayer* LocalPlayer);
UE_API virtual void NotifyPlayerDestroyed(UCommonLocalPlayer* LocalPlayer);
2023-08-28 03:38:23 +08:00
protected:
2025-07-15 00:36:32 +08:00
UE_API void SwitchToPolicy(UGameUIPolicy* InPolicy);
2023-08-28 03:38:23 +08:00
private:
UPROPERTY(Transient)
TObjectPtr<UGameUIPolicy> CurrentPolicy = nullptr;
UPROPERTY(config, EditAnywhere)
TSoftClassPtr<UGameUIPolicy> DefaultUIPolicyClass;
};
2025-07-15 00:36:32 +08:00
#undef UE_API