46 lines
2.0 KiB
C++
46 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "PanelSlot.hpp"
|
|
|
|
namespace PalUIExtension::Api
|
|
{
|
|
// Same three-member surface as SizeBoxSlot (Padding + H/V alignment).
|
|
// Different engine class, different ClassPath -- not merged into one
|
|
// wrapper, matching how CanvasPanelSlot stands alone rather than
|
|
// sharing with PanelSlot's other concrete subclasses.
|
|
class OverlaySlot : public PanelSlot
|
|
{
|
|
public:
|
|
static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.OverlaySlot"); }
|
|
static auto DebugTag() -> const TCHAR* { return STR("OverlaySlot"); }
|
|
|
|
OverlaySlot() = default;
|
|
explicit OverlaySlot(UObject* Obj)
|
|
: PanelSlot(Obj, ClassOf<OverlaySlot>(), DebugTag()) {}
|
|
|
|
// ---- setters (write through the UFUNCTION so SynchronizeProperties runs)
|
|
|
|
auto SetPadding(FMargin_ InPadding) -> bool
|
|
{
|
|
struct P { FMargin_ InPadding; } p{ InPadding };
|
|
return Call(STR("SetPadding"), p);
|
|
}
|
|
auto SetHorizontalAlignment(EHorizontalAlignment_ InHorizontalAlignment) -> bool
|
|
{
|
|
struct P { EHorizontalAlignment_ InHorizontalAlignment; } p{ InHorizontalAlignment };
|
|
return Call(STR("SetHorizontalAlignment"), p);
|
|
}
|
|
auto SetVerticalAlignment(EVerticalAlignment_ InVerticalAlignment) -> bool
|
|
{
|
|
struct P { EVerticalAlignment_ InVerticalAlignment; } p{ InVerticalAlignment };
|
|
return Call(STR("SetVerticalAlignment"), p);
|
|
}
|
|
|
|
// ---- property reads
|
|
|
|
auto GetPadding() const -> std::optional<FMargin_> { return PropertyValue<FMargin_>(STR("Padding")); }
|
|
auto GetHorizontalAlignment()const -> std::optional<EHorizontalAlignment_> { return PropertyValue<EHorizontalAlignment_>(STR("HorizontalAlignment")); }
|
|
auto GetVerticalAlignment() const -> std::optional<EVerticalAlignment_> { return PropertyValue<EVerticalAlignment_>(STR("VerticalAlignment")); }
|
|
};
|
|
}
|