More work on property

This commit is contained in:
2026-04-03 15:03:59 -04:00
parent e70bce0ede
commit c19091ef1f
12 changed files with 157 additions and 267 deletions

View File

@@ -0,0 +1,46 @@
#pragma once
#include "CoreMinimal.h"
#include "WingServer.h"
#include "WingHandler.h"
#include "WingFetcher.h"
#include "WingPropHandle.h"
#include "WingUtils.h"
#include "Details_Set.generated.h"
UCLASS()
class UWing_Details_Set : public UWingHandler
{
GENERATED_BODY()
public:
UPROPERTY(meta=(Description="Target object"))
FString Object;
UPROPERTY(meta=(Description="Property name"))
FString Property;
UPROPERTY(meta=(Description="New value in Unreal text format"))
FString Value;
virtual void Register() override
{
UWingServer::AddHandler(this,
TEXT("Set a single editable property. Value uses Unreal text format."));
}
virtual void Handle() override
{
WingFetcher F;
UObject* Obj = F.Walk(Object).Cast<UObject>();
if (!Obj) return;
WingPropHandle Props;
WingPropHandle::Handles Handles = Props.GetDetails(Obj, true);
TSharedPtr<IPropertyHandle>* P = WingUtils::FindOneWithExternalID(Property, Handles, TEXT("Property"));
if (!P) return;
if (WingPropHandle::SetText(**P, Value))
UWingServer::Print(TEXT("OK\n"));
}
};