Files
integration/Plugins/UEWingman/Source/UEWingman/Handlers/GraphNode_SetArgs.h

45 lines
1.1 KiB
C
Raw Normal View History

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-18 10:25:21 -04:00
#include "WingFunctionArgs.h"
2026-03-17 13:16:48 -04:00
#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;
2026-03-19 10:16:44 -04:00
UPROPERTY(meta=(Description="Args e.g. 'int x,float y'"))
2026-03-17 13:16:48 -04:00
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
}
};