#pragma once #include "CoreMinimal.h" #include "CommonUserWidget.h" #include "UI/UIStyleTypes.h" #include "UI/UIStyleTokens.h" #include "UIPanel_Base.generated.h" class UBorder; /** * 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; /** * Mapas de brush por instância — espelha o `Panels` do UI_Panel_Master * do Hyper (Details mostra Panel Background / Panel Outline editáveis). * Tem prioridade. Se não houver brush p/ a chave aqui, cai no tema * (DT_UI_Styles). Em NativePreConstruct é semeado a partir do tema * quando vazio, então por padrão o tema manda — como no Hyper. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel") FUIPanelBrushSet Panels; /** 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 Background; /** Contorno texturizado por cima do fundo (modo textura, padrão Hyper). */ UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr Outline; private: UFUNCTION() void HandleThemeChanged(FName NewThemeId); bool bThemeBound = false; };