feat(ui): painel texturizado (padrao Hyper) coexistindo com modo cor

EUIPanelTexture (None, Rectangle_Horizontal_01/02/03, Vertical_01..04, Square_01, Vertical_Footer_01) - espelha o enum Panel do Hyper. FUIStylePanel ganha TMap<EUIPanelTexture,FSlateBrush> PanelBackground + PanelOutline (modelo Struct_UI_Style_Panels), mantendo os tokens de cor. UUIPanel_Base: prop PanelTexture + border Outline; RefreshUIStyle tenta modo TEXTURA (Find brush nos mapas -> SetBrush em Background/Outline) e cai no modo COR (RoundedBox) se nao houver brush. Compila OK. Texturas Aurora Arcana proprias serao geradas (nao importadas do Hyper).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 00:52:10 -03:00
parent 22fc0fbcc6
commit ca117a559e
4 changed files with 76 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Fonts/SlateFontInfo.h" #include "Fonts/SlateFontInfo.h"
#include "Styling/SlateBrush.h"
#include "Layout/Margin.h" #include "Layout/Margin.h"
#include "Templates/SubclassOf.h" #include "Templates/SubclassOf.h"
#include "UIStyleTypes.h" #include "UIStyleTypes.h"
@@ -331,6 +332,17 @@ struct ZMMO_API FUIStylePanel
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel") UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel")
FLinearColor CardSelectedBg = FLinearColor(FColor(24, 32, 58)); FLinearColor CardSelectedBg = FLinearColor(FColor(24, 32, 58));
/**
* Modo texturizado (espelha Struct_UI_Style_Panels do Hyper): brush por
* EUIPanelTexture. PanelBackground = fundo; PanelOutline = contorno.
* Se vazio p/ a chave, o painel usa o modo cor (RoundedBox) acima.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
TMap<EUIPanelTexture, FSlateBrush> PanelBackground;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI Style|Panel|Texture")
TMap<EUIPanelTexture, FSlateBrush> PanelOutline;
}; };
USTRUCT(BlueprintType) USTRUCT(BlueprintType)

View File

@@ -52,6 +52,25 @@ enum class EUIPanelType : uint8
Card UMETA(DisplayName = "Card") Card UMETA(DisplayName = "Card")
}; };
/**
* Conjunto de textura/silhueta do painel (espelha o enum "Panel" do Hyper).
* Indexa os mapas de FSlateBrush em FUIStylePanel (bg + outline).
*/
UENUM(BlueprintType)
enum class EUIPanelTexture : uint8
{
None UMETA(DisplayName = "None"),
Rectangle_Horizontal_01 UMETA(DisplayName = "Rectangle Horizontal 01"),
Rectangle_Horizontal_02 UMETA(DisplayName = "Rectangle Horizontal 02"),
Rectangle_Horizontal_03 UMETA(DisplayName = "Rectangle Horizontal 03"),
Rectangle_Vertical_01 UMETA(DisplayName = "Rectangle Vertical 01"),
Rectangle_Vertical_02 UMETA(DisplayName = "Rectangle Vertical 02"),
Rectangle_Vertical_03 UMETA(DisplayName = "Rectangle Vertical 03"),
Rectangle_Vertical_04 UMETA(DisplayName = "Rectangle Vertical 04"),
Rectangle_Square_01 UMETA(DisplayName = "Rectangle Square 01"),
Vertical_Footer_01 UMETA(DisplayName = "Vertical Footer 01")
};
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EUIProgressBarType : uint8 enum class EUIProgressBarType : uint8
{ {

View File

@@ -34,13 +34,42 @@ void UUIPanel_Base::RefreshUIStyle()
const FUIStyle& AS = ResolvePanelStyle(this, Fallback); const FUIStyle& AS = ResolvePanelStyle(this, Fallback);
const FUIStylePanel& P = AS.Panel; const FUIStylePanel& P = AS.Panel;
// ---- Modo TEXTURA (padrão Hyper): brush por EUIPanelTexture ----
const FSlateBrush* BgTex = (PanelTexture != EUIPanelTexture::None)
? P.PanelBackground.Find(PanelTexture) : nullptr;
if (BgTex)
{
Background->SetBrush(*BgTex);
Background->SetPadding(bUseSmallPadding ? P.PaddingSmall : P.Padding);
if (Outline)
{
if (const FSlateBrush* OlTex = P.PanelOutline.Find(PanelTexture))
{
Outline->SetBrush(*OlTex);
Outline->SetVisibility(ESlateVisibility::HitTestInvisible);
}
else
{
Outline->SetVisibility(ESlateVisibility::Collapsed);
}
}
BP_ApplyPanelStyle(P);
return;
}
// ---- Modo COR (RoundedBox) ----
if (Outline)
{
Outline->SetVisibility(ESlateVisibility::Collapsed);
}
FLinearColor Fill; FLinearColor Fill;
FLinearColor Outline = P.BorderColor; FLinearColor OutlineColor = P.BorderColor;
switch (PanelType) switch (PanelType)
{ {
case EUIPanelType::Secondary: Fill = P.BgRaised; break; case EUIPanelType::Secondary: Fill = P.BgRaised; break;
case EUIPanelType::Tertiary: Fill = P.BgSunken; break; case EUIPanelType::Tertiary: Fill = P.BgSunken; break;
case EUIPanelType::Card: Fill = P.CardSelectedBg; Outline = P.CardSelectedBorder; break; case EUIPanelType::Card: Fill = P.CardSelectedBg; OutlineColor = P.CardSelectedBorder; break;
case EUIPanelType::Primary: case EUIPanelType::Primary:
case EUIPanelType::None: case EUIPanelType::None:
default: Fill = P.Bg; break; default: Fill = P.Bg; break;
@@ -53,14 +82,14 @@ void UUIPanel_Base::RefreshUIStyle()
const float R = bUseSmallPadding ? P.CornerRadiusSmall : P.CornerRadius; const float R = bUseSmallPadding ? P.CornerRadiusSmall : P.CornerRadius;
Brush.DrawAs = ESlateBrushDrawType::RoundedBox; Brush.DrawAs = ESlateBrushDrawType::RoundedBox;
Brush.OutlineSettings = FSlateBrushOutlineSettings( Brush.OutlineSettings = FSlateBrushOutlineSettings(
FVector4(R, R, R, R), FSlateColor(Outline), P.BorderWidth); FVector4(R, R, R, R), FSlateColor(OutlineColor), P.BorderWidth);
Brush.OutlineSettings.RoundingType = ESlateBrushRoundingType::FixedRadius; Brush.OutlineSettings.RoundingType = ESlateBrushRoundingType::FixedRadius;
} }
else else
{ {
Brush.DrawAs = ESlateBrushDrawType::Box; Brush.DrawAs = ESlateBrushDrawType::Box;
Brush.OutlineSettings = FSlateBrushOutlineSettings( Brush.OutlineSettings = FSlateBrushOutlineSettings(
FVector4(0, 0, 0, 0), FSlateColor(Outline), P.BorderWidth); FVector4(0, 0, 0, 0), FSlateColor(OutlineColor), P.BorderWidth);
} }
Background->SetBrush(Brush); Background->SetBrush(Brush);
Background->SetPadding(bUseSmallPadding ? P.PaddingSmall : P.Padding); Background->SetPadding(bUseSmallPadding ? P.PaddingSmall : P.Padding);

View File

@@ -36,6 +36,14 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel")
bool bUseSmallPadding = false; bool bUseSmallPadding = false;
/**
* Conjunto de textura (modo Hyper). Se != None E houver brush no mapa
* FUIStylePanel.PanelBackground p/ esta chave, usa o painel TEXTURIZADO
* (brush bg + outline). Senão, cai no modo COR (RoundedBox acima).
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel")
EUIPanelTexture PanelTexture = EUIPanelTexture::None;
/** Re-resolve os tokens do tema ativo e reaplica no Background. */ /** Re-resolve os tokens do tema ativo e reaplica no Background. */
UFUNCTION(BlueprintCallable, Category = "UI Style") UFUNCTION(BlueprintCallable, Category = "UI Style")
void RefreshUIStyle(); void RefreshUIStyle();
@@ -54,6 +62,10 @@ protected:
UPROPERTY(meta = (BindWidgetOptional)) UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UBorder> Background; TObjectPtr<UBorder> Background;
/** Contorno texturizado por cima do fundo (modo textura, padrão Hyper). */
UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UBorder> Outline;
UPROPERTY(meta = (BindWidgetOptional)) UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UNamedSlot> Content; TObjectPtr<UNamedSlot> Content;