NodeDisplayUtils.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/EntityId.h>
  10. #include <Editor/Nodes/NodeUtils.h>
  11. #include <GraphCanvas/Components/Slots/SlotBus.h>
  12. #include <ScriptCanvas/Bus/NodeIdPair.h>
  13. namespace ScriptCanvas
  14. {
  15. class Slot;
  16. }
  17. namespace ScriptCanvas::Nodes::Core
  18. {
  19. class AzEventHandler;
  20. class EBusEventHandler;
  21. class FunctionCallNode;
  22. class GetVariableNode;
  23. class Method;
  24. class ReceiveScriptEvent;
  25. class SetVariableNode;
  26. class SendScriptEvent;
  27. }
  28. namespace ScriptEvents
  29. {
  30. class Method;
  31. }
  32. namespace ScriptCanvasEditor::Nodes
  33. {
  34. // Generic method of displaying a node.
  35. AZ::EntityId DisplayScriptCanvasNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Node* node);
  36. // Core Node
  37. AZ::EntityId DisplayEbusEventNode(AZ::EntityId graphCanvasGraphId, const AZStd::string& busName, const AZStd::string& eventName, const ScriptCanvas::EBusEventId& eventId);
  38. AZ::EntityId DisplayEbusWrapperNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::EBusEventHandler* busNode);
  39. AZ::EntityId DisplayGetVariableNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::GetVariableNode* variableNode);
  40. AZ::EntityId DisplayMethodNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::Method* methodNode, bool isAccessor = false);
  41. AZ::EntityId DisplaySetVariableNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::SetVariableNode* variableNode);
  42. // AZ Event
  43. AZ::EntityId DisplayAzEventHandlerNode(AZ::EntityId, const ScriptCanvas::Nodes::Core::AzEventHandler* azEventNode);
  44. // Script Events
  45. AZ::EntityId DisplayScriptEventNode(AZ::EntityId graphCanvasGraphId, const AZ::Data::AssetId assetId, const ScriptEvents::Method& methodDefinition);
  46. AZ::EntityId DisplayScriptEventSenderNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::SendScriptEvent* senderNode);
  47. AZ::EntityId DisplayScriptEventWrapperNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::ReceiveScriptEvent* busNode);
  48. // Functions
  49. AZ::EntityId DisplayFunctionNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::FunctionCallNode* functionNode);
  50. AZ::EntityId DisplayFunctionNode(AZ::EntityId graphCanvasGraphId, ScriptCanvas::Nodes::Core::FunctionCallNode* functionNode);
  51. // SlotGroup will control how elements are grouped.
  52. // Invalid will cause the slots to put themselves into whatever category they belong to by default.
  53. AZ::EntityId DisplayScriptCanvasSlot(AZ::EntityId graphCanvasNodeId, const ScriptCanvas::Slot& slot, int slotIndex, GraphCanvas::SlotGroup group = GraphCanvas::SlotGroups::Invalid);
  54. }