Files
ZMMO/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h
Mateus Rodrigues ca117a559e 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>
2026-05-19 00:52:10 -03:00

78 lines
2.5 KiB
C++

#pragma once
#include "CoreMinimal.h"
#include "CommonUserWidget.h"
#include "UI/UIStyleTypes.h"
#include "UI/UIStyleTokens.h"
#include "UIPanel_Base.generated.h"
class UBorder;
class UNamedSlot;
/**
* Painel base do ZMMO — mesmo padrão do UUIButton_Base, mas container.
* Fundação CommonUI (UCommonUserWidget). Camada Abstract; o WBP concreto
* (UI_Panel_Master) herda DIRETO desta classe C++ (UMG não encadeia árvores
* de WBP — ver ARQUITETURA.md §3.3).
*
* Visual data-driven por FUIStyle.Panel (UZMMOThemeSubsystem). Designers
* injetam o conteúdo no NamedSlot "Content".
*/
UCLASS(Abstract, Blueprintable)
class ZMMO_API UUIPanel_Base : public UCommonUserWidget
{
GENERATED_BODY()
public:
/** Tipo do painel — escolhe Bg/BgRaised/BgSunken/Card de FUIStylePanel. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel")
EUIPanelType PanelType = EUIPanelType::Primary;
/** Arredonda o Background (RoundedBox) com a borda do tema. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel")
bool bRoundedBackground = true;
/** Usa o padding "pequeno" do tema (PaddingSmall) em vez de Padding. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel")
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. */
UFUNCTION(BlueprintCallable, Category = "UI Style")
void RefreshUIStyle();
protected:
virtual void NativePreConstruct() override;
virtual void NativeConstruct() override;
virtual void NativeDestruct() override;
/** Hook opcional: o WBP pode estender/sobrescrever a aplicação visual. */
UFUNCTION(BlueprintImplementableEvent, Category = "UI Style",
meta = (DisplayName = "Apply Panel Style"))
void BP_ApplyPanelStyle(const FUIStylePanel& Panel);
/** Widgets visuais opcionais. */
UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UBorder> Background;
/** Contorno texturizado por cima do fundo (modo textura, padrão Hyper). */
UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UBorder> Outline;
UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UNamedSlot> Content;
private:
UFUNCTION()
void HandleThemeChanged(FName NewThemeId);
bool bThemeBound = false;
};