47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "WingServer.h"
|
|
#include "WingHandler.h"
|
|
#include "WingFetcher.h"
|
|
#include "WingProperty.h"
|
|
#include "WingUtils.h"
|
|
#include "Property_Get.generated.h"
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
|
|
UCLASS()
|
|
class UWing_Property_Get : public UObject, public IWingHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Target object"))
|
|
FString Object;
|
|
|
|
UPROPERTY(meta=(Description="Property name"))
|
|
FString Property;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Get the value of a single property.");
|
|
}
|
|
|
|
virtual void Handle() override
|
|
{
|
|
WingFetcher F;
|
|
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
|
if (!Obj) return;
|
|
|
|
TArray<WingProperty> All = WingProperty::GetAll(Obj, CPF_Edit);
|
|
WingProperty P = WingProperty::FindOneExactMatch(All, Property);
|
|
if (!P) return;
|
|
|
|
UWingServer::Print(P.GetText());
|
|
UWingServer::Print(TEXT("\n"));
|
|
}
|
|
};
|