You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb simon.therriault #jira UETOOL-4463 #preflight 62424a85c61d8a458f223a59 [CL 19540648 by George Rolfe in ue5-main branch]
72 lines
2.2 KiB
C++
72 lines
2.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "K2Node_BaseAsyncTask.h"
|
|
|
|
#include "K2Node_WebAPIOperation.generated.h"
|
|
|
|
class FBlueprintActionDatabaseRegistrar;
|
|
|
|
UENUM()
|
|
enum class EWebAPIOperationAsyncType : uint8
|
|
{
|
|
LatentAction = 0,
|
|
Callback = 1
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class WEBAPIBLUEPRINTGRAPH_API UK2Node_WebAPIOperation
|
|
: public UK2Node_BaseAsyncTask
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UK2Node_WebAPIOperation();
|
|
|
|
//~ Begin UEdGraphNode Interface.
|
|
virtual void AllocateDefaultPins() override;
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
virtual void GetNodeContextMenuActions(class UToolMenu* Menu, class UGraphNodeContextMenuContext* Context) const override;
|
|
virtual void PostPlacedNewNode() override;
|
|
virtual void PostPasteNode() override;
|
|
virtual bool CanPasteHere(const UEdGraph* TargetGraph) const override;
|
|
//~ End UEdGraphNode Interface.
|
|
|
|
// UK2Node interface
|
|
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
|
virtual void PostReconstructNode() override;
|
|
// End of UK2Node interface
|
|
|
|
void SetAsyncType(EWebAPIOperationAsyncType InAsyncType);
|
|
|
|
bool IsValid() const;
|
|
|
|
private:
|
|
UEdGraphPin* FindPinContainingName(const EEdGraphPinDirection& InPinDirection, const FString& InName) const;
|
|
TArray<UEdGraphPin*> FindPinsContainingName(const EEdGraphPinDirection& InPinDirection, const FString& InName) const;
|
|
|
|
TArray<UEdGraphPin*> GetRequestPins() const;
|
|
TArray<UEdGraphPin*> GetResponsePins() const;
|
|
TArray<UEdGraphPin*> GetErrorResponsePins() const;
|
|
|
|
void SplitRequestPins(const TArray<UEdGraphPin*>& InPins) const;
|
|
void SplitResponsePins(const TArray<UEdGraphPin*>& InPins) const;
|
|
|
|
static void CleanupPinNameInline(FString& InPinName);
|
|
|
|
/** Flips the node's Async Type. */
|
|
void ToggleAsyncType();
|
|
|
|
/** Update exec pins when converting between LatentAction and Callback Async Types. */
|
|
bool ReconnectExecPins(TArray<UEdGraphPin*>& OldPins);
|
|
|
|
/** Latent Action is preferred, but not compatible when used in a function, so allow conversion between the two. */
|
|
UPROPERTY()
|
|
EWebAPIOperationAsyncType OperationAsyncType = EWebAPIOperationAsyncType::LatentAction;
|
|
};
|