Space Plunder
Loading...
Searching...
No Matches
CommonSlider.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 "CommonWidgetBase.h"
7#include "Blueprint/UserWidget.h"
8#include "CommonSlider.generated.h"
9
10class UWidgetSwitcher;
11class UButton;
12class UEditableTextBox;
13class UTextBlock;
14class USlider;
15
16DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSliderValueChanged, const float, Value);
17
18//@TODO Have different Layouts
19//@TODO
23UCLASS()
24class COMMONUISTYLE_API UCommonSlider : public UCommonWidgetBase
25{
26 GENERATED_BODY()
27
28public:
29 UPROPERTY(Blueprintable)
30 FOnSliderValueChanged OnSliderValueChanged;
31
32
33
34 virtual bool Initialize() override;
35 virtual void NativePreConstruct() override;
36 virtual void NativeConstruct() override;
37
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Common UI")
39 bool bShowValue = true;
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Common UI")
41 bool bShowEditValue = false;
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Common UI")
43 bool bShowTitle = true;
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Common UI")
45 FText Title = FText::FromString("Title Text");
46 UFUNCTION(BlueprintCallable, Category="Common UI")
47 float GetSliderValue() const {return SliderValue;};
48 UFUNCTION(BlueprintCallable, Category="Common UI")
49 void SetSliderValue(const float Value);
50 UFUNCTION(BlueprintCallable, Category="Common UI")
51 void SetSliderMinMax(const float MinValue, const float MaxValue) const;
52
53protected:
54 virtual void Setup() override;
55
56 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
57 USlider* Slider = nullptr;
58 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
59 UTextBlock* TitleTextBlock = nullptr;
60 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
61 UTextBlock* ValueTextBlock = nullptr;
62 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
63 UEditableTextBox* EditableTextBox = nullptr;
64 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
65 UButton* ValueInputButton = nullptr;
66 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Common UI", meta=(BindWidget))
67 UWidgetSwitcher* InputSwitcher = nullptr;
68
69
70private:
71 float SliderValue = 0.0;
72
73 UFUNCTION()
74 void OnValueChanged(float Value);
75 UFUNCTION()
76 void OnTextCommited(const FText& Text, ETextCommit::Type CommitMethod);
77 UFUNCTION()
78 void OnTextChanged(const FText& Text);
79 UFUNCTION()
80 void OnButtonPressed();
81
82};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSliderValueChanged, const float, Value)
Definition CommonSlider.h:25
Definition CommonWidgetBase.h:20