2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// FormatMessage.h
|
|
|
|
|
//
|
|
|
|
|
// Two K2Nodes: FormatMessage and FormatLogMessage.
|
|
|
|
|
// FormatMessage outputs a formatted string as a pin.
|
|
|
|
|
// FormatLogMessage outputs it to the log instead.
|
|
|
|
|
//
|
|
|
|
|
// FormatLogMessage is a derived class that just sets
|
|
|
|
|
// a flag to alter the base class behavior.
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////
|
2024-10-28 17:40:29 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2026-02-14 01:25:04 -05:00
|
|
|
#include "BreakToDebugger.h"
|
2026-02-13 23:24:18 -05:00
|
|
|
#include "FormatDataLibrary.h"
|
2026-03-04 03:00:44 -05:00
|
|
|
#include "LuprexK2Node.h"
|
2024-10-28 17:40:29 -04:00
|
|
|
|
2026-02-13 23:24:18 -05:00
|
|
|
#include "FormatMessage.generated.h"
|
2024-10-28 17:40:29 -04:00
|
|
|
|
|
|
|
|
class FBlueprintActionDatabaseRegistrar;
|
|
|
|
|
class FString;
|
|
|
|
|
class UEdGraph;
|
|
|
|
|
class UObject;
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
2024-11-14 23:57:04 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// UK2Node_FormatMessage
|
2024-11-14 23:57:04 -05:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
2024-11-13 19:44:27 -05:00
|
|
|
UCLASS(MinimalAPI)
|
2026-03-04 03:00:44 -05:00
|
|
|
class UK2Node_FormatMessage : public UlxK2Node
|
2024-10-28 17:40:29 -04:00
|
|
|
{
|
2026-03-04 06:47:37 -05:00
|
|
|
GENERATED_BODY()
|
2024-10-28 17:40:29 -04:00
|
|
|
|
2026-03-04 06:47:37 -05:00
|
|
|
public:
|
2024-10-28 17:40:29 -04: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 PinConnectionListChanged(UEdGraphPin* Pin) override;
|
|
|
|
|
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.
|
2024-11-13 18:18:32 -05:00
|
|
|
virtual bool IsNodePure() const override { return false; }
|
2026-03-04 06:47:37 -05:00
|
|
|
virtual void ReconstructNode() override;
|
2024-10-28 17:40:29 -04:00
|
|
|
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.
|
|
|
|
|
|
2025-03-24 21:49:09 -04:00
|
|
|
protected:
|
2026-02-14 02:14:19 -05:00
|
|
|
// 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.
|
|
|
|
|
//
|
2024-10-28 17:40:29 -04:00
|
|
|
void SynchronizeArgumentPinType(UEdGraphPin* Pin);
|
|
|
|
|
|
2026-03-04 06:47:37 -05:00
|
|
|
// During ExpandNode, expand a single argument pin into
|
|
|
|
|
// a converter node. Returns the converter's output pin.
|
|
|
|
|
//
|
|
|
|
|
UEdGraphPin* ExpandArgumentPin(UEdGraphPin* ArgumentPin, class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph);
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
// Derived class sets this to true, altering
|
|
|
|
|
// the behavior of this K2Node.
|
|
|
|
|
//
|
2025-03-24 21:49:09 -04:00
|
|
|
virtual bool IsFormatErrorMessage() const { return false; }
|
|
|
|
|
|
2026-02-14 01:25:04 -05:00
|
|
|
private:
|
2026-03-04 06:47:37 -05:00
|
|
|
static const FName VerbosityPinName;
|
|
|
|
|
static const FName FormatPinName;
|
|
|
|
|
static const FName ResultPinName;
|
2026-02-13 23:24:18 -05:00
|
|
|
|
2025-03-24 21:49:09 -04:00
|
|
|
protected:
|
2026-03-04 06:47:37 -05:00
|
|
|
// Whenever the format 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 format pin. The
|
|
|
|
|
// format pin is also absent when the node is first
|
|
|
|
|
// created.
|
2026-02-14 02:14:19 -05:00
|
|
|
//
|
2024-10-28 17:40:29 -04:00
|
|
|
UPROPERTY()
|
2026-03-04 06:47:37 -05:00
|
|
|
FString FormatPattern = TEXT("Message");
|
2024-10-28 17:40:29 -04:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// UK2Node_FormatLogMessage
|
2025-03-24 21:49:09 -04:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
// Derives from FormatMessage. Sets a flag to make
|
|
|
|
|
// the base class output to the log instead of to
|
|
|
|
|
// a pin.
|
2025-03-24 21:49:09 -04:00
|
|
|
//
|
2026-02-14 02:14:19 -05:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
2025-03-24 21:49:09 -04:00
|
|
|
UCLASS(MinimalAPI)
|
2026-02-13 23:24:18 -05:00
|
|
|
class UK2Node_FormatLogMessage : public UK2Node_FormatMessage
|
2025-03-24 21:49:09 -04:00
|
|
|
{
|
2026-03-04 06:47:37 -05:00
|
|
|
GENERATED_BODY()
|
2025-03-24 21:49:09 -04:00
|
|
|
|
|
|
|
|
virtual bool IsFormatErrorMessage() const override { return true; }
|
|
|
|
|
};
|