29. Globe progress bar

This commit is contained in:
2024-04-16 17:18:06 -04:00
parent a366ab11f2
commit b47c6979ac
23 changed files with 202 additions and 27 deletions

View File

@ -0,0 +1,12 @@
#pragma once
#include "Components/Image.h"
#include "GasaImage.generated.h"
UCLASS()
class UGasaImage : public UImage
{
GENERATED_BODY()
public:
};

View File

@ -0,0 +1,12 @@
#pragma once
#include "Components/Overlay.h"
#include "GasaOverlay.generated.h"
UCLASS()
class GASA_API UGasaOverlay : public UOverlay
{
GENERATED_BODY()
public:
};

View File

@ -0,0 +1,13 @@
#pragma once
#include "Components/ProgressBar.h"
#include "GasaProgressBar.generated.h"
UCLASS()
class GASA_API UGasaProgressBar : public UProgressBar
{
GENERATED_BODY()
public:
};

View File

View File

@ -0,0 +1,16 @@
#pragma once
#include "Components/SizeBox.h"
#include "GasaCommon.h"
#include "GasaSizeBox.generated.h"
UCLASS()
class GASA_API UGasaSizeBox : public USizeBox
{
GENERATED_BODY()
public:
};

View File

@ -0,0 +1,61 @@
#include "GlobeProgressBar.h"
#include "GasaImage.h"
#include "GasaProgressBar.h"
#include "GasaSizeBox.h"
#include "Components/OverlaySlot.h"
// UGlobeProgressBar::UGlobeProgressBar(FObjectInitializer const& ObjectInitializer)
// {
// }
void UGlobeProgressBar::SetBackgroundStyle(FSlateBrush brush)
{
BG->SetBrush( brush );
}
void UGlobeProgressBar::SetBarPadding(FMargin margin )
{
UOverlaySlot* BarSlot = CastChecked<UOverlaySlot>(Bar->Slot);
BarSlot->SetPadding( margin );
}
void UGlobeProgressBar::SetBarStyle(FProgressBarStyle style)
{
Bar->SetWidgetStyle( style );
}
void UGlobeProgressBar::SetGlassPadding(FMargin margin)
{
UOverlaySlot* GlassSlot = CastChecked<UOverlaySlot>(Glass->Slot);
GlassSlot->SetPadding(margin);
}
void UGlobeProgressBar::SetGlassStyle(FSlateBrush brush)
{
Glass->SetBrush(brush);
}
void UGlobeProgressBar::SetSize(float width, float height)
{
SizeBox_Root->SetWidthOverride( width );
SizeBox_Root->SetHeightOverride( height );
}
#if 0
void UGlobeProgressBar::UpdateSize()
{
}
void UGlobeProgressBar::UpdateBackground()
{
}
#endif
#pragma region UserWidget
void UGlobeProgressBar::NativePreConstruct()
{
Super::NativePreConstruct();
}
#pragma endregion UserWidget

View File

@ -0,0 +1,60 @@
#pragma once
#include "GasaCommon.h"
#include "GasaUserWidget.h"
#include "GlobeProgressBar.generated.h"
UCLASS()
class GASA_API UGlobeProgressBar : public UGasaUserWidget
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category="Globe")
UGasaSizeBox* SizeBox_Root;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category="Globe")
UGasaOverlay* Overlay_Root;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category="Globe")
UGasaImage* Glass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category="Globe")
UGasaImage* BG;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget), Category="Globe")
UGasaProgressBar* Bar;
// UGlobeProgressBar(FObjectInitializer const& ObjectInitializer);
UFUNCTION(BlueprintCallable, Category="Globe")
void SetBackgroundStyle(FSlateBrush brush);
UFUNCTION(BlueprintCallable, Category="Globe")
void SetBarPadding( FMargin margin );
UFUNCTION(BlueprintCallable, Category="Globe")
void SetBarStyle(FProgressBarStyle style);
UFUNCTION(BlueprintCallable, Category="Globe")
void SetGlassPadding( FMargin margin );
UFUNCTION(BlueprintCallable, Category="Globe")
void SetGlassStyle(FSlateBrush brush);
UFUNCTION(BlueprintCallable, Category="Globe")
void SetSize(float width, float height);
#if 0
UFUNCTION(BlueprintCallable, Category="Globe")
void UpdateSize();
UFUNCTION(BlueprintCallable, Category="Globe")
void UpdateBackground();
#endif
#pragma region UserWidget
void NativePreConstruct() override;
#pragma endregion UserWidget
};

View File

@ -1,9 +0,0 @@
#pragma once
#include "Components/ProgressBar.h"
UCLASS()
class GASA_API UProgressIndicator : public UProgressBar
{
};