2025-02-24 16:46:05 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2026-03-04 02:56:15 -05:00
|
|
|
#include "LuprexK2Node.h"
|
2025-02-24 16:46:05 -05:00
|
|
|
|
|
|
|
|
#include "LuaCallNode.generated.h"
|
|
|
|
|
|
|
|
|
|
class FBlueprintActionDatabaseRegistrar;
|
|
|
|
|
class FString;
|
|
|
|
|
class UEdGraph;
|
|
|
|
|
class UObject;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// The Lua Call K2Node.
|
|
|
|
|
//
|
|
|
|
|
UCLASS(MinimalAPI)
|
2026-03-04 02:56:15 -05:00
|
|
|
class UK2Node_LuaInvoke : public UlxK2Node
|
2025-02-24 16:46:05 -05:00
|
|
|
{
|
2026-03-04 02:56:15 -05:00
|
|
|
GENERATED_BODY()
|
2025-02-24 16:46:05 -05:00
|
|
|
|
2026-03-04 02:56:15 -05:00
|
|
|
public:
|
2025-02-24 16:46:05 -05:00
|
|
|
//~ Begin UEdGraphNode Interface.
|
|
|
|
|
virtual void AllocateDefaultPins() override;
|
|
|
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
|
|
|
virtual bool ShouldShowNodeProperties() const override { return true; }
|
|
|
|
|
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
|
|
|
|
|
virtual FText GetTooltipText() const override;
|
|
|
|
|
virtual FText GetPinDisplayName(const UEdGraphPin* Pin) const override;
|
|
|
|
|
//~ End UEdGraphNode Interface.
|
|
|
|
|
|
|
|
|
|
//~ Begin UK2Node Interface.
|
|
|
|
|
virtual bool IsNodePure() const override { return false; }
|
2026-03-04 06:47:37 -05:00
|
|
|
virtual void ReconstructNode() override;
|
2025-02-24 16:46:05 -05:00
|
|
|
virtual bool NodeCausesStructuralBlueprintChange() const override { return true; }
|
|
|
|
|
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
|
|
|
|
|
virtual ERedirectType DoPinsMatchForReconstruction(const UEdGraphPin* NewPin, int32 NewPinIndex, const UEdGraphPin* OldPin, int32 OldPinIndex) const override;
|
|
|
|
|
virtual bool IsConnectionDisallowed(const UEdGraphPin* MyPin, const UEdGraphPin* OtherPin, FString& OutReason) const override;
|
|
|
|
|
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
|
|
|
|
virtual FText GetMenuCategory() const override;
|
|
|
|
|
virtual int32 GetNodeRefreshPriority() const override { return EBaseNodeRefreshPriority::Low_UsesDependentWildcard; }
|
|
|
|
|
//~ End UK2Node Interface.
|
|
|
|
|
|
|
|
|
|
private:
|
2025-03-28 23:31:44 -04:00
|
|
|
|
2025-04-08 16:31:16 -04:00
|
|
|
virtual bool IsInvoke() const { return true; }
|
|
|
|
|
|
2025-03-28 23:31:44 -04:00
|
|
|
/** Pin Names for the three built-in Pins **/
|
|
|
|
|
static const FName FunctionPinName;
|
|
|
|
|
static const FName PlacePinName;
|
|
|
|
|
static const FName ExtraResultsPinName;
|
2025-04-07 18:00:45 -04:00
|
|
|
static const FName ErrorPinName;
|
2025-03-28 23:31:44 -04:00
|
|
|
|
2025-02-24 16:46:05 -05:00
|
|
|
private:
|
2026-03-04 06:47:37 -05:00
|
|
|
// Whenever the function 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
|
|
|
|
|
// created.
|
|
|
|
|
//
|
2025-02-24 16:46:05 -05:00
|
|
|
UPROPERTY()
|
2026-03-04 06:47:37 -05:00
|
|
|
FString LuaFunctionPrototype = TEXT("class.func(int arg1, int arg2) : int ret1, int ret2");
|
2025-04-07 18:00:45 -04:00
|
|
|
|
2025-02-24 16:46:05 -05:00
|
|
|
};
|
|
|
|
|
|
2025-04-08 16:31:16 -04:00
|
|
|
UCLASS(MinimalAPI)
|
|
|
|
|
class UK2Node_LuaProbe : public UK2Node_LuaInvoke
|
|
|
|
|
{
|
2026-03-04 02:56:15 -05:00
|
|
|
GENERATED_BODY()
|
2025-04-08 16:31:16 -04:00
|
|
|
|
|
|
|
|
// Setting this flag alters the behavior of LuaInvoke, making it
|
|
|
|
|
// probe instead of invoke.
|
|
|
|
|
//
|
|
|
|
|
virtual bool IsInvoke() const override { return false; }
|
|
|
|
|
};
|
|
|
|
|
|