diff --git a/Content/ZMMO/Data/UI/DT_UI_Styles.uasset b/Content/ZMMO/Data/UI/DT_UI_Styles.uasset index 1849e47..c239beb 100644 Binary files a/Content/ZMMO/Data/UI/DT_UI_Styles.uasset and b/Content/ZMMO/Data/UI/DT_UI_Styles.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Footer.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Footer.uasset new file mode 100644 index 0000000..949c4ba Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Footer.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_01.uasset new file mode 100644 index 0000000..9dd0ade Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_01.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_02.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_02.uasset new file mode 100644 index 0000000..ede124a Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_02.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03.uasset new file mode 100644 index 0000000..97499f3 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03_Outline.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03_Outline.uasset new file mode 100644 index 0000000..500e610 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Horizontal_03_Outline.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_01.uasset new file mode 100644 index 0000000..0f38dcc Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_01.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_02.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_02.uasset new file mode 100644 index 0000000..480e8f3 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_02.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_03.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_03.uasset new file mode 100644 index 0000000..e311c5e Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_03.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_04.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_04.uasset new file mode 100644 index 0000000..94c6190 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Rectangle_Vertical_04.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Square_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Square_01.uasset new file mode 100644 index 0000000..7d914a6 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Background_Square_01.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Horizontal_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Horizontal_01.uasset deleted file mode 100644 index d9380d8..0000000 Binary files a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Horizontal_01.uasset and /dev/null differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Square_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Square_01.uasset deleted file mode 100644 index 33a3653..0000000 Binary files a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Square_01.uasset and /dev/null differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Vertical_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Vertical_01.uasset deleted file mode 100644 index bb436ac..0000000 Binary files a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Bg_Rectangle_Vertical_01.uasset and /dev/null differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Gradient_Large_LeftToRight.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Gradient_Large_LeftToRight.uasset new file mode 100644 index 0000000..267c5ec Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Gradient_Large_LeftToRight.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Outline_Gold_01.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Outline_Gold_01.uasset deleted file mode 100644 index c54b0ff..0000000 Binary files a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_Outline_Gold_01.uasset and /dev/null differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight.uasset new file mode 100644 index 0000000..4f44150 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight.uasset differ diff --git a/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight_02.uasset b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight_02.uasset new file mode 100644 index 0000000..b33f4e3 Binary files /dev/null and b/Content/ZMMO/UI/CommonUI/Textures/Panels/T_Panel_TransparrentGradient_Large_LeftToRight_02.uasset differ diff --git a/Content/ZMMO/UI/Shared/UI_Panel_Master.uasset b/Content/ZMMO/UI/Shared/UI_Panel_Master.uasset index 86dcdb3..2670a64 100644 Binary files a/Content/ZMMO/UI/Shared/UI_Panel_Master.uasset and b/Content/ZMMO/UI/Shared/UI_Panel_Master.uasset differ diff --git a/Source/ZMMO/Data/UI/UIStyleTokens.h b/Source/ZMMO/Data/UI/UIStyleTokens.h index 6889486..17f505c 100644 --- a/Source/ZMMO/Data/UI/UIStyleTokens.h +++ b/Source/ZMMO/Data/UI/UIStyleTokens.h @@ -292,6 +292,24 @@ struct ZMMO_API FUIStyleButton TMap ShapeSizes; }; +/** + * Espelha 1:1 o Struct_UI_Style_Panels do Hyper: só os dois mapas de brush + * (fundo + contorno) indexados por EUIPanelTexture. É o que o UI_Panel_Master + * do Hyper expõe editável na instância (Details). EditAnywhere/ReadWrite para + * o designer ajustar brush por widget; o tema (DT) só faz seed/fallback. + */ +USTRUCT(BlueprintType) +struct ZMMO_API FUIPanelBrushSet +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Texture") + TMap PanelBackground; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panel|Texture") + TMap PanelOutline; +}; + USTRUCT(BlueprintType) struct ZMMO_API FUIStylePanel { diff --git a/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.cpp b/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.cpp index ab9fe10..055514e 100644 --- a/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.cpp +++ b/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.cpp @@ -3,8 +3,9 @@ #include "ZMMOThemeSubsystem.h" #include "Engine/GameInstance.h" #include "Components/Border.h" -#include "Components/NamedSlot.h" #include "Styling/SlateBrush.h" +#include "Engine/DataTable.h" +#include "UI/UIStyleRow.h" namespace { @@ -20,7 +21,25 @@ namespace } } } - return Fallback; // design-time: defaults Aurora Arcana + // Design-time (sem GameInstance/subsystem): carrega o DT_UI_Styles + // direto e usa a row "Default", para o Designer pintar/mostrar os + // brushes igual ao runtime (caso contrário FUIStyle vem vazio). + static FUIStyle DesignStyle; + static bool bDesignLoaded = false; + if (!bDesignLoaded) + { + if (const UDataTable* DT = LoadObject(nullptr, + TEXT("/Game/ZMMO/Data/UI/DT_UI_Styles.DT_UI_Styles"))) + { + if (const FUIStyleRow* Row = DT->FindRow( + FName(TEXT("Default")), TEXT("UIPanelDesign"), false)) + { + DesignStyle = Row->Style; + bDesignLoaded = true; + } + } + } + return bDesignLoaded ? DesignStyle : Fallback; } } @@ -35,23 +54,40 @@ void UUIPanel_Base::RefreshUIStyle() const FUIStylePanel& P = AS.Panel; // ---- Modo TEXTURA (padrão Hyper): brush por EUIPanelTexture ---- - const FSlateBrush* BgTex = (PanelTexture != EUIPanelTexture::None) - ? P.PanelBackground.Find(PanelTexture) : nullptr; + // Fiel ao UI_Panel_Master do Hyper: só faz SetBrush nos dois Borders + // (Find no mapa por chave). Sem padding/visibility — a arte da textura + // já traz a moldura; o conteúdo é injetado pelo WBP filho. + // Seed dos mapas da instância a partir do tema quando vazios — assim o + // Details mostra Panel Background/Outline preenchidos e editáveis (igual + // ao Hyper, cujo `Panels` é alimentado pelo estilo). Edições do designer + // têm prioridade; o tema (P) é fallback por chave. + if (Panels.PanelBackground.Num() == 0) { Panels.PanelBackground = P.PanelBackground; } + if (Panels.PanelOutline.Num() == 0) { Panels.PanelOutline = P.PanelOutline; } + + const FSlateBrush* BgTex = nullptr; + if (PanelTexture != EUIPanelTexture::None) + { + BgTex = Panels.PanelBackground.Find(PanelTexture); + if (!BgTex) { BgTex = P.PanelBackground.Find(PanelTexture); } + } if (BgTex) { Background->SetBrush(*BgTex); - Background->SetPadding(bUseSmallPadding ? P.PaddingSmall : P.Padding); if (Outline) { - if (const FSlateBrush* OlTex = P.PanelOutline.Find(PanelTexture)) + // Hyper: Find sempre seguido de SetBrush. No Hyper a entrada de + // outline ausente é um brush TRANSPARENTE (alpha 0) — não some + // widget, só não desenha. Um FSlateBrush default desenha um + // retângulo BRANCO; o equivalente correto é DrawAs=NoDrawType. + const FSlateBrush* OlTex = Panels.PanelOutline.Find(PanelTexture); + if (!OlTex) { OlTex = P.PanelOutline.Find(PanelTexture); } + static const FSlateBrush NoDrawBrush = [] { - Outline->SetBrush(*OlTex); - Outline->SetVisibility(ESlateVisibility::HitTestInvisible); - } - else - { - Outline->SetVisibility(ESlateVisibility::Collapsed); - } + FSlateBrush B; + B.DrawAs = ESlateBrushDrawType::NoDrawType; + return B; + }(); + Outline->SetBrush(OlTex ? *OlTex : NoDrawBrush); } BP_ApplyPanelStyle(P); return; diff --git a/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h b/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h index 6ecc615..843cdca 100644 --- a/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h +++ b/Source/ZMMO/Game/UI/Widgets/UIPanel_Base.h @@ -7,7 +7,6 @@ #include "UIPanel_Base.generated.h" class UBorder; -class UNamedSlot; /** * Painel base do ZMMO — mesmo padrão do UUIButton_Base, mas container. @@ -44,6 +43,16 @@ public: 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(); @@ -66,9 +75,6 @@ protected: UPROPERTY(meta = (BindWidgetOptional)) TObjectPtr Outline; - UPROPERTY(meta = (BindWidgetOptional)) - TObjectPtr Content; - private: UFUNCTION() void HandleThemeChanged(FName NewThemeId);