2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2014-05-29 16:42:22 -04:00
|
|
|
#include "K2Node.h"
|
2014-09-02 19:08:09 -04:00
|
|
|
#include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "K2Node_SpawnActorFromClass.generated.h"
|
|
|
|
|
|
2015-01-06 14:19:46 -05:00
|
|
|
UCLASS()
|
|
|
|
|
class BLUEPRINTGRAPH_API UK2Node_SpawnActorFromClass : public UK2Node
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_UCLASS_BODY()
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// Begin UEdGraphNode interface.
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void AllocateDefaultPins() override;
|
|
|
|
|
virtual FLinearColor GetNodeTitleColor() const override;
|
|
|
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
|
|
|
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
|
2014-10-02 05:33:25 -04:00
|
|
|
virtual void PinConnectionListChanged(UEdGraphPin* Pin) override;
|
2014-09-03 18:14:09 -04:00
|
|
|
virtual FText GetTooltipText() const override;
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
|
2015-04-25 17:47:39 -04:00
|
|
|
virtual bool HasExternalDependencies(TArray<class UStruct*>* OptionalOutput) const override;
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FName GetPaletteIcon(FLinearColor& OutColor) const override{ return TEXT("GraphEditor.SpawnActor_16x"); }
|
2014-08-04 12:39:34 -04:00
|
|
|
virtual bool IsCompatibleWithGraph(const UEdGraph* TargetGraph) const override;
|
2014-12-15 13:14:58 -05:00
|
|
|
virtual void PostPlacedNewNode() override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End UEdGraphNode interface.
|
|
|
|
|
|
|
|
|
|
// Begin UK2Node interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual bool IsNodeSafeToIgnore() const override { return true; }
|
|
|
|
|
virtual void ReallocatePinsDuringReconstruction(TArray<UEdGraphPin*>& OldPins) override;
|
|
|
|
|
virtual void GetNodeAttributes( TArray<TKeyValuePair<FString, FString>>& OutNodeAttributes ) const override;
|
2014-08-23 20:16:29 -04:00
|
|
|
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
2014-07-14 16:05:25 -04:00
|
|
|
virtual FText GetMenuCategory() const override;
|
2014-07-28 12:24:56 -04:00
|
|
|
virtual class FNodeHandlingFunctor* CreateNodeHandler(class FKismetCompilerContext& CompilerContext) const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
// End UK2Node interface
|
|
|
|
|
|
|
|
|
|
|
2014-12-15 13:14:58 -05:00
|
|
|
/**
|
|
|
|
|
* Create new pins to show properties on archetype
|
|
|
|
|
*
|
|
|
|
|
* @param InClass Class to make pins for
|
|
|
|
|
* @param OutClassPins Any pins created through this function will be added to thist list
|
|
|
|
|
*/
|
|
|
|
|
void CreatePinsForClass(UClass* InClass, TArray<UEdGraphPin*>& OutClassPins);
|
2014-03-14 14:13:41 -04:00
|
|
|
/** See if this is a spawn variable pin, or a 'default' pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
bool IsSpawnVarPin(UEdGraphPin* Pin);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Get the then output pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetThenPin() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Get the blueprint input pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetClassPin(const TArray<UEdGraphPin*>* InPinsToSearch=NULL) const;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Get the world context input pin, can return NULL */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetWorldContextPin() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Get the spawn transform input pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetSpawnTransformPin() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Get the spawn NoCollisionFail input pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetNoCollisionFailPin() const;
|
2015-04-16 12:21:07 -04:00
|
|
|
/** Get the actor owner pin */
|
|
|
|
|
UEdGraphPin* GetOwnerPin() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Get the result output pin */
|
2015-01-06 14:19:46 -05:00
|
|
|
UEdGraphPin* GetResultPin() const;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Get the class that we are going to spawn, if it's defined as default value */
|
2015-01-06 14:19:46 -05:00
|
|
|
UClass* GetClassToSpawn(const TArray<UEdGraphPin*>* InPinsToSearch=NULL) const;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-01-06 14:19:46 -05:00
|
|
|
protected:
|
2014-10-02 05:33:25 -04:00
|
|
|
|
|
|
|
|
void OnClassPinChanged();
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Tooltip text for this node. */
|
2014-09-03 18:14:09 -04:00
|
|
|
FText NodeTooltip;
|
2014-09-02 19:08:09 -04:00
|
|
|
|
|
|
|
|
/** Constructing FText strings can be costly, so we cache the node's title */
|
|
|
|
|
FNodeTextCache CachedNodeTitle;
|
2014-03-14 14:13:41 -04:00
|
|
|
};
|