Files
UnrealEngineUWP/Engine/Source/Editor/BlueprintGraph/Classes/K2Node_AddComponentByClass.h
Marc Audy fac57d4fe6 Fix crash if null class is used to add component by class
#jira UE-92574

Fix scene component pins being shown on add component by class node at incorrect times (mostly when the class is null)

#rb Ben.Hoffman
#rnx
#robomerge[RELEASE] Release-Engine-Staging
#robomerge[BOT1] 13.00

[CL 13074112 by Marc Audy in Main branch]
2020-04-29 16:38:20 -04:00

46 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "K2Node_ConstructObjectFromClass.h"
#include "K2Node_AddComponentByClass.generated.h"
/**
* Implementation of K2Node for creating a component based on a selected or passed in class
*/
UCLASS()
class BLUEPRINTGRAPH_API UK2Node_AddComponentByClass : public UK2Node_ConstructObjectFromClass
{
GENERATED_BODY()
public:
UK2Node_AddComponentByClass(const FObjectInitializer& ObjectInitializer);
//~ Begin UEdGraphNode Interface.
virtual void AllocateDefaultPins() override;
virtual void ExpandNode(FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
//~ End UEdGraphNode Interface.
//~ Begin UK2Node_ConstructObjectFromClass Interface
virtual void CreatePinsForClass(UClass* InClass, TArray<UEdGraphPin*>* OutClassPins) override;
protected:
virtual FText GetBaseNodeTitle() const override;
virtual FText GetDefaultNodeTitle() const override;
virtual FText GetNodeTitleFormat() const override;
virtual UClass* GetClassPinBaseClass() const override;
virtual bool IsSpawnVarPin(UEdGraphPin* Pin) const override;
//~ End UK2Node_ConstructObjectFromClass Interface
UEdGraphPin* GetRelativeTransformPin() const;
UEdGraphPin* GetManualAttachmentPin() const;
/** Returns true if the currently selected or linked class is known to be a scene component */
bool IsSceneComponent() const;
/** Utility function to set whether the scene component specific pins are hidden or not */
void SetSceneComponentPinsHidden(bool bHidden);
};