initial commit; cv 0.0.3
This commit is contained in:
50
Api/PanelSlot.hpp
Normal file
50
Api/PanelSlot.hpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include "UmgTypes.hpp"
|
||||
#include "UnrealWrapper.hpp"
|
||||
|
||||
namespace PalUIExtension::Api
|
||||
{
|
||||
// ------------------------------------------------------------------
|
||||
// UPanelSlot.
|
||||
//
|
||||
// Worth saying plainly: this class exposes ZERO UFUNCTIONs. Its entire
|
||||
// surface is two Instanced UPROPERTYs, Parent and Content. So this
|
||||
// wrapper cannot use ProcessEvent at all -- it exists only to give
|
||||
// CanvasPanelSlot a place to inherit property access from, and to give
|
||||
// you something typed to hold when AddChild() hands back a UPanelSlot*
|
||||
// whose concrete type you do not know yet.
|
||||
//
|
||||
// If you were expecting a base class full of shared calls to inherit,
|
||||
// that expectation does not survive contact with the engine here. The
|
||||
// real shared behaviour lives in UnrealWrapper, not in UPanelSlot.
|
||||
// ------------------------------------------------------------------
|
||||
class PanelSlot : public UnrealWrapper
|
||||
{
|
||||
public:
|
||||
static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.PanelSlot"); }
|
||||
static auto DebugTag() -> const TCHAR* { return STR("PanelSlot"); }
|
||||
|
||||
PanelSlot() = default;
|
||||
explicit PanelSlot(UObject* Obj) : PanelSlot(Obj, ClassOf<PanelSlot>(), DebugTag()) {}
|
||||
|
||||
// Raw UObject* rather than wrappers: Parent is a UPanelWidget and
|
||||
// Content is a UWidget, and wrapping either here would mean
|
||||
// including headers that (transitively) include this one.
|
||||
auto GetParentObject() const -> UObject*
|
||||
{
|
||||
auto Ptr = PropertyPtr<UObject*>(STR("Parent"));
|
||||
return Ptr ? *Ptr : nullptr;
|
||||
}
|
||||
|
||||
auto GetContentObject() const -> UObject*
|
||||
{
|
||||
auto Ptr = PropertyPtr<UObject*>(STR("Content"));
|
||||
return Ptr ? *Ptr : nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
PanelSlot(UObject* Obj, UClass* Expected, const TCHAR* Tag)
|
||||
: UnrealWrapper(Obj, Expected, Tag) {}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user