130 lines
4.0 KiB
C++
130 lines
4.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "CoreMinimal.h"
|
|
#include "EdGraph/EdGraphNode.h"
|
|
#include "EdGraph/EdGraphPin.h"
|
|
#include "HAL/Platform.h"
|
|
#include "Internationalization/Text.h"
|
|
#include "K2Node.h"
|
|
#include "UObject/NameTypes.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "FormatError.generated.h"
|
|
|
|
class FBlueprintActionDatabaseRegistrar;
|
|
class FString;
|
|
class UEdGraph;
|
|
class UObject;
|
|
|
|
|
|
//
|
|
// Export log verbosity to blueprints.
|
|
//
|
|
UENUM(BlueprintType)
|
|
enum class ElxLogVerbosity : uint8 {
|
|
Fatal,
|
|
Error,
|
|
Warning,
|
|
Display,
|
|
Log,
|
|
Verbose,
|
|
VeryVerbose,
|
|
};
|
|
|
|
//
|
|
// Display Duration - how long to show a message on-screen.
|
|
//
|
|
UENUM(BlueprintType)
|
|
enum class ElxDisplayDuration : uint8 {
|
|
No_Display = 0,
|
|
Display_1_Seconds = 1,
|
|
Display_2_Seconds = 2,
|
|
Display_3_Seconds = 3,
|
|
Display_4_Seconds = 4,
|
|
Display_5_Seconds = 5,
|
|
Display_10_Seconds = 10,
|
|
Display_20_Seconds = 20,
|
|
Display_30_Seconds = 30,
|
|
Display_40_Seconds = 40,
|
|
Display_50_Seconds = 50,
|
|
Display_60_Seconds = 60,
|
|
Display_70_Seconds = 70,
|
|
Display_80_Seconds = 80,
|
|
Display_90_Seconds = 90,
|
|
Display_1_Minute = 101,
|
|
Display_2_Minutes = 102,
|
|
Display_3_Minutes = 103,
|
|
Display_4_Minutes = 104,
|
|
Display_5_Minutes = 105,
|
|
};
|
|
|
|
//
|
|
// Library functions used by Format Error Message.
|
|
//
|
|
UCLASS(MinimalAPI)
|
|
class UlxFormatErrorLibrary : public UBlueprintFunctionLibrary
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true"))
|
|
static void FormatErrorInternal(ElxLogVerbosity Verbosity, ElxDisplayDuration DisplayDuration, FText InPattern, TArray<FFormatArgumentData> InArgs);
|
|
};
|
|
|
|
//
|
|
// Library functions used by Format Error Message, and also
|
|
// by scripters writing their own Error Message Handler classes.
|
|
//
|
|
UCLASS(MinimalAPI)
|
|
class UK2Node_FormatError : public UK2Node
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
//~ Begin UObject Interface
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
//~ End UObject Interface
|
|
|
|
//~ Begin UEdGraphNode Interface.
|
|
virtual void AllocateDefaultPins() override;
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
virtual bool ShouldShowNodeProperties() const override { return true; }
|
|
virtual void PinConnectionListChanged(UEdGraphPin* Pin) override;
|
|
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
|
|
virtual void PinTypeChanged(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; }
|
|
virtual void PostReconstructNode() override;
|
|
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:
|
|
/** Create all necessary pins */
|
|
void CreateCorrectPins();
|
|
|
|
/** Synchronize the type of the given argument pin with the type its connected to, or reset it to a wildcard pin if there's no connection */
|
|
void SynchronizeArgumentPinType(UEdGraphPin* Pin);
|
|
|
|
private:
|
|
/** When adding arguments to the node, their names are placed here and are generated as pins during construction */
|
|
UPROPERTY()
|
|
TArray<FString> PinNames;
|
|
|
|
/** Tooltip text for this node. */
|
|
FText NodeTooltip;
|
|
};
|
|
|