2026-03-17 13:16:48 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
2026-03-18 10:17:58 -04:00
|
|
|
#include "WingHandler.h"
|
|
|
|
|
#include "WingServer.h"
|
|
|
|
|
#include "WingFetcher.h"
|
|
|
|
|
#include "WingUtils.h"
|
2026-03-17 13:16:48 -04:00
|
|
|
#include "FunctionArgs.h"
|
|
|
|
|
#include "GraphNode_SetArgs.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
2026-03-18 10:17:58 -04:00
|
|
|
class UWing_GraphNode_SetArgs : public UObject, public IWingHandler
|
2026-03-17 13:16:48 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
UPROPERTY(meta=(Description="Path to a graph node (function entry, function result, custom event, or tunnel)"))
|
|
|
|
|
FString Node;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(meta=(Description="Comma-separated args, e.g. 'int x, float y'"))
|
|
|
|
|
FString Args;
|
|
|
|
|
|
|
|
|
|
virtual FString GetDescription() const override
|
|
|
|
|
{
|
|
|
|
|
return TEXT("Set the user-defined pins (arguments or return values) on a function entry, result, custom event, or tunnel node.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void Handle() override
|
|
|
|
|
{
|
2026-03-18 10:17:58 -04:00
|
|
|
WingFetcher F;
|
2026-03-17 13:16:48 -04:00
|
|
|
UEdGraphNode* NodeObj = F.Walk(Node).Cast<UEdGraphNode>();
|
|
|
|
|
if (!NodeObj) return;
|
|
|
|
|
|
2026-03-18 10:17:58 -04:00
|
|
|
if (!WingFunctionArgs::HasArgs(NodeObj))
|
2026-03-17 13:16:48 -04:00
|
|
|
{
|
2026-03-18 10:17:58 -04:00
|
|
|
UWingServer::Printf(TEXT("ERROR: Node does not support editable args\n"));
|
2026-03-17 13:16:48 -04:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-18 10:17:58 -04:00
|
|
|
if (!WingFunctionArgs::SetArgs(NodeObj, Args)) return;
|
2026-03-17 13:16:48 -04:00
|
|
|
|
2026-03-18 10:17:58 -04:00
|
|
|
UWingServer::Printf(TEXT("Args set to: %s\n"), *WingFunctionArgs::GetArgs(NodeObj));
|
2026-03-17 13:16:48 -04:00
|
|
|
}
|
|
|
|
|
};
|