Finished implementing the ReadLuaValues K2Node

This commit is contained in:
2026-03-04 19:54:13 -05:00
parent 78f0f318c5
commit 6d018fc02b
6 changed files with 199 additions and 250 deletions

View File

@@ -1,3 +1,12 @@
////////////////////////////////////////////////////////////
//
// ReadLuaValues.h
//
// K2Node that reads typed values from a UlxLuaValues array.
// Takes a prototype string like "string x, float y, int z"
// and creates output pins with the appropriate types.
//
////////////////////////////////////////////////////////////
#pragma once
@@ -10,10 +19,6 @@ class FString;
class UEdGraph;
class UObject;
//
// The Lua Call K2Node.
//
UCLASS(MinimalAPI)
class UK2Node_ReadLuaValues : public UlxK2Node
{
@@ -42,24 +47,20 @@ public:
//~ End UK2Node Interface.
private:
virtual bool IsInvoke() const { return true; }
/** Pin Names for the three built-in Pins **/
static const FName FunctionPinName;
static const FName PlacePinName;
static const FName ExtraResultsPinName;
static const FName PrototypePinName;
static const FName InputValuesPinName;
static const FName RemainingPinName;
static const FName ErrorPinName;
private:
// Whenever the function value changes, we call
// Whenever the prototype pin value changes, we call
// ReconstructNode, which backs up the value into this
// property. This cache is needed because during
// ReconstructNode, we blow away the function pin. The
// function pin is also absent when the node is first
// ReconstructNode, we blow away the prototype pin. The
// prototype pin is also absent when the node is first
// created.
//
UPROPERTY()
FString LuaFunctionPrototype = TEXT("class.func(int arg1, int arg2) : int ret1, int ret2");
FString ValuePrototype = TEXT("string x, float y, int z");
};