53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Delegates/Delegate.h"
|
|
#include "HAL/Platform.h"
|
|
#include "Subsystems/LocalPlayerSubsystem.h"
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "CommonMessagingSubsystem.generated.h"
|
|
|
|
class FSubsystemCollectionBase;
|
|
class UCommonGameDialogDescriptor;
|
|
class UObject;
|
|
|
|
/** Possible results from a dialog */
|
|
UENUM(BlueprintType)
|
|
enum class ECommonMessagingResult : uint8
|
|
{
|
|
/** The "yes" button was pressed */
|
|
Confirmed,
|
|
/** The "no" button was pressed */
|
|
Declined,
|
|
/** The "ignore/cancel" button was pressed */
|
|
Cancelled,
|
|
/** The dialog was explicitly killed (no user input) */
|
|
Killed,
|
|
Unknown UMETA(Hidden)
|
|
};
|
|
|
|
DECLARE_DELEGATE_OneParam(FCommonMessagingResultDelegate, ECommonMessagingResult /* Result */);
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS(config = Game)
|
|
class COMMONGAME_API UCommonMessagingSubsystem : public ULocalPlayerSubsystem
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UCommonMessagingSubsystem() { }
|
|
|
|
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
|
virtual void Deinitialize() override;
|
|
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
|
|
|
|
virtual void ShowConfirmation(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback = FCommonMessagingResultDelegate());
|
|
virtual void ShowError(UCommonGameDialogDescriptor* DialogDescriptor, FCommonMessagingResultDelegate ResultCallback = FCommonMessagingResultDelegate());
|
|
|
|
private:
|
|
|
|
}; |