16#include <unordered_set>
19#include "../EditorCommon/EditorAutosaveManager.h"
20#include "../third_party/imnodes/imnodes.h"
45 const std::string& name,
46 const std::string& path)
93 const std::string& displayName);
ComponentTypeID GetComponentTypeID_Static()
ICanvasEditor adapter for ImNodes-based editors (VisualScript)
NodeGraphPanel - ImGui/ImNodes panel for node graph editing Provides visual editor for behavior trees...
void RenderSubgraphTabBar()
Renders the subgraph-aware tab bar above the graph canvas.
const GraphTab * GetActiveTab() const
Returns the GraphTab for the currently active tab.
void CreateNewNode(const char *nodeType, float x, float y)
ImNodesEditorContext * m_imnodesContext
Dedicated imnodes rendering context for this panel instance.
void HandleKeyboardShortcuts()
char m_NewSubgraphNameBuffer[128]
Buffer used by the "New SubGraph" name input popup.
int m_lastActiveGraphId
Graph ID that was active last frame; used to detect graph switches so m_positionedNodes can be cleare...
void CloseSubgraphTab(int index)
Closes the tab at index.
void RenderNodeEditModal()
bool m_SnapToGrid
When true node positions are rounded to the nearest grid cell on move.
float m_SnapGridSize
Grid cell size in canvas units used when snap-to-grid is enabled.
std::vector< GraphTab > m_SubgraphTabs
Ordered list of open subgraph tabs. Index 0 is always the root graph.
void OpenSubgraphTab(const std::string &subgraphUUID, const std::string &displayName)
Opens (or focuses) the subgraph identified by subgraphUUID in a new tab.
GraphNode * m_EditingNode
void RenderActiveLinks(NodeGraph *graph, int graphID)
Overlay glow-coloured lines on links that connect to/from the active debug node, giving a visual "act...
static int s_ActiveDebugNodeId
Backing storage for SetActiveDebugNode: the local node ID currently executing (-1 = none).
char m_NodeNameBuffer[256]
bool m_SuppressGraphTabs
When true, RenderGraphTabs() is skipped (used by BehaviorTreeRenderer)
void RenderNodeProperties()
int m_ActiveSubgraphTabIndex
Index into m_SubgraphTabs of the currently visible tab.
bool m_ShowMinimap
When true the built-in ImNodes minimap is rendered in the bottom-right corner of the node editor canv...
std::unordered_set< int > m_positionedNodes
Tracks which global node UIDs have already had their ImNodes position initialised.
std::string GetActiveSubgraphUUID() const
Returns the subgraph UUID for the active tab, or empty string if the root graph is active.
void SyncNodePositionsFromImNodes(int graphID)
void RenderTypedPin(int attrId, const char *label, bool isInput, bool isExec, const std::unordered_set< int > &connectedAttrIDs={})
Render a single typed attribute pin using ImDrawList shapes.
int GlobalUIDToLocalNodeID(int globalUID, int graphID) const
std::unique_ptr< class ImNodesCanvasEditor > m_canvasEditor
Canvas editor adapter for minimap support (Phase 36) Abstracts imnodes minimap rendering through ICan...
char m_ContextMenuSearch[128]
void HandleNodeInteractions(int graphID)
EditorAutosaveManager m_autosave
Async autosave manager – persists node positions without blocking the UI.
void CreateEmptySubgraph(const std::string &name)
Creates an empty subgraph, inserts it into the active blueprint's data.subgraphs dict,...
void RenderNodePinsAndContent(GraphNode *node, int globalNodeUID, int graphID, const std::unordered_set< int > &connectedAttrIDs={})
Render a single node with a coloured title bar, icon, and typed pins.
void RenderConnectionIndices(NodeGraph *graph, int graphID)
Render execution indices (1, 2, 3, ...n) on connection lines for Sequence and Selector nodes based on...
static void SetActiveDebugNode(int localNodeId)
Set the local node ID that is currently executing.
< Provides AssetID and INVALID_ASSET_ID
Represents one open tab in the NodeGraphPanel tab bar.
std::string graphPath
"root" or "subgraphs/<uuid>"
bool isDirty
True when the graph has unsaved changes.
GraphTab(const std::string &id, const std::string &name, const std::string &path)
std::string displayName
Label shown on the tab ("Root" or subgraph name)
std::string tabID
Unique identifier (UUID or "root")