initial commit; cv 0.0.3
This commit is contained in:
45
Api/WidgetBlueprintGeneratedClass.hpp
Normal file
45
Api/WidgetBlueprintGeneratedClass.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <Api/UnrealWrapper.hpp>
|
||||
#include <Api/WidgetTree.hpp>
|
||||
|
||||
namespace PalUIExtension::Api
|
||||
{
|
||||
// ==================================================================
|
||||
// UWidgetBlueprintGeneratedClass -- the CLASS object behind every WBP_...
|
||||
// ==================================================================
|
||||
class WidgetBlueprintGeneratedClass : public UnrealWrapper
|
||||
{
|
||||
public:
|
||||
static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.WidgetBlueprintGeneratedClass"); }
|
||||
static auto DebugTag() -> const TCHAR* { return STR("WBPGeneratedClass"); }
|
||||
|
||||
WidgetBlueprintGeneratedClass() = default;
|
||||
|
||||
explicit WidgetBlueprintGeneratedClass(UObject* Obj) : UnrealWrapper(Obj, ClassOf<WidgetBlueprintGeneratedClass>(), DebugTag()) {}
|
||||
|
||||
static auto Of(UObject* Instance) -> WidgetBlueprintGeneratedClass
|
||||
{
|
||||
if (!Instance) return WidgetBlueprintGeneratedClass{};
|
||||
|
||||
UClass* Cls = Instance->GetClassPrivate();
|
||||
if (!Cls) return WidgetBlueprintGeneratedClass{};
|
||||
|
||||
UClass* Expected = ClassOf<WidgetBlueprintGeneratedClass>();
|
||||
if (!Expected || !Cls->IsA(Expected)) return WidgetBlueprintGeneratedClass{};
|
||||
|
||||
return WidgetBlueprintGeneratedClass{ static_cast<UObject*>(Cls) };
|
||||
}
|
||||
|
||||
auto TemplateTree() const -> WidgetTree
|
||||
{
|
||||
UObject* Tree = TryObjectProperty(STR("WidgetTree"));
|
||||
return Tree ? WidgetTree{ Tree } : WidgetTree{};
|
||||
}
|
||||
|
||||
auto TemplateTreeObject() const -> UObject*
|
||||
{
|
||||
return TryObjectProperty(STR("WidgetTree"));
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user