feat/frontend-mainmenu-skeleton #1
@@ -5,6 +5,7 @@
|
|||||||
#include "Engine/World.h"
|
#include "Engine/World.h"
|
||||||
#include "TimerManager.h"
|
#include "TimerManager.h"
|
||||||
#include "Components/Border.h"
|
#include "Components/Border.h"
|
||||||
|
#include "Styling/SlateBrush.h"
|
||||||
#include "Components/TextBlock.h"
|
#include "Components/TextBlock.h"
|
||||||
#include "Components/Image.h"
|
#include "Components/Image.h"
|
||||||
#include "Components/SizeBox.h"
|
#include "Components/SizeBox.h"
|
||||||
@@ -165,9 +166,31 @@ void UUIButton_Base::RefreshUIStyle()
|
|||||||
const FUIStyle& ActiveStyle = ResolveActiveStyle(this, Fallback);
|
const FUIStyle& ActiveStyle = ResolveActiveStyle(this, Fallback);
|
||||||
const FUIStyleButtonVariant& VariantStyle = ResolveVariant(ActiveStyle.Button);
|
const FUIStyleButtonVariant& VariantStyle = ResolveVariant(ActiveStyle.Button);
|
||||||
|
|
||||||
if (Bg)
|
if (Background)
|
||||||
{
|
{
|
||||||
Bg->SetBrushColor(VariantStyle.BgNormal);
|
// Fundo + borda na cor da variante. RoundedBox dá cantos arredondados
|
||||||
|
// e a borda colorida (BorderNormal) — "só borda" = BgNormal transparente.
|
||||||
|
FSlateBrush Brush = Background->Background;
|
||||||
|
Brush.TintColor = FSlateColor(VariantStyle.BgNormal);
|
||||||
|
if (bRoundedBackground)
|
||||||
|
{
|
||||||
|
const float R = ActiveStyle.Button.CornerRadius;
|
||||||
|
Brush.DrawAs = ESlateBrushDrawType::RoundedBox;
|
||||||
|
Brush.OutlineSettings = FSlateBrushOutlineSettings(
|
||||||
|
FVector4(R, R, R, R),
|
||||||
|
FSlateColor(VariantStyle.BorderNormal),
|
||||||
|
ActiveStyle.Button.BorderWidth);
|
||||||
|
Brush.OutlineSettings.RoundingType = ESlateBrushRoundingType::FixedRadius;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Brush.DrawAs = ESlateBrushDrawType::Box;
|
||||||
|
Brush.OutlineSettings = FSlateBrushOutlineSettings(
|
||||||
|
FVector4(0, 0, 0, 0),
|
||||||
|
FSlateColor(VariantStyle.BorderNormal),
|
||||||
|
ActiveStyle.Button.BorderWidth);
|
||||||
|
}
|
||||||
|
Background->SetBrush(Brush);
|
||||||
}
|
}
|
||||||
if (ButtonText)
|
if (ButtonText)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Text Style")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Text Style")
|
||||||
bool bAutoSizeText = true;
|
bool bAutoSizeText = true;
|
||||||
|
|
||||||
|
/** Arredonda o Background (RoundedBox) e desenha a borda na cor da
|
||||||
|
* variante. Desligado = caixa reta. Raio/largura vêm de FUIStyleButton. */
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Button")
|
||||||
|
bool bRoundedBackground = true;
|
||||||
|
|
||||||
// ---- Number Text ----
|
// ---- Number Text ----
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Number Text")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Number Text")
|
||||||
bool bShowNumberText = false;
|
bool bShowNumberText = false;
|
||||||
@@ -176,7 +181,7 @@ protected:
|
|||||||
|
|
||||||
/** Fundo temável (nossa adição sobre o Hyper, p/ FUIStyle). */
|
/** Fundo temável (nossa adição sobre o Hyper, p/ FUIStyle). */
|
||||||
UPROPERTY(meta = (BindWidgetOptional))
|
UPROPERTY(meta = (BindWidgetOptional))
|
||||||
TObjectPtr<UBorder> Bg;
|
TObjectPtr<UBorder> Background;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void StartDeactivateTimeout();
|
void StartDeactivateTimeout();
|
||||||
|
|||||||
Reference in New Issue
Block a user