Space Plunder
Loading...
Searching...
No Matches
LayerWidget.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 "CommonUserWidget.h"
8#include "LayerWidget.generated.h"
9
10class USlotWidget;
14UCLASS()
15class BASEHELPERS_API ULayerWidget : public UCommonUserWidget, public IWidgetLayout
16{
17 GENERATED_BODY()
18
19public:
20
22
23 //~~ IWidgetLayout ~~~~//
24 UFUNCTION(BlueprintCallable, Category="Layout")
25 virtual UUserWidget* PushWidget(const TSoftClassPtr<UUserWidget>& WidgetClass) override;
26 UFUNCTION(BlueprintCallable, Category="Layout")
27 virtual void PopWidget() override;
28 UFUNCTION(BlueprintCallable, Category="Layout")
29 virtual void ClearStack() override;
30 UFUNCTION(BlueprintCallable, Category="Layout")
31 virtual UUserWidget* AddWidgetToLayer(const TSoftClassPtr<UUserWidget>& WidgetClass) override;
32 UFUNCTION(BlueprintCallable, Category="Layout")
33 virtual UUserWidget* GetContentFromLayer(const TSoftClassPtr<UUserWidget>& WidgetClass) override;
34
35 UFUNCTION(BlueprintCallable, Category="Layout")
36 virtual bool ToggleWidget(UUserWidget* Widget) override;
37 UFUNCTION(BlueprintCallable, Category="Layout")
38 virtual UUserWidget* AddWidgetToLayerWithSlot(const FGameplayTag& SlotTag, const TSoftClassPtr<UUserWidget>& WidgetClass) override;
39
40 //~~ IWidgetLayout ~~~~//
41
42
43 UFUNCTION(BlueprintCallable, Category="Layout")
44 void CollapseTopWidget();
45 UFUNCTION(BlueprintCallable, Category="Layout")
46 void ShowTopWidget();
47
48 UFUNCTION(BlueprintCallable, Category="Layout")
49 FText GetStackListNames() const;
50
51 UFUNCTION(BlueprintCallable, Category="Layout")
52 void GetSlots();
53
54protected:
55 virtual bool Initialize() override;
56 virtual void NativePreConstruct() override;
57 virtual void NativeConstruct() override;
58
59 UFUNCTION(BlueprintCallable, Category="Layout")
60 UUserWidget* GetTopWidget() const;
61
62 // A helper function to find the slot by tag
63 USlotWidget* FindSlotByTag(const FGameplayTag& SlotTag) const;
64
65
66 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Stack")
67 TArray<UUserWidget*> Stack;
68
69 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Stack")
70 TArray<UUserWidget*> BackStack;
71
72 // UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Stack")
73 // TArray<UUserWidget*> SlotStack;
74
75 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Widgets", meta=(BindWidget))
76 class UBorder* Border = nullptr;
77 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Widgets", meta=(BindWidget))
78 class UWidgetSwitcher* Switcher = nullptr;
79 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Widgets", meta=(BindWidget))
80 class UOverlay* EmptyOverlay = nullptr;
81 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Widgets", meta=(BindWidget))
82 class UOverlay* BackOverlay = nullptr;
83 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Widgets", meta=(BindWidget))
84 class UOverlay* SlotsOverlay = nullptr;
85
86 // Stores the HUD slots and their tags
87 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Layout|Slots")
88 TMap<FGameplayTag, USlotWidget*> HUDSlots;
89
90private:
91
92};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition WidgetLayout.h:21
Definition LayerWidget.h:16
Definition SlotWidget.h:16
FGameplayTag SlotTag
Definition SlotWidget.h:22
virtual bool Initialize() override
Definition SlotWidget.cpp:10