Files
ZMMO/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h
Mateus Rodrigues 3889680469 feat(ui): painel como o Hyper — texturas reais + Panels editável + fixes
- Realoca as 13 texturas de painel do Hyper p/ /Game/ZMMO/UI/CommonUI/Textures/Panels/ (remove as procedurais)
- DT_UI_Styles.PanelBackground com as 9 entradas fiéis ao Hyper Survival_Gold (DrawAs=Image, Margin 0, tint por chave); PanelOutline vazio como no Hyper
- FUIPanelBrushSet (espelha Struct_UI_Style_Panels): só os 2 mapas
- UUIPanel_Base expõe Panels EditAnywhere (Details como no Hyper), semeado do tema; modo-textura só SetBrush (sem padding/visibility inventados)
- Design-time carrega DT_UI_Styles direto (Designer pinta igual ao runtime)
- Fix: outline ausente usa NoDrawType (antes pintava centro branco com FSlateBrush default)
- Remove membro morto Content/UNamedSlot (Hyper não usa NamedSlot)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 02:03:09 -03:00

84 lines
2.9 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;
/**
* 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<UBorder> Background;
/** Contorno texturizado por cima do fundo (modo textura, padrão Hyper). */
UPROPERTY(meta = (BindWidgetOptional))
TObjectPtr<UBorder> Outline;
private:
UFUNCTION()
void HandleThemeChanged(FName NewThemeId);
bool bThemeBound = false;
};