EdGraphNode_ExtDependency.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Copyright 2017-2021 marynate. All Rights Reserved.
  2. #pragma once
  3. #include "ExtAssetData.h"
  4. #include "CoreMinimal.h"
  5. #include "UObject/ObjectMacros.h"
  6. #include "EdGraph/EdGraphNode.h"
  7. #include "EdGraph_ExtDependencyViewer.h"
  8. #include "EdGraphNode_ExtDependency.generated.h"
  9. class UEdGraphPin;
  10. UCLASS()
  11. class UEdGraphNode_ExtDependency : public UEdGraphNode
  12. {
  13. GENERATED_UCLASS_BODY()
  14. /** Returns first asset identifier */
  15. FExtAssetIdentifier GetIdentifier() const;
  16. /** Returns all identifiers on this node including virtual things */
  17. void GetAllIdentifiers(TArray<FExtAssetIdentifier>& OutIdentifiers) const;
  18. /** Returns only the packages in this node, skips searchable names */
  19. void GetAllPackageNames(TArray<FName>& OutPackageNames) const;
  20. /** Returns our owning graph */
  21. UEdGraph_ExtDependencyViewer* GetDependencyViewerGraph() const;
  22. // UEdGraphNode implementation
  23. virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
  24. FLinearColor GetNodeTitleColor() const override;
  25. virtual FText GetTooltipText() const override;
  26. virtual void AllocateDefaultPins() override;
  27. virtual UObject* GetJumpTargetForDoubleClick() const override;
  28. // End UEdGraphNode implementation
  29. bool UsesThumbnail() const;
  30. bool IsPackage() const;
  31. bool IsCollapsed() const;
  32. bool IsMissingOrInvalid() const;
  33. FExtAssetData GetAssetData() const;
  34. UEdGraphPin* GetDependencyPin();
  35. UEdGraphPin* GetReferencerPin();
  36. private:
  37. void CacheAssetData(const FExtAssetData& AssetData);
  38. void SetupReferenceNode(const FIntPoint& NodeLoc, const TArray<FExtAssetIdentifier>& NewIdentifiers, const FExtAssetData& InAssetData);
  39. void SetReferenceNodeCollapsed(const FIntPoint& NodeLoc, int32 InNumReferencesExceedingMax);
  40. void AddReferencer(class UEdGraphNode_ExtDependency* ReferencerNode);
  41. TArray<FExtAssetIdentifier> Identifiers;
  42. FText NodeTitle;
  43. bool bUsesThumbnail;
  44. bool bIsPackage;
  45. bool bIsPrimaryAsset;
  46. bool bIsCollapsed;
  47. bool bIsMissingOrInvalid;
  48. FExtAssetData CachedAssetData;
  49. UEdGraphPin* DependencyPin;
  50. UEdGraphPin* ReferencerPin;
  51. friend UEdGraph_ExtDependencyViewer;
  52. };