Space Plunder
Loading...
Searching...
No Matches
NotificationManager.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
10#include "NotificationManager.generated.h"
11
13class USlotWidget;
17UCLASS()
18class BASEHELPERS_API UNotificationManager : public UUserWidget, public INotificationManagerInterface
19{
20 GENERATED_BODY()
21
22public:
23 explicit UNotificationManager(const FObjectInitializer& ObjectInitializer);
24
25 virtual void AddNotificationToQueue(const FNotificationData& Data) override;
26 virtual void AddNotification(const FNotificationData& Data) override;
27 virtual void UpdateValue(const int32 IncreaseAmount, const int32 TotalValue, const FGameplayTag& HUDSlot) override;
28 virtual bool GetIsShowingNotification(FUniqueID& UniqueID) const override;
29
30 UFUNCTION(BlueprintCallable, Category="Quest System")
31 bool GetIsShowingNotification() const { return bIsShowingNotification; };
32
33protected:
34 virtual bool Initialize() override;
35 virtual void NativePreConstruct() override;
36 virtual void NativeConstruct() override;
37
38 UFUNCTION(BlueprintImplementableEvent, Category="Notifications")
39 void OnShowNotifications();
40 UFUNCTION(BlueprintImplementableEvent, Category="Notifications")
41 void OnStopNotifications();
42
43 UFUNCTION(BlueprintCallable, Category="Layout")
44 void GetSlots();
45
46 // A helper function to find the slot by tag
47 USlotWidget* FindSlotByTag(const FGameplayTag& SlotTag) const;
48
49 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|Debugging")
50 bool bDebuggingMode = false;
51
52 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|General")
53 bool bMultipleAtOnce = true;
54 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|General")
55 bool bInstant = false;
56 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|General")
57 float NextNotificationTime = 3.0f;
58 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|General")
59 float InitialNotificationDelay = 3.0f;
60 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Notifications|General")
61 float EndNotificationDelay = 5.0f;
62 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Notifications|Status")
63 TArray<FNotificationData> NotificationsQueue;
64
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Notifications|Widgets")
66 class UOverlay* NotificationOverlay = nullptr;
67 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Notifications|Widgets", meta=(BindWidget))
68 class UOverlay* SlotsOverlay = nullptr;
69
70 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Slots")
71 TMap<FGameplayTag, USlotWidget*> HUDSlots;
72
73 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Layout|Slots")
74 TMap<FGameplayTag, TSubclassOf<UUserWidget>> SlotWidgetClasses;
75
76private:
77 void ShowNotifications();
78 void AddNotification();
79 void StopNotifications();
80
81
82 bool IsValidSlot(const FGameplayTag& SlotTag) const;
83 TSubclassOf<UUserWidget> GetCustomClass(const FGameplayTag& SlotTag);
84
85
86 UPROPERTY(EditAnywhere, Category="Notifications|Widgets")
87 TSubclassOf<UUserWidget> NotificationWidgetClass;
88
89 UPROPERTY(VisibleAnywhere, Category="Notifications|Status")
90 int32 CurrentIndex = 0;
91 UPROPERTY(VisibleAnywhere, Category="Notifications|Status")
92 bool bIsShowingNotification = false;
93
94 INotificationInterface* CurrentNotification = nullptr;
95
96 UPROPERTY()
97 FTimerHandle NotificationTimerHandle;
98 UPROPERTY()
99 FTimerHandle InitialNotificationTimerHandle;
100 UPROPERTY()
101 FTimerHandle NotificationEndTimerHandle;
102
103};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition NotificationInterface.h:21
Definition NotificationManagerInterface.h:23
Definition NotificationManager.h:19
Definition SlotWidget.h:16
FGameplayTag SlotTag
Definition SlotWidget.h:22
virtual bool Initialize() override
Definition SlotWidget.cpp:10
Definition RadialWheelData.h:17
Definition BaseData.h:253