Space Plunder
Loading...
Searching...
No Matches
ButtonPromptWidget.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 "InputAction.h"
7#include "Blueprint/UserWidget.h"
8#include "Data/BaseData.h"
9#include "Engine/DataTable.h"
10#include "ButtonPromptWidget.generated.h"
11
12enum class EGameControllerType : uint8;
14
15
30UCLASS()
31class BASEHELPERS_API UButtonPromptWidget : public UUserWidget
32{
33 GENERATED_BODY()
34
35public:
36
37 explicit UButtonPromptWidget(const FObjectInitializer& ObjectInitializer);
38
39 UPROPERTY(BlueprintAssignable, Category="Button Prompt")
40 FOnButtonPressed OnButtonPressed;
41
42 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Button Prompt")
43 void StartButtonProgress(const float Time);
44 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Button Prompt")
45 void ButtonProgress();
46 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Button Prompt")
47 void StopButtonProgress();
48 UFUNCTION(BlueprintPure, BlueprintCallable, Category="Button Prompt")
49 float GetButtonProgress() const{return Progress;};
50
51 UFUNCTION(BlueprintCallable, Category="Button Prompt")
52 void SetAvailable(const bool bValue = true);
53
54 UFUNCTION(BlueprintCallable, Category="Button Prompt")
55 void SetHasProgress(const bool bValue);
56 UFUNCTION(BlueprintCallable, Category="Button Prompt")
57 bool GetHasProgress() const {return bHasProgressBar;};
58
59 UFUNCTION(BlueprintCallable, Category="Button Prompt")
60 void SetInputAction(UInputAction* Action);
61 UFUNCTION(BlueprintCallable, Category="Button Prompt")
62 void SetInputActionFromTable(const FName& Name);
63 UFUNCTION(BlueprintCallable, Category="Button Prompt")
64 void SetShowText(const bool bValue);
65
66 UFUNCTION(BlueprintCallable, Category="Button Prompt")
67 void SetSizeValue(const float Value);
68 UFUNCTION(BlueprintCallable, Category="Button Prompt")
69 void SetSize(const ESize Value);
70
71
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Button Prompt|Progress")
73 class UMaterialInstance* ProgressBar = nullptr;
74
75 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Button Prompt|Progress")
76 float Progress = 0.0f;
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Button Prompt|Progress")
78 float ProgressTickTime = 0.01f;
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Button Prompt|Progress")
80 float ProgressIncrementRate = 1.0f;
81
82 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General", meta=(EditCondition="!bUseDataTable"))
83 bool bUseInputAction = false;
84 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General", meta=(EditCondition="!bUseInputAction"))
85 bool bUseDataTable = false;
86 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General")
87 bool bShowText = false;
88 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General")
89 bool bKeepProgressSize = false;
90protected:
91 virtual bool Initialize() override;
92 virtual void NativePreConstruct() override;
93 virtual void NativeConstruct() override;
94
95 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Button Prompt|General")
96 bool bHasProgressBar = false;
97 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Button Prompt|Status")
98 float SizeValue = 52.0f;
99 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Button Prompt|Status")
101 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General")
102 float DefaultSize = 52.0f;
103
104 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General")
105 UInputAction* InputAction = nullptr;
106 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Button Prompt|General")
107 class UDataTable* InputActionDT;
108 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Button Prompt|General")
109 FDataTableRowHandle InputActionRow;
110
111
112 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Button Prompt|Widget")
113 class UCommonActionWidget* ButtonIconAction = nullptr;
114 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Button Prompt|Widget")
115 class UImage* ProgressBarImage = nullptr;
116 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Button Prompt|Widget")
117 class UTextBlock* PromptText = nullptr;
118 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(BindWidget), Category="Button Prompt|Widget")
119 class USizeBox* SizeContainer = nullptr;
120
121 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Button Prompt|Status")
122 bool bAvailable = true;
123 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Button Prompt|Status")
124 UMaterialInstanceDynamic* DynamicMaterial = nullptr;
125
126private:
127 void SetProgressBarMaterial();
128
129 FTimerHandle ProgressTimerHandle;
130};
ESize
Definition BaseData.h:111
EGameControllerType
Definition BaseData.h:97
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnButtonPressed)
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
User widget representing a button prompt for It provides functionality for displaying a button icon,...
Definition ButtonPromptWidget.h:32