Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
Olympe::VisualScriptEditorPanel Class Reference

ImNodes graph editor for ATS Visual Script v4 graphs. More...

#include <VisualScriptEditorPanel.h>

+ Collaboration diagram for Olympe::VisualScriptEditorPanel:

Public Member Functions

 VisualScriptEditorPanel ()
 VisualScriptEditorPanel Constructor.
 
 ~VisualScriptEditorPanel ()
 VisualScriptEditorPanel Destructor.
 
void Initialize ()
 Initialize the editor panel with ImNodes context and UI helpers.
 
void Shutdown ()
 Shutdown the editor panel and release all resources.
 
void Render ()
 Renders the full panel window.
 
void RenderContent ()
 Renders panel content without window wrapper - for fixed layout.
 
bool IsVisible () const
 Returns true if the panel window is visible.
 
void SetVisible (bool v)
 Show / hide the panel.
 
void LoadTemplate (const TaskGraphTemplate *tmpl, const std::string &path)
 Loads a VS graph template into the editor canvas.
 
bool Save ()
 Saves the current canvas state to JSON v4 at the loaded path.
 
bool SaveAs (const std::string &path)
 Saves the current canvas state to a new JSON v4 file.
 
const std::string & GetCurrentPath () const
 Returns the currently loaded file path (empty if unsaved).
 
bool IsDirty () const
 Returns true when there are unsaved modifications.
 
int AddNode (TaskNodeType type, float x, float y)
 Creates a new node on the canvas.
 
void RemoveNode (int nodeID)
 Removes a node from the canvas.
 
void ConnectExec (int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
 Creates an exec connection between two nodes.
 
void ConnectData (int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
 Creates a data connection between two nodes.
 
const TaskGraphTemplateGetTemplate () const
 Returns a reference to the internal template being edited.
 
void RenderVerificationLogsPanel ()
 Public render method for verification logs panel.
 
void ValidateAndCleanBlackboardEntries ()
 Removes blackboard entries with empty keys or VariableType::None.
 
void CommitPendingBlackboardEdits ()
 Commits any pending key-name edits stored in m_pendingBlackboardEdits.
 
void ResetViewportBeforeSave ()
 Resets the ImNodes canvas panning to (0,0) before saving node positions.
 
void AfterSave ()
 Restores the ImNodes canvas panning saved by ResetViewportBeforeSave().
 
ImVec2 ScreenToCanvasPos (ImVec2 screenPos) const
 Converts a screen-space position to canvas (editor) space.
 
BlackboardValidationResult ValidateBlackboardKey (const std::string &key, bool isGlobal, int excludeIndex=-1)
 Validates a blackboard key according to schema rules.
 
bool ValidateBlackboardEntry (const BlackboardEntry &entry)
 Validates a complete blackboard entry.
 
void RenderConditionEditor (Condition &condition, int conditionIndex, const std::vector< BlackboardEntry > &allVars, const std::vector< std::string > &availablePins)
 Renders the full editor UI for one Condition entry on a Branch/While node.
 
void RenderVariableSelector (std::string &selectedVar, const std::vector< BlackboardEntry > &allVars, VariableType expectedType, const char *label)
 Renders a type-filtered variable selector combo box.
 
void RenderConstValueInput (TaskValue &value, VariableType varType, const char *label)
 Renders a type-aware const value input widget.
 
void RenderPinSelector (std::string &selectedPin, const std::vector< std::string > &availablePins, const char *label)
 Renders a pin selector combo box.
 
int AllocNodeID ()
 Allocate a unique node ID.
 
int AllocLinkID ()
 Allocate a unique link ID.
 
int ExecInAttrUID (int nodeID) const
 Maps node ID -> ImNodes attribute UID for an exec-in pin.
 
int ExecOutAttrUID (int nodeID, int pinIndex) const
 Maps node ID + pin index -> ImNodes attribute UID for exec-out pins.
 
int DataInAttrUID (int nodeID, int pinIndex) const
 Maps node ID + data pin index -> ImNodes attribute UID for data-in pins.
 
int DataOutAttrUID (int nodeID, int pinIndex) const
 Maps node ID + data pin index -> ImNodes attribute UID for data-out pins.
 
std::vector< std::string > GetExecOutputPinsForNode (const TaskNodeDefinition &def) const
 Returns exec-out pin names for a node definition, including any dynamically-added pins (VSSequence).
 
void SyncTemplateFromCanvas ()
 Builds the in-memory TaskGraphTemplate from the editor nodes/links.
 
void SyncCanvasFromTemplate ()
 Builds the editor canvas from the in-memory TaskGraphTemplate.
 
void RebuildLinks ()
 Rebuilds ImNodes exec/data link arrays from the template.
 
void SyncEditorNodesFromTemplate ()
 Rebuilds m_editorNodes from m_template, preserving existing node positions.
 
void RemoveLink (int linkID)
 Removes an ImNodes link (and its underlying template connection) by link ID.
 
bool SerializeAndWrite (const std::string &path)
 Serializes the template to JSON v4 and writes to a file.
 
void SyncNodePositionsFromImNodes ()
 Pulls the current node positions from ImNodes into m_editorNodes.
 
void SyncPresetsFromRegistryToTemplate ()
 Syncs ALL presets from the registry to the template.
 
void OnNodeDoubleClicked (int nodeID)
 Handles double-click on a node (opens SubGraph, etc).
 
std::string GetNodeSubGraphPath (const TaskNodeDefinition &def) const
 Extracts SubGraph file path from a node definition.
 

Static Public Member Functions

static std::vector< BlackboardEntryGetVariablesByType (const std::vector< BlackboardEntry > &allVars, VariableType expectedType)
 Returns a filtered subset of blackboard entries matching a type.
 
static std::string BuildConditionPreview (const Condition &cond)
 Builds a human-readable preview string for a condition.
 
static std::vector< std::string > GetExecOutputPins (TaskNodeType type)
 Returns the exec-out pin names for a node type.
 
static std::vector< std::string > GetExecInputPins (TaskNodeType type)
 Returns the exec-in pin names for a node type.
 
static std::vector< std::string > GetDataInputPins (TaskNodeType type)
 Returns the data-in pin names for a node type.
 
static std::vector< std::string > GetDataOutputPins (TaskNodeType type)
 Returns the data-out pin names for a node type.
 

Public Attributes

bool m_visible = true
 
bool m_dirty = false
 
bool m_paletteOpen = false
 
ImNodesEditorContextm_imnodesContext = nullptr
 
bool m_needsPositionSync = false
 
bool m_skipPositionSyncNextFrame = false
 Set to true by Undo/Redo; causes next frame to skip SyncNodePositionsFromImNodes() so that the positions applied by SyncEditorNodesFromTemplate() are not overwritten by stale ImNodes state before the new positions have been rendered once.
 
bool m_justPerformedUndoRedo = false
 Set to true immediately after Undo/Redo; blocks node movement tracking for 1 frame to allow ImNodes to render the new positions before resuming normal position sync.
 
std::string m_currentPath
 
TaskGraphTemplate m_template
 The template currently being edited.
 
std::vector< VSEditorNodem_editorNodes
 Editor nodes (mirrors m_template.Nodes + position/selection state)
 
std::vector< VSEditorLinkm_editorLinks
 Editor links (exec + data)
 
std::unordered_set< intm_positionedNodes
 Nodes for which ImNodes has been given a position.
 
int m_nextNodeID = 1
 Next available node ID.
 
int m_nextLinkID = 1
 Next available ImNodes link ID.
 
int m_selectedNodeID = -1
 Currently selected node (for properties panel)
 
std::vector< std::string > m_validationWarnings
 Validation messages (rebuilt each frame)
 
std::vector< std::string > m_validationErrors
 
VSVerificationResult m_verificationResult
 Latest verification result (produced by RunVerification())
 
bool m_verificationDone = false
 True once RunVerification() has been called at least once for the current graph.
 
std::vector< std::string > m_verificationLogs
 Verification log messages (populated by RunVerification()) Phase 24.3 — for display in the verification output panel.
 
std::vector< std::string > m_simulationTraces
 Simulation execution traces (populated by RunGraphSimulation()) Phase 24.4 — added to verification logs for display.
 
bool m_simulationDone = false
 True if simulation has been run.
 
std::vector< ExecutionTokenm_executionTokenStack
 Phase 24.4 — Execution token stack for multi-branch simulation Enables proper handling of Sequence nodes with multiple branches.
 
int m_focusNodeID = -1
 Node ID to focus/scroll to on next RenderCanvas() frame (-1 = none)
 
float m_contextMenuX = 0.0f
 Right-click paste position.
 
float m_contextMenuY = 0.0f
 
int m_contextNodeID = -1
 Node ID captured at the moment a right-click context menu was opened on a node.
 
int m_contextLinkID = -1
 Link ID captured at the moment a right-click context menu was opened on a link.
 
int m_propEditNodeIDOnFocus = -1
 Node ID that was selected when RenderProperties() last entered focus.
 
std::string m_propEditOldName
 Snapshot values captured at focus time for each editable field.
 
std::string m_propEditOldTaskID
 
std::string m_propEditOldConditionID
 
std::string m_propEditOldBBKey
 
std::string m_propEditOldMathOp
 
std::string m_propEditOldSubGraphPath
 
float m_propEditOldDelay = 0.0f
 
std::string m_propEditSwitchVar
 Live buffer for switchVariable field.
 
std::vector< SwitchCaseDefinitionm_propEditSwitchCases
 Per-case label edit buffers.
 
UndoRedoStack m_undoStack
 Undo/Redo command stack for reversible graph editing operations.
 
bool m_pendingAddPin = false
 Pending dynamic pin addition (from [+] button clicked in canvas)
 
int m_pendingAddPinNodeID = -1
 
bool m_pendingRemovePin = false
 Pending dynamic pin removal (from [-] button clicked in canvas)
 
int m_pendingRemovePinNodeID = -1
 
int m_pendingRemovePinDynIdx = -1
 0-based index in DynamicExecOutputPins
 
std::unordered_map< int, std::pair< float, float > > m_nodeDragStartPositions
 Per-node drag-start positions used to record a single MoveNodeCommand per drag gesture instead of one command per frame.
 
bool m_pendingNodeDrop = false
 True when a node drop is pending processing this frame.
 
TaskNodeType m_pendingNodeType = TaskNodeType::EntryPoint
 
float m_pendingNodeX = 0.0f
 
float m_pendingNodeY = 0.0f
 
bool m_showSaveAsDialog = false
 True when the "Save As" modal should be opened next frame.
 
char m_saveAsFilename [256]
 Buffer for the user-entered filename (without extension)
 
std::string m_saveAsDirectory = "Blueprints/AI"
 Currently selected destination directory.
 
std::string m_saveAsExtension = ".ats"
 Extension to append when saving (derived from m_currentPath; defaults to ".ats")
 
std::unordered_map< int, std::string > m_pendingBlackboardEdits
 Deferred key-name edits for blackboard entries: index -> pending new key.
 
float m_propertiesPanelWidth = 0.0f
 Width of the properties+blackboard panel on the right.
 
float m_nodePropertiesPanelHeight = 0.0f
 Height of the Node Properties panel (Part A) in the right panel.
 
float m_presetBankPanelHeight = 0.0f
 Height of the Preset Bank panel (Part B) in the right panel.
 
float m_verificationLogsPanelHeight = 0.0f
 Height of the Verification Logs panel in the left panel (Blueprint Files).
 
Vector m_lastViewportPanning = Vector(0.0f, 0.0f)
 Canvas panning saved by ResetViewportBeforeSave() for restoration in AfterSave().
 
bool m_viewportResetDone = false
 True after ResetViewportBeforeSave() has been called and before AfterSave().
 
ConditionPresetRegistry m_presetRegistry
 Global registry of ConditionPreset objects.
 
std::unique_ptr< DynamicDataPinManagerm_pinManager
 Dynamic pin manager shared across all Branch nodes in this panel.
 
std::unique_ptr< NodeBranchRendererm_branchRenderer
 Specialized renderer for Branch nodes (4-section layout with conditions).
 
std::unique_ptr< NodeConditionsPanelm_conditionsPanel
 Properties-panel sub-widget for the selected Branch node.
 
std::unique_ptr< MathOpPropertyPanelm_mathOpPanel
 Properties-panel sub-widget for the selected MathOp node.
 
std::unique_ptr< GetBBValuePropertyPanelm_getBBPanel
 Properties-panel sub-widget for the selected GetBBValue node.
 
std::unique_ptr< SetBBValuePropertyPanelm_setBBPanel
 Properties-panel sub-widget for the selected SetBBValue node.
 
std::unique_ptr< VariablePropertyPanelm_variablePanel
 Properties-panel sub-widget for the selected Variable node (data pure).
 
std::unique_ptr< ConditionPresetLibraryPanelm_libraryPanel
 Global condition preset library panel (UI for creating/editing/deleting presets).
 
std::unique_ptr< SwitchCaseEditorModalm_switchCaseModal
 Phase 26 — Switch Case Editor Modal.
 
std::unique_ptr< SubGraphFilePickerModalm_subGraphModal
 Phase 26 — SubGraph File Picker Modal.
 
int m_condPanelNodeID = -1
 ID of the node currently loaded into m_conditionsPanel (-1 = none).
 
std::unique_ptr< EntityBlackboardm_entityBlackboard
 Per-entity blackboard instance (combines local + global variables) Created in Initialize() and manages scope-aware access to both local and global vars.
 
int m_rightPanelTabSelection = 0
 Phase 26 — Right panel tab selection 0 = Presets, 1 = Local Variables, 2 = Global Variables.
 
int m_topPanelTabSelection = 0
 Top panel tab selection (Part A of right panel) 0 = Properties, 1 = Nodes.
 
SelectionEffectRenderer m_selectionRenderer
 Renders glow effect for selected nodes (cyan halo + thickened border).
 
std::unique_ptr< ImNodesCanvasEditorm_canvasEditor
 Canvas editor adapter for minimap support (Phase 37) Abstracts imnodes minimap rendering through ICanvasEditor interface.
 
bool m_minimapVisible = true
 Minimap visibility flag for VisualScript canvas.
 
float m_minimapSize = 0.15f
 Minimap size ratio (0.05-0.5 of canvas)
 
int m_minimapPosition = 1
 Minimap position (0=TopLeft, 1=TopRight, 2=BottomLeft, 3=BottomRight)
 
int m_lastClickNodeID = -1
 Node ID of the last left-click (for double-click detection)
 
float m_lastClickTime = 0.0f
 Frame time of the last left-click (seconds, from ImGui::GetTime())
 

Static Public Attributes

static constexpr float DOUBLE_CLICK_THRESHOLD = 0.3f
 Threshold for detecting double-click (300ms)
 

Private Member Functions

void PerformUndo ()
 Undoes the last command and syncs the canvas (nodes + links).
 
void PerformRedo ()
 Re-applies the last undone command and syncs the canvas.
 
void RenderToolbar ()
 
void RenderSaveAsDialog ()
 
void RenderCanvas ()
 
void RenderNodePalette ()
 
void RenderContextMenus ()
 Render node/link context menus opened by right-click detection.
 
void RenderProperties ()
 
void RenderGlobalVariablesPanel ()
 Phase 24 Global Blackboard — Renders global variables panel.
 
void RenderBranchNodeProperties (VSEditorNode &eNode, TaskNodeDefinition &def)
 Renders the Properties panel content for a selected Branch (or While) node.
 
void RenderMathOpNodeProperties (VSEditorNode &eNode, TaskNodeDefinition &def)
 Renders the Properties panel content for a selected MathOp node.
 
void RenderSwitchNodeProperties (VSEditorNode &eNode, TaskNodeDefinition &def)
 Renders the Properties panel content for a selected Switch node (Phase 1).
 
void RenderNodeDataParameters (TaskNodeDefinition &def)
 Renders node parameters for data nodes (GetBBValue, SetBBValue, MathOp).
 
void RenderBlackboard ()
 
void RenderValidationOverlay ()
 
void RenderBreakpoints ()
 
void RenderNodePropertiesPanel ()
 Part A: Node Properties panel (top-left of right panel)
 
void RenderNodePropertiesPanelContent ()
 Phase 31 — Content of Properties tab in Part A.
 
void RenderAvailableNodesList ()
 Phase 31 — Nodes list tab in Part A (available nodes for dragging to canvas)
 
void RenderWhileNodeProperties ()
 Phase 24 — Property panel renderers for While, ForEach, and SubGraph nodes.
 
void RenderForEachNodeProperties ()
 
void RenderSubGraphNodeProperties ()
 
void RenderPresetBankPanel ()
 Part B: Preset Bank panel (middle of right panel)
 
void RenderPresetItemCompact (const ConditionPreset &preset, size_t index)
 Render a single preset item in compact horizontal format with index.
 
void RenderRightPanelTabs ()
 Phase 26 — Tab system: Renders the tab bar for the 3-panel right section Displays tabs for Presets, Local Variables, and Global Variables.
 
void RenderRightPanelTabContent ()
 Phase 26 — Tab system: Renders the content of the active tab Dispatches to appropriate render function based on m_rightPanelTabSelection.
 
bool RenderOperandEditor (Operand &operand, const char *labelSuffix)
 Render a single operand with dropdown for mode and value editor Returns true if the operand was modified.
 
void RenderLocalVariablesPanel ()
 Part C: Local Variables reference panel (bottom of right panel)
 
void RenderVerificationPanel ()
 Renders the verification results panel (Phase 21-B).
 
void RunVerification ()
 Runs VSGraphVerifier on the current graph and stores the result.
 
void RunGraphSimulation ()
 Simulates runtime execution of the current graph and logs traces.
 
void RunGraphSimulationRecursive (const TaskGraphTemplate *tmpl, std::map< std::string, TaskValue > &blackboard, std::unordered_set< std::string > &visitedGraphs, int recursionDepth, const std::string &traceIndent)
 Internal recursive simulation function with cycle detection.
 
void EvaluateDataNode (int32_t nodeID, int depth, const std::string &indent)
 Helper to recursively evaluate data nodes (MathOp, GetBBValue, etc.) and trace their execution.
 
void TraceUpstreamDataNodes (int32_t sourceNodeID, const std::string &indent, std::unordered_set< int > &visitedDataNodes)
 Recursively traces all upstream pure data nodes in the graph.
 
std::string GetNodePropertyString (const TaskNodeDefinition &node)
 Gets a comprehensive property string for any node type.
 
std::string FormatTaskParameters (const std::unordered_map< std::string, ParameterBinding > &parameters, const std::string &indent)
 Format task parameters into a readable string.
 

Detailed Description

ImNodes graph editor for ATS Visual Script v4 graphs.

Typical usage:

// Editor initialization
// Each frame
if (panel.IsVisible())
panel.Render();
// Shutdown
panel.Shutdown();
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
ImNodes graph editor for ATS Visual Script v4 graphs.
void Initialize()
Initialize the editor panel with ImNodes context and UI helpers.

Definition at line 136 of file VisualScriptEditorPanel.h.

Constructor & Destructor Documentation

◆ VisualScriptEditorPanel()

Olympe::VisualScriptEditorPanel::VisualScriptEditorPanel ( )

VisualScriptEditorPanel Constructor.

Initializes the save-as filename buffer with a default "untitled_graph" name. This is called when a new editor panel tab is created for editing a blueprint graph.

Note
The ImNodes editor context and UI helper panels are NOT created here. They are initialized in Initialize() to ensure proper resource management and context isolation per panel instance.

Definition at line 42 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and m_saveAsFilename.

+ Here is the call graph for this function:

◆ ~VisualScriptEditorPanel()

Olympe::VisualScriptEditorPanel::~VisualScriptEditorPanel ( )

VisualScriptEditorPanel Destructor.

Cleanup is deferred to Shutdown() to ensure proper sequencing of resource deallocation in the context of a tabbed editor interface.

Note
Do NOT manually delete m_imnodesContext or UI helper panels here. Always call Shutdown() first to free resources in correct order.
See also
Shutdown()

Definition at line 48 of file VisualScriptEditorPanel - backup.cpp.

Member Function Documentation

◆ AddNode()

int Olympe::VisualScriptEditorPanel::AddNode ( TaskNodeType  type,
float  x,
float  y 
)

Creates a new node on the canvas.

Create a new node and add it to the editor canvas and template graph.

Parameters
typeNode type.
xCanvas X position.
yCanvas Y position.
Returns
The new node's ID.

Allocates a new unique node ID, creates a TaskNodeDefinition with type-specific initialization, and pushes an AddNodeCommand to the undo stack for reversibility.

For special node types, this method initializes data pins:

  • MathOp: Creates input pins "A" and "B" (Float type), output pin "Result"
  • GetBBValue: Creates output pin "Value" (type determined by variable selection)
  • SetBBValue: Creates input pin "Value" (type determined by variable target)

EntryPoint Special Case: If this is the first EntryPoint created, it is marked as the template's entry and root node (m_template.EntryPointID and m_template.RootNodeID).

Position Validation: Non-finite or out-of-range coordinates are clamped to prevent JSON corruption or viewport issues. Clamped coordinates default to (0, 0).

Undo/Redo Integration: The node is added to both the editor canvas (m_editorNodes) and the template model via AddNodeCommand, ensuring Ctrl+Z removes the node.

Parameters
typeThe TaskNodeType to create (EntryPoint, Branch, MathOp, etc.)
xCanvas X position (will be clamped to [-100000, 100000])
yCanvas Y position (will be clamped to [-100000, 100000])
Returns
int Allocated node ID (guaranteed unique for this editor session)
Note
Phase 24.2: Data pins for MathOp/GetBBValue/SetBBValue initialized on creation
EntryPoint nodes are singleton — multiple creates set the same root node
Position parameters are stored in Parameters["__posX"] and Parameters["__posY"] for redo operations to restore the original placement
Sets m_dirty = true and m_verificationDone = false to trigger re-verification
See also
RemoveNode(), AllocNodeID(), AddNodeCommand, TaskNodeDefinition

Definition at line 284 of file VisualScriptEditorPanel - backup.cpp.

References AllocNodeID(), Olympe::MathOpOperand::Const, Olympe::MathOpOperand::constValue, Olympe::TaskNodeDefinition::DataPins, Olympe::EntryPoint, Olympe::TaskGraphTemplate::EntryPointID, Olympe::Float, Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::GetNodeTypeLabel(), Olympe::Input, Olympe::MathOpRef::leftOperand, Olympe::Literal, m_dirty, m_editorNodes, m_template, m_undoStack, m_verificationDone, Olympe::MathOp, Olympe::MathOpRef::mathOperator, Olympe::TaskNodeDefinition::mathOpRef, Olympe::MathOpOperand::mode, Olympe::NODE_INDEX_NONE, Olympe::VSEditorNode::nodeID, Olympe::TaskNodeDefinition::NodeID, Olympe::TaskNodeDefinition::NodeName, Olympe::None, Olympe::Output, Olympe::TaskNodeDefinition::Parameters, Olympe::DataPinDefinition::PinName, Olympe::UndoRedoStack::PushCommand(), Olympe::MathOpRef::rightOperand, Olympe::TaskGraphTemplate::RootNodeID, Olympe::SetBBValue, SYSTEM_LOG, Olympe::ParameterBinding::Type, and Olympe::TaskNodeDefinition::Type.

+ Here is the call graph for this function:

◆ AfterSave()

void Olympe::VisualScriptEditorPanel::AfterSave ( )

Restores the ImNodes canvas panning saved by ResetViewportBeforeSave().

AfterSave.

BUG-003 Fix #5 (optional UX continuity): call after SerializeAndWrite() so the viewport does not visually jump for the user.

Restore the ImNodes viewport panning to its pre-save state. This completes BUG-003 fix #5: viewport restoration.

Called at the end of Save() / SaveAs() after serialization completes. Without this restoration, the user would see the canvas visually jump to (0, 0) panning every time they save.

If ResetViewportBeforeSave() was not called (or Save cancelled), this is a no-op (guarded by m_viewportResetDone flag).

Definition at line 1853 of file VisualScriptEditorPanel - backup.cpp.

References SYSTEM_LOG.

Referenced by Save(), and SaveAs().

+ Here is the caller graph for this function:

◆ AllocLinkID()

int Olympe::VisualScriptEditorPanel::AllocLinkID ( )

Allocate a unique link ID.

Returns the next available link ID and increments the internal counter. Each connection between nodes must have a unique ID for:

  • ImNodes link tracking
  • Link validation and lookup
  • Undo/redo serialization
Returns
int Next available link ID (starting from 0)
Note
Like node IDs, link IDs are never reused to maintain consistency across undo/redo operations and command history.
See also
AddLink(), RemoveLink()

Definition at line 172 of file VisualScriptEditorPanel - backup.cpp.

References m_nextLinkID.

Referenced by RebuildLinks().

+ Here is the caller graph for this function:

◆ AllocNodeID()

int Olympe::VisualScriptEditorPanel::AllocNodeID ( )

Allocate a unique node ID.

Returns the next available node ID and increments the internal counter. Each node in the editor canvas must have a unique ID for:

  • ImNodes attribute UID generation (nodeID * 10000 + offset)
  • Node lookup in editor node list
  • Serialization and deserialization
Returns
int Next available node ID (starting from 0)
Note
IDs are never reused; once a node is deleted, its ID is permanently consumed. This prevents potential ID collisions in undo/redo stacks.
See also
AddNode(), RemoveNode()

Definition at line 167 of file VisualScriptEditorPanel - backup.cpp.

References m_nextNodeID.

Referenced by AddNode().

+ Here is the caller graph for this function:

◆ BuildConditionPreview()

std::string Olympe::VisualScriptEditorPanel::BuildConditionPreview ( const Condition cond)
static

Builds a human-readable preview string for a condition.

Format: "[Left] <op> [Right]", e.g. "[Var: health] > [Const: 50]".

Parameters
condThe condition to describe.
Returns
Preview string.

Definition at line 4901 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ CommitPendingBlackboardEdits()

void Olympe::VisualScriptEditorPanel::CommitPendingBlackboardEdits ( )

Commits any pending key-name edits stored in m_pendingBlackboardEdits.

CommitPendingBlackboardEdits.

Flushes deferred InputText changes so that the template reflects the most recent user input before Save is attempted.

Flush any deferred blackboard entry key-name edits to the template. When the user is editing a variable key name in the UI, the change is stored in m_pendingBlackboardEdits (a map of index -> new key name) to defer costly operations until the edit is complete or save is triggered.

This method is called before serialization (Save/SaveAs) to ensure all user edits are persisted. After flushing, m_pendingBlackboardEdits is cleared.

Bounds checking is performed to prevent out-of-range access.

Definition at line 1820 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and Key.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConnectData()

void Olympe::VisualScriptEditorPanel::ConnectData ( int  srcNodeID,
const std::string &  srcPinName,
int  dstNodeID,
const std::string &  dstPinName 
)

Creates a data connection between two nodes.

Create a data pin connection (value link) between two nodes.

Connects a data output pin on a source node to a data input pin on a destination node. Data connections carry computed or retrieved values (not control flow).

Data-Pure Nodes: Phase 24 introduces data-pure nodes that have no execution pins but only data connections:

  • GetBBValue: Retrieves a blackboard variable -> outputs "Value"
  • MathOp: Computes arithmetic result -> inputs "A", "B"; outputs "Result"

These nodes can be chained to build data flow networks independent of control flow.

Dynamic Data Pins: Branch nodes have dynamic input pins (Pin-in) derived from their condition definitions. Condition names become pin names for data connections.

Undo/Redo Integration: The connection is pushed as an AddDataConnectionCommand, enabling Ctrl+Z to remove the link.

Pin Naming: Pin names are semantic strings:

  • Standard outputs: "Value" (GetBBValue), "Result" (MathOp)
  • Standard inputs: "Value" (SetBBValue), "A"/"B" (MathOp)
  • Dynamic pins (Branch): Condition names (e.g., "IsAlive", "HasAmmo")
Parameters
srcNodeIDID of the source node (must be valid)
srcPinNameName of the data output pin (must match GetDataOutputPins or dynamic pins)
dstNodeIDID of the destination node (must be valid)
dstPinNameName of the data input pin (must match GetDataInputPins or dynamic pins)
Note
Sets m_dirty = true and m_verificationDone = false to trigger verification
The connection is stored in m_template.DataConnections
Pin names are case-sensitive and must exactly match node definitions
Phase 24: Data-pure nodes enable functional data flow composition
See also
ConnectExec(), GetDataOutputPins(), GetDataInputPins(), AddDataConnectionCommand

Definition at line 433 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), m_dirty, m_template, m_undoStack, m_verificationDone, Olympe::UndoRedoStack::PushCommand(), RebuildLinks(), and Olympe::DataPinConnection::SourceNodeID.

+ Here is the call graph for this function:

◆ ConnectExec()

void Olympe::VisualScriptEditorPanel::ConnectExec ( int  srcNodeID,
const std::string &  srcPinName,
int  dstNodeID,
const std::string &  dstPinName 
)

Creates an exec connection between two nodes.

Create an execution pin connection (flow link) between two nodes.

Parameters
srcNodeIDSource node ID.
srcPinNameSource exec-out pin name (e.g. "Then").
dstNodeIDDestination node ID.
dstPinNameDestination exec-in pin name (usually "In").

Connects an output execution pin on a source node to an input execution pin on a destination node. Execution connections control the control flow (order of execution) in the task graph.

This method validates neither the source nor destination — validation is handled by CanCreateLink() or other connection validation logic in RenderCanvas().

Undo/Redo Integration: The connection is pushed to the undo stack as an AddConnectionCommand, enabling Ctrl+Z to remove the link.

Link Rebuilding: After creating the connection, RebuildLinks() synchronizes ImNodes with the new template state so the visual link appears on screen.

Pin Naming: Pin names are semantic strings:

  • For exec-out: "Out", "Then", "Else", "Loop", "Loop Body", "Completed", etc.
  • For exec-in: "In" (most nodes) or "Loop" (While loops)
  • Dynamic pins (VSSequence/Switch): "Out_2", "Out_3", "Case_1", "Case_2", etc.
Parameters
srcNodeIDID of the source node (must be valid)
srcPinNameName of the output execution pin (must match GetExecOutputPins)
dstNodeIDID of the destination node (must be valid)
dstPinNameName of the input execution pin (must match GetExecInputPins)
Note
Sets m_dirty = true and m_verificationDone = false to trigger verification
The connection is stored in m_template.ExecConnections
Pin names are case-sensitive and must exactly match node definitions
See also
ConnectData(), GetExecOutputPins(), GetExecInputPins(), AddConnectionCommand

Definition at line 413 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), m_dirty, m_template, m_undoStack, m_verificationDone, Olympe::UndoRedoStack::PushCommand(), RebuildLinks(), and Olympe::ExecPinConnection::SourceNodeID.

+ Here is the call graph for this function:

◆ DataInAttrUID()

int Olympe::VisualScriptEditorPanel::DataInAttrUID ( int  nodeID,
int  pinIndex 
) const

Maps node ID + data pin index -> ImNodes attribute UID for data-in pins.

Generate a unique attribute UID for a data input pin of a node.

Formula: nodeID * 10000 + 200 + pinIndex

Data input pins carry variable/parameter values from other nodes:

  • MathOp -> {"A", "B"} (input operands for mathematical expressions)
  • SetBBValue -> {"Value"} (the value to store in blackboard)
  • Branch -> Dynamic condition pins

Data pins are distinct from execution pins and can coexist on the same node.

Parameters
nodeIDThe node's unique ID
pinIndexThe index of the input pin (0–99)
Returns
int Unique attribute UID for the specific data-in pin
Note
Supports up to 100 data input pins per node (offset range: 200–299). Index 0–99 allows sufficient room for typical data-heavy nodes.
See also
ExecInAttrUID(), ExecOutAttrUID(), DataOutAttrUID()

Definition at line 195 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by RebuildLinks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DataOutAttrUID()

int Olympe::VisualScriptEditorPanel::DataOutAttrUID ( int  nodeID,
int  pinIndex 
) const

Maps node ID + data pin index -> ImNodes attribute UID for data-out pins.

Generate a unique attribute UID for a data output pin of a node.

Formula: nodeID * 10000 + 300 + pinIndex

Data output pins carry computed or retrieved values to downstream nodes:

  • GetBBValue -> {"Value"} (the retrieved variable value)
  • MathOp -> {"Result"} (the computed result)
  • Dynamic operand outputs (from condition presets)
Parameters
nodeIDThe node's unique ID
pinIndexThe index of the output pin (0–99)
Returns
int Unique attribute UID for the specific data-out pin
Note
Supports up to 100 data output pins per node (offset range: 300–399).
See also
ExecInAttrUID(), ExecOutAttrUID(), DataInAttrUID()

Definition at line 200 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by RebuildLinks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EvaluateDataNode()

void Olympe::VisualScriptEditorPanel::EvaluateDataNode ( int32_t  nodeID,
int  depth,
const std::string &  indent 
)
private

Helper to recursively evaluate data nodes (MathOp, GetBBValue, etc.) and trace their execution.

Used when data pins reference other nodes.

Parameters
nodeIDID of the data node to evaluate
depthCurrent trace indentation depth
indentIndentation string prefix for logs

Definition at line 1400 of file VisualScriptEditorPanel_Verification.cpp.

References ADD_TRACE, Olympe::MathOpOperand::Const, Olympe::GetBBValue, GetComponentTypeID_Static(), m_template, Olympe::MathOp, Olympe::TaskGraphTemplate::Nodes, Olympe::MathOpOperand::Pin, and Olympe::MathOpOperand::Variable.

+ Here is the call graph for this function:

◆ ExecInAttrUID()

int Olympe::VisualScriptEditorPanel::ExecInAttrUID ( int  nodeID) const

Maps node ID -> ImNodes attribute UID for an exec-in pin.

Generate a unique attribute UID for the execution input pin of a node.

Formula: nodeID * 10000 + 0

The execution input (or "In" pin) is where the node receives execution flow from previous nodes. Only one exec-in pin per node is allowed.

Parameters
nodeIDThe node's unique ID
Returns
int Unique attribute UID for the node's exec-in pin
Note
Returns the same value for the same nodeID (deterministic, reversible formula). ImNodes uses this UID to identify pin endpoints for links.
See also
ExecOutAttrUID(), DataInAttrUID(), DataOutAttrUID()

Definition at line 185 of file VisualScriptEditorPanel - backup.cpp.

Referenced by RebuildLinks().

+ Here is the caller graph for this function:

◆ ExecOutAttrUID()

int Olympe::VisualScriptEditorPanel::ExecOutAttrUID ( int  nodeID,
int  pinIndex 
) const

Maps node ID + pin index -> ImNodes attribute UID for exec-out pins.

Generate a unique attribute UID for an execution output pin of a node.

Formula: nodeID * 10000 + 100 + pinIndex

Execution output pins (or "Out" pins) are where the node sends execution flow to downstream nodes. A node may have multiple exec-out pins for control flow:

  • EntryPoint -> {"Out"}
  • Branch -> {"Then", "Else"}
  • While -> {"Loop", "Completed"}
  • Switch -> {"Case_0", "Case_1", ...}
Parameters
nodeIDThe node's unique ID
pinIndexThe index of the output pin (0–99)
Returns
int Unique attribute UID for the specific exec-out pin
Note
Supports up to 100 execution output pins per node (offset range: 100–199).
See also
ExecInAttrUID(), DataInAttrUID(), DataOutAttrUID()

Definition at line 190 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by RebuildLinks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FormatTaskParameters()

std::string Olympe::VisualScriptEditorPanel::FormatTaskParameters ( const std::unordered_map< std::string, ParameterBinding > &  parameters,
const std::string &  indent 
)
private

Format task parameters into a readable string.

Extracts parameter names and values for display in traces.

Parameters
parametersParameter binding map from a task node
indentIndentation string prefix for formatting
Returns
Formatted parameter string

Definition at line 1469 of file VisualScriptEditorPanel_Verification.cpp.

References GetComponentTypeID_Static(), Olympe::Literal, Olympe::ParameterBinding::LiteralValue, Olympe::LocalVariable, and Olympe::TaskValue::to_string().

+ Here is the call graph for this function:

◆ GetCurrentPath()

const std::string & Olympe::VisualScriptEditorPanel::GetCurrentPath ( ) const
inline

Returns the currently loaded file path (empty if unsaved).

Definition at line 189 of file VisualScriptEditorPanel.h.

References m_currentPath.

Referenced by Olympe::VisualScriptRenderer::GetCurrentPath().

+ Here is the caller graph for this function:

◆ GetDataInputPins()

std::vector< std::string > Olympe::VisualScriptEditorPanel::GetDataInputPins ( TaskNodeType  type)
static

Returns the data-in pin names for a node type.

Get the static data input pins for a given node type.

Returns a list of pin names that represent VALUE inputs to a node. Data pins are distinct from execution pins and carry variable values:

  • SetBBValue: {"Value"} — the value to store in the blackboard
  • MathOp: {"A", "B"} — left and right operands
  • Branch: {} — uses ONLY dynamic data-in pins (no static condition pin) to avoid pin name conflicts when conditions are edited
  • All others: {} — no standard data inputs

Phase 24 Notes:

  • Branch nodes use only dynamic pins generated from condition definitions
  • This allows Branch conditions to be added/removed without hardcoded pin lists
  • No static "Condition" pin is present to prevent naming conflicts
Parameters
typeThe node type to query
Returns
std::vector<std::string> List of data input pin names
Note
Data pins are independent of execution pins; a node can have both types
See also
GetDataOutputPins(), DataInAttrUID()

Definition at line 257 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::Branch, Olympe::MathOp, and Olympe::SetBBValue.

Referenced by RebuildLinks(), and RemoveLink().

+ Here is the caller graph for this function:

◆ GetDataOutputPins()

std::vector< std::string > Olympe::VisualScriptEditorPanel::GetDataOutputPins ( TaskNodeType  type)
static

Returns the data-out pin names for a node type.

Get the static data output pins for a given node type.

Returns a list of pin names that represent VALUE outputs from a node. Data pins carry computed or retrieved values to downstream nodes:

  • GetBBValue: {"Value"} — the retrieved variable value
  • MathOp: {"Result"} — the computed arithmetic result
  • All others: {} — no standard data outputs

Phase 24 Notes:

  • GetBBValue is a data-pure node (no exec-in/out, only data-out)
  • MathOp is a data-pure node (no exec-in/out, only data in/out)
  • These nodes are used to build data flow networks without control flow
Parameters
typeThe node type to query
Returns
std::vector<std::string> List of data output pin names
See also
GetDataInputPins(), DataOutAttrUID()

Definition at line 270 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::GetBBValue, and Olympe::MathOp.

Referenced by RebuildLinks(), and RemoveLink().

+ Here is the caller graph for this function:

◆ GetExecInputPins()

std::vector< std::string > Olympe::VisualScriptEditorPanel::GetExecInputPins ( TaskNodeType  type)
static

Returns the exec-in pin names for a node type.

Get the static execution input pins for a given node type.

Returns a list of pin names that represent the execution control flow INTO a node. Most nodes have a single "In" pin, but some special nodes have no exec-in:

  • EntryPoint: No exec-in (it's the entry to the graph)
  • GetBBValue: No exec-in (data-pure node, no control flow)
  • MathOp: No exec-in (data-pure node, no control flow)

All other node types receive execution from upstream via an "In" pin.

Parameters
typeThe node type to query
Returns
std::vector<std::string> List of exec input pin names (usually empty or {"In"})
Note
Phase 24.2: GetBBValue and MathOp are data-pure, not control-flow nodes
See also
GetExecOutputPins(), ExecInAttrUID()

Definition at line 209 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::EntryPoint, Olympe::GetBBValue, and Olympe::MathOp.

Referenced by RemoveLink().

+ Here is the caller graph for this function:

◆ GetExecOutputPins()

std::vector< std::string > Olympe::VisualScriptEditorPanel::GetExecOutputPins ( TaskNodeType  type)
static

Returns the exec-out pin names for a node type.

Get the static execution output pins for a given node type.

Returns a list of pin names that represent the execution control flow OUT OF a node. Different node types have different numbers of exec-out pins based on their semantics:

  • EntryPoint: {"Out"} — single flow entry
  • Branch: {"Then", "Else"} — conditional split
  • While: {"Loop", "Completed"} — loop control
  • ForEach: {"Loop Body", "Completed"} — iteration control
  • DoOnce: {"Out"} — single output
  • Delay: {"Completed"} — async completion
  • SubGraph: {"Completed"} — subgraph completion
  • VSSequence: {"Out"} — sequence step (may have dynamic pins)
  • Switch: {"Case_0"} — multi-way branch (may have dynamic pins)
  • AtomicTask: {"Completed"} — action completion
  • GetBBValue: {} — data-pure node (no exec-out)
  • SetBBValue: {"Completed"} — update completion
  • MathOp: {} — data-pure node (no exec-out)

VSSequence and Switch nodes may add dynamic pins at runtime, so use GetExecOutputPinsForNode() to include those.

Parameters
typeThe node type to query
Returns
std::vector<std::string> List of exec output pin names
Note
Phase 24.2: GetBBValue and MathOp are data-pure, not control-flow nodes
See also
GetExecOutputPinsForNode(), GetExecInputPins(), ExecOutAttrUID()

Definition at line 224 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::AtomicTask, Olympe::Branch, Olympe::Delay, Olympe::DoOnce, Olympe::EntryPoint, Olympe::ForEach, Olympe::GetBBValue, Olympe::MathOp, Olympe::SetBBValue, Olympe::SubGraph, Olympe::Switch, Olympe::VSSequence, and Olympe::While.

Referenced by GetExecOutputPinsForNode(), RebuildLinks(), and RemoveLink().

+ Here is the caller graph for this function:

◆ GetExecOutputPinsForNode()

std::vector< std::string > Olympe::VisualScriptEditorPanel::GetExecOutputPinsForNode ( const TaskNodeDefinition def) const

Returns exec-out pin names for a node definition, including any dynamically-added pins (VSSequence).

Get execution output pins for a node, including dynamic pins.

This is the full version of GetExecOutputPins() that accounts for dynamically added pins. Some node types (VSSequence, Switch) can have user-added exec-out pins that are not in the static list:

  • VSSequence nodes may have "Out_2", "Out_3", etc. added by the user
  • Switch nodes may have "Case_1", "Case_2", etc. added by the user

For all other node types, this returns the same as GetExecOutputPins().

IMPORTANT ARCHITECTURE NOTE (Phase 1-3 Unification Fix): ───────────────────────────────────────────────────────── DynamicExecOutputPins is a DERIVED CACHE that must be kept synchronized with the semantic authority data (switchCases for Switch nodes, sequenceSteps for VSSequence).

SOURCES OF TRUTH:

  • Switch: switchCases[] (semantic data with values, labels) → Authority
  • VSSequence: sequenceSteps[] (if applicable) → Authority

DERIVED (Auto-Generated):

  • DynamicExecOutputPins[] (pin names only, used for rendering)

REGENERATION TRIGGERS: Phase 1 (Properties): After modal Apply, regenerated in RenderSwitchNodeProperties() Phase 2 (Load): After loading from JSON in TaskGraphLoader::ParseNodeV4() Phase 3 (Canvas): Modal opened for safe editing instead of direct modification

DEPRECATED DIRECT MODIFICATION: Do NOT modify DynamicExecOutputPins directly (except for VSSequence which has its own direct-add system). Always use the modal for Switch nodes.

Parameters
defThe node definition to query
Returns
std::vector<std::string> List of exec output pin names including dynamic pins
Note
Required for accurate pin counting during rendering and UID generation
See also
GetExecOutputPins(), RenderSwitchNodeProperties(), TaskGraphLoader::ParseNodeV4()

Definition at line 245 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskNodeDefinition::DynamicExecOutputPins, GetComponentTypeID_Static(), GetExecOutputPins(), Olympe::Switch, Olympe::TaskNodeDefinition::Type, and Olympe::VSSequence.

+ Here is the call graph for this function:

◆ GetNodePropertyString()

std::string Olympe::VisualScriptEditorPanel::GetNodePropertyString ( const TaskNodeDefinition node)
private

Gets a comprehensive property string for any node type.

Returns all relevant properties formatted for display in traces.

Parameters
nodeThe node definition to describe
Returns
Formatted property string with all relevant fields

Definition at line 1633 of file VisualScriptEditorPanel_Verification.cpp.

References Olympe::AtomicTask, Olympe::Branch, Olympe::Delay, Olympe::DoOnce, Olympe::EntryPoint, Olympe::ForEach, Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::MathOp, Olympe::SetBBValue, Olympe::SubGraph, Olympe::Switch, Olympe::VSSequence, and Olympe::While.

Referenced by RunGraphSimulation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNodeSubGraphPath()

std::string Olympe::VisualScriptEditorPanel::GetNodeSubGraphPath ( const TaskNodeDefinition def) const

Extracts SubGraph file path from a node definition.

Parameters
defThe node definition to check.
Returns
The SubGraphPath if node is SubGraph type and path is set, else empty string.

Returns the SubGraphPath if the node is a SubGraph type and has a valid path set. Otherwise returns an empty string.

Parameters
defThe node definition to check
Returns
The SubGraphPath if applicable, else empty string

Definition at line 199 of file VisualScriptEditorPanel_Helpers.cpp.

References Olympe::SubGraph, Olympe::TaskNodeDefinition::SubGraphPath, and Olympe::TaskNodeDefinition::Type.

Referenced by OnNodeDoubleClicked().

+ Here is the caller graph for this function:

◆ GetTemplate()

const TaskGraphTemplate & Olympe::VisualScriptEditorPanel::GetTemplate ( ) const
inline

Returns a reference to the internal template being edited.

Used by tests to inspect the state.

Definition at line 235 of file VisualScriptEditorPanel.h.

References m_template.

◆ GetVariablesByType()

std::vector< BlackboardEntry > Olympe::VisualScriptEditorPanel::GetVariablesByType ( const std::vector< BlackboardEntry > &  allVars,
VariableType  expectedType 
)
static

Returns a filtered subset of blackboard entries matching a type.

GetVariablesByType.

UX Enhancement #3 — used by type-filtered variable dropdowns so that, e.g., a Switch node only shows Int variables in its combo box.

Parameters
allVarsFull blackboard variable list to filter.
expectedTypeThe VariableType to keep.
Returns
Vector containing only entries whose Type == expectedType.

Static helper method to filter blackboard entries by variable type. Returns a new vector containing only entries whose Type matches expectedType.

This is used in UI panels to populate variable dropdowns with only compatible types. For example, when connecting a data pin to a variable, only variables of the matching type are shown in the dropdown.

Example usage: std::vector<BlackboardEntry> intVars = GetVariablesByType( m_template.Blackboard, VariableType::Int);

Parameters
allVarsInput list of all blackboard entries
expectedTypeDesired variable type to filter by
Returns
std::vector<BlackboardEntry> Filtered list (copies, not references)

Definition at line 1883 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ Initialize()

void Olympe::VisualScriptEditorPanel::Initialize ( )

Initialize the editor panel with ImNodes context and UI helpers.

Called when a blueprint is loaded into the editor (e.g., when a tab is opened). Sets up:

  • A dedicated ImNodes editor context for independent canvas state per panel
  • Dynamic data pin manager for condition/operand-driven pin generation
  • Node branch renderer for visual flow display
  • Node conditions panel for condition editing UI
  • Math operation panel for arithmetic node properties
  • Blackboard access panels (Get/Set operations)
  • Variable property panel for variable node editing
  • Condition preset library UI
  • Entity blackboard for local/global variable management (entity ID 0 = editor context)

Phase 24 Enhancement (Condition Preset Embedding):

  • Presets are now stored IN the blueprint JSON (v4 schema) instead of external files
  • Each graph is self-contained; no need for separate preset files
  • Presets are loaded from m_template.Presets during Initialize()
  • If graph has presets, they populate m_presetRegistry; otherwise registry remains empty
  • Logging reports: count of loaded presets per graph

Callback Setup:

  • OnDynamicPinsNeedRegeneration: Triggers when user confirms condition edits in modal
  • Fetches FRESH condition data from m_conditionsPanel (not stale eNode data)
  • Regenerates dynamic pins with updated operand information
  • Syncs m_template for serialization
See also
Shutdown()
ConditionPresetRegistry::LoadFromPresetList()
DynamicDataPinManager::RegeneratePinsFromConditions()

Definition at line 52 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskNodeDefinition::conditionRefs, Olympe::VSEditorNode::def, GetComponentTypeID_Static(), Olympe::ConditionPresetRegistry::LoadFromPresetList(), m_branchRenderer, m_conditionsPanel, m_dirty, m_editorNodes, m_entityBlackboard, m_getBBPanel, m_imnodesContext, m_libraryPanel, m_mathOpPanel, m_pinManager, m_presetRegistry, m_selectedNodeID, m_setBBPanel, m_template, m_variablePanel, Olympe::TaskGraphTemplate::Name, Olympe::TaskGraphTemplate::Nodes, Olympe::TaskGraphTemplate::Presets, and SYSTEM_LOG.

Referenced by Olympe::BlueprintEditorGUI::Initialize(), and Olympe::VisualScriptRenderer::VisualScriptRenderer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDirty()

bool Olympe::VisualScriptEditorPanel::IsDirty ( ) const
inline

Returns true when there are unsaved modifications.

Definition at line 194 of file VisualScriptEditorPanel.h.

References m_dirty.

Referenced by Olympe::VisualScriptRenderer::IsDirty().

+ Here is the caller graph for this function:

◆ IsVisible()

bool Olympe::VisualScriptEditorPanel::IsVisible ( ) const
inline

Returns true if the panel window is visible.

Definition at line 157 of file VisualScriptEditorPanel.h.

References m_visible.

◆ LoadTemplate()

void Olympe::VisualScriptEditorPanel::LoadTemplate ( const TaskGraphTemplate tmpl,
const std::string &  path 
)

◆ OnNodeDoubleClicked()

void Olympe::VisualScriptEditorPanel::OnNodeDoubleClicked ( int  nodeID)

Handles double-click on a node (opens SubGraph, etc).

Parameters
nodeIDID of the node that was double-clicked.

If the node is a SubGraph type with a file path set, opens that file in a new tab via TabManager::OpenFileInTab().

Parameters
nodeIDID of the node that was double-clicked

Definition at line 216 of file VisualScriptEditorPanel_Helpers.cpp.

References Olympe::TabManager::Get(), GetComponentTypeID_Static(), GetNodeSubGraphPath(), m_editorNodes, Olympe::TabManager::OpenFileInTab(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ PerformRedo()

void Olympe::VisualScriptEditorPanel::PerformRedo ( )
private

Re-applies the last undone command and syncs the canvas.

Definition at line 1940 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ PerformUndo()

void Olympe::VisualScriptEditorPanel::PerformUndo ( )
private

Undoes the last command and syncs the canvas (nodes + links).

Calls SyncEditorNodesFromTemplate() + RebuildLinks() so that ghost links are eliminated and node positions are restored correctly.

Definition at line 1904 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ RebuildLinks()

void Olympe::VisualScriptEditorPanel::RebuildLinks ( )

Rebuilds ImNodes exec/data link arrays from the template.

RebuildLinks.

Reconstruct all visual links (m_editorLinks) from template connections (m_template.ExecConnections and m_template.DataConnections).

Process:

  1. Clear m_editorLinks
  2. For each ExecPinConnection in m_template: a. Find source node and resolve pin index from stored name b. Include dynamic exec-out pins for VSSequence/Switch nodes c. Create VSEditorLink with encoded attribute IDs
  3. For each DataPinConnection in m_template: a. Find source and destination nodes b. Resolve pin indices from stored names (try static, then DataPins vector) c. Handle Phase 24 dynamic pins for Branch nodes d. Create VSEditorLink with encoded attribute IDs

Attribute ID encoding scheme (nodeID * 10000 + offset): 0–99: exec-in pins (exec input for node) 100–199: exec-out pins (exec outputs indexed by position) 200–299: data-in pins (data inputs indexed by position) 300–399: data-out pins (data outputs indexed by position)

This method is resilient to missing nodes and out-of-range pin indices, defaulting to "Value" or "In"/"Out" pin names as fallback.

Note
Called by SyncCanvasFromTemplate(), SyncEditorNodesFromTemplate(), and after link creation/deletion operations.

Definition at line 540 of file VisualScriptEditorPanel - backup.cpp.

References AllocLinkID(), Olympe::Branch, Olympe::TaskGraphTemplate::DataConnections, DataInAttrUID(), DataOutAttrUID(), Olympe::TaskGraphTemplate::ExecConnections, ExecInAttrUID(), ExecOutAttrUID(), GetComponentTypeID_Static(), GetDataInputPins(), GetDataOutputPins(), GetExecOutputPins(), Olympe::TaskGraphTemplate::GetNode(), Olympe::Input, Olympe::VSEditorLink::linkID, m_editorLinks, m_template, Olympe::Output, Olympe::Switch, and Olympe::VSSequence.

Referenced by ConnectData(), ConnectExec(), RemoveLink(), RemoveNode(), SyncCanvasFromTemplate(), and SyncEditorNodesFromTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveLink()

void Olympe::VisualScriptEditorPanel::RemoveLink ( int  linkID)

Removes an ImNodes link (and its underlying template connection) by link ID.

RemoveLink.

Parameters
linkIDThe ImNodes link UID to remove.

Delete a link and push a DeleteLinkCommand onto the undo stack. This integrates link deletion with the undo/redo system for reversible operations.

Process:

  1. Find the VSEditorLink by ID in m_editorLinks
  2. Decode attribute IDs to extract node IDs and pin indices
  3. Resolve pin names from indices using GetExecOutputPins/GetDataOutputPins
  4. Create ExecPinConnection or DataPinConnection based on link type
  5. Push DeleteLinkCommand to undo stack
  6. Rebuild links to update visual state
  7. Mark graph as dirty and clear verification cache

Attribute ID decoding:

  • Node ID = attrID / 10000
  • Pin offset = attrID % 10000
  • Pin index = offset - base (0 for exec-in, 100 for exec-out, etc.)
Parameters
linkIDImNodes link ID to delete
Note
This is the primary method for user-initiated link deletion via context menu or Ctrl+Click. Automatic link removal during node deletion is handled separately by the command system.

Definition at line 826 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), GetDataInputPins(), GetDataOutputPins(), GetExecInputPins(), GetExecOutputPins(), Olympe::TaskGraphTemplate::GetNode(), m_dirty, m_editorLinks, m_template, m_undoStack, m_verificationDone, Olympe::UndoRedoStack::PushCommand(), RebuildLinks(), Olympe::ExecPinConnection::SourceNodeID, Olympe::DataPinConnection::SourceNodeID, Olympe::VSEditorLink::srcAttrID, Olympe::Switch, and Olympe::VSSequence.

+ Here is the call graph for this function:

◆ RemoveNode()

void Olympe::VisualScriptEditorPanel::RemoveNode ( int  nodeID)

Removes a node from the canvas.

Remove a node from the editor canvas and template graph.

Parameters
nodeIDNode ID to remove.

Deletes the node by ID from both the editor canvas state (m_editorNodes) and the template model (via DeleteNodeCommand). All execution and data connections involving this node are automatically removed by the command system.

Undo/Redo Integration: The deletion is pushed to the undo stack as a DeleteNodeCommand, allowing Ctrl+Z to restore the node and its connections.

Link Rebuilding: After node removal, RebuildLinks() is called to ensure all remaining connections are valid and ImNodes is synchronized with the new canvas state.

Parameters
nodeIDThe ID of the node to remove (must exist in m_editorNodes)
Note
Sets m_dirty = true and m_verificationDone = false to trigger verification
Removing a node also removes all its incoming and outgoing connections
If EntryPoint is removed, m_template.EntryPointID is reset by DeleteNodeCommand
See also
AddNode(), DeleteNodeCommand, RebuildLinks()

Definition at line 395 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), m_dirty, m_editorNodes, m_template, m_undoStack, m_verificationDone, Olympe::UndoRedoStack::PushCommand(), and RebuildLinks().

+ Here is the call graph for this function:

◆ Render()

void Olympe::VisualScriptEditorPanel::Render ( )

Renders the full panel window.

Calls RenderToolbar(), RenderCanvas(), RenderProperties(), RenderBlackboard().

Definition at line 1970 of file VisualScriptEditorPanel - backup.cpp.

◆ RenderAvailableNodesList()

void Olympe::VisualScriptEditorPanel::RenderAvailableNodesList ( )
private

Phase 31 — Nodes list tab in Part A (available nodes for dragging to canvas)

Definition at line 1980 of file VisualScriptEditorPanel_Properties.cpp.

References Olympe::AtomicTask, Olympe::Branch, Olympe::Delay, Olympe::DoOnce, Olympe::EntryPoint, Olympe::ForEach, Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::MathOp, Olympe::SetBBValue, Olympe::SubGraph, Olympe::Switch, Olympe::VSSequence, and Olympe::While.

+ Here is the call graph for this function:

◆ RenderBlackboard()

void Olympe::VisualScriptEditorPanel::RenderBlackboard ( )
private

Definition at line 4141 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and Olympe::BlackboardEntry::Key.

+ Here is the call graph for this function:

◆ RenderBranchNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderBranchNodeProperties ( VSEditorNode eNode,
TaskNodeDefinition def 
)
private

Renders the Properties panel content for a selected Branch (or While) node.

Displays a blue header with the node name (matching the canvas Section 1 title bar styling), then delegates to NodeConditionsPanel::Render() for the compact structured-conditions list, and finishes with a Breakpoint checkbox.

The caller (RenderProperties) must return immediately after this call to prevent the legacy condition UI from also rendering.

Parameters
eNodeReference to the selected editor node (modified when dirty).
defReference to the node's TaskNodeDefinition (modified when dirty).

Definition at line 3394 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskNodeDefinition::conditionRefs, Olympe::TaskNodeDefinition::dynamicPins, GetComponentTypeID_Static(), and Olympe::TaskNodeDefinition::NodeName.

Referenced by RenderNodePropertiesPanelContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderBreakpoints()

void Olympe::VisualScriptEditorPanel::RenderBreakpoints ( )
private

◆ RenderCanvas()

void Olympe::VisualScriptEditorPanel::RenderCanvas ( )
private

◆ RenderConditionEditor()

void Olympe::VisualScriptEditorPanel::RenderConditionEditor ( Condition condition,
int  conditionIndex,
const std::vector< BlackboardEntry > &  allVars,
const std::vector< std::string > &  availablePins 
)

Renders the full editor UI for one Condition entry on a Branch/While node.

Shows left/right mode selectors (Pin | Variable | Const), value inputs, an operator combo, and a live preview line.

Parameters
conditionReference to the condition being edited (modified in place).
conditionIndex0-based index used for ImGui PushID uniqueness.
allVarsFull blackboard entry list for variable dropdowns.
availablePinsList of available pin references for Pin mode.

Definition at line 4578 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderConstValueInput()

void Olympe::VisualScriptEditorPanel::RenderConstValueInput ( TaskValue value,
VariableType  varType,
const char label 
)

Renders a type-aware const value input widget.

Bool -> Checkbox, Int -> InputInt, Float -> InputFloat, String -> InputText, Vector -> InputFloat3.

Parameters
valueTaskValue to edit (modified on change).
varTypeDetermines which widget to display.
labelImGui widget label.

Definition at line 4778 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskValue::AsBool(), Olympe::TaskValue::AsFloat(), Olympe::TaskValue::AsInt(), Olympe::TaskValue::AsString(), Olympe::TaskValue::AsVector(), GetComponentTypeID_Static(), Olympe::TaskValue::IsNone(), and Vector::x.

+ Here is the call graph for this function:

◆ RenderContent()

void Olympe::VisualScriptEditorPanel::RenderContent ( )

Renders panel content without window wrapper - for fixed layout.

Definition at line 1983 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::VisualScriptRenderer::Render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderContextMenus()

void Olympe::VisualScriptEditorPanel::RenderContextMenus ( )
private

Render node/link context menus opened by right-click detection.

Must be called AFTER EndNodeEditor() so popups are in correct ImGui scope.

Definition at line 3299 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), Olympe::VSEditorNode::nodeID, Olympe::TaskNodeDefinition::NodeID, and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ RenderForEachNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderForEachNodeProperties ( )
private

Definition at line 543 of file VisualScriptEditorPanel_Properties.cpp.

References Olympe::TaskGraphTemplate::Blackboard, Olympe::ForEach, GetComponentTypeID_Static(), Olympe::List, m_dirty, m_selectedNodeID, m_template, and Olympe::TaskGraphTemplate::Nodes.

Referenced by RenderNodePropertiesPanelContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderGlobalVariablesPanel()

void Olympe::VisualScriptEditorPanel::RenderGlobalVariablesPanel ( )
private

Phase 24 Global Blackboard — Renders global variables panel.

Shows variables from GlobalTemplateBlackboard with current entity values. Called from RenderContent() as part of tab-based blackboard UI.

Definition at line 5925 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskValue::AsBool(), Olympe::TaskValue::AsEntityID(), Olympe::TaskValue::AsFloat(), Olympe::TaskValue::AsInt(), Olympe::TaskValue::AsString(), GetComponentTypeID_Static(), Olympe::TaskValue::IsNone(), SYSTEM_LOG, and Vector::x.

Referenced by RenderRightPanelTabContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderLocalVariablesPanel()

void Olympe::VisualScriptEditorPanel::RenderLocalVariablesPanel ( )
private

Part C: Local Variables reference panel (bottom of right panel)

Definition at line 5809 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and Olympe::BlackboardEntry::Key.

Referenced by RenderRightPanelTabContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderMathOpNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderMathOpNodeProperties ( VSEditorNode eNode,
TaskNodeDefinition def 
)
private

Renders the Properties panel content for a selected MathOp node.

Displays a blue header with the node name, then delegates to MathOpPropertyPanel::Render() for operand and operator editing.

The caller (RenderProperties) must return immediately after this call to prevent any legacy UI from also rendering.

Parameters
eNodeReference to the selected editor node (modified when dirty).
defReference to the node's TaskNodeDefinition (modified when dirty).

Definition at line 3468 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskNodeDefinition::dynamicPins, GetComponentTypeID_Static(), Olympe::TaskNodeDefinition::mathOpRef, and Olympe::TaskNodeDefinition::NodeName.

+ Here is the call graph for this function:

◆ RenderNodeDataParameters()

void Olympe::VisualScriptEditorPanel::RenderNodeDataParameters ( TaskNodeDefinition def)
private

Renders node parameters for data nodes (GetBBValue, SetBBValue, MathOp).

Displays a parameters section that allows editing generic parameters that can be stored and serialized alongside node-specific properties.

Parameters
defReference to the node's TaskNodeDefinition (modified when dirty).

Definition at line 3541 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), Olympe::BBVariableRegistry::LoadFromTemplate(), Olympe::TaskNodeDefinition::Parameters, and Olympe::ParameterBinding::Type.

Referenced by RenderNodePropertiesPanelContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderNodePalette()

void Olympe::VisualScriptEditorPanel::RenderNodePalette ( )
private

Definition at line 3228 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderNodePropertiesPanel()

void Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanel ( )
private

◆ RenderNodePropertiesPanelContent()

void Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent ( )
private

Phase 31 — Content of Properties tab in Part A.

Definition at line 1486 of file VisualScriptEditorPanel_Properties.cpp.

References Olympe::AtomicTask, Olympe::TaskNodeDefinition::AtomicTaskID, Olympe::TaskNodeDefinition::BBKey, Olympe::Branch, Olympe::TaskNodeDefinition::conditionOperandRefs, Olympe::TaskNodeDefinition::conditionRefs, Olympe::MathOpOperand::Const, Olympe::MathOpOperand::constValue, Olympe::Delay, Olympe::TaskNodeDefinition::DelaySeconds, Olympe::TaskNodeDefinition::dynamicPins, Olympe::ForEach, Olympe::PropertyValue::FromString(), Olympe::AtomicTaskUIRegistry::Get(), Olympe::DebugController::Get(), Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::AtomicTaskUIRegistry::GetSortedForUI(), Olympe::AtomicTaskUIRegistry::GetTaskSpec(), Olympe::DebugController::HasBreakpoint(), Olympe::MathOpRef::leftOperand, Olympe::Literal, Olympe::BBVariableRegistry::LoadFromTemplate(), m_conditionsPanel, m_condPanelNodeID, m_dirty, m_editorNodes, m_selectedNodeID, m_template, m_undoStack, Olympe::MathOp, Olympe::MathOpRef::mathOperator, Olympe::TaskNodeDefinition::mathOpRef, Olympe::MathOpOperand::mode, Olympe::TaskGraphTemplate::Name, Olympe::TaskNodeDefinition::NodeName, Olympe::TaskGraphTemplate::Nodes, Olympe::Parallel, Olympe::TaskNodeDefinition::Parameters, Olympe::MathOpOperand::Pin, Olympe::UndoRedoStack::PushCommand(), RenderBranchNodeProperties(), RenderForEachNodeProperties(), RenderNodeDataParameters(), RenderSubGraphNodeProperties(), RenderSwitchNodeProperties(), Olympe::MathOpRef::rightOperand, Olympe::Selector, Olympe::Sequence, Olympe::SetBBValue, Olympe::SubGraph, Olympe::Switch, Olympe::DebugController::ToggleBreakpoint(), Olympe::ParameterBinding::Type, Olympe::TaskNodeDefinition::Type, Olympe::MathOpOperand::Variable, Olympe::MathOpOperand::variableName, and Olympe::While.

+ Here is the call graph for this function:

◆ RenderOperandEditor()

bool Olympe::VisualScriptEditorPanel::RenderOperandEditor ( Operand operand,
const char labelSuffix 
)
private

Render a single operand with dropdown for mode and value editor Returns true if the operand was modified.

Definition at line 5609 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderPinSelector()

void Olympe::VisualScriptEditorPanel::RenderPinSelector ( std::string &  selectedPin,
const std::vector< std::string > &  availablePins,
const char label 
)

Renders a pin selector combo box.

Parameters
selectedPinCurrently selected pin reference (modified on change).
availablePinsList of available pin reference strings.
labelImGui widget label.

Definition at line 4872 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderPresetBankPanel()

void Olympe::VisualScriptEditorPanel::RenderPresetBankPanel ( )
private

Part B: Preset Bank panel (middle of right panel)

Definition at line 5434 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by RenderRightPanelTabContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderPresetItemCompact()

void Olympe::VisualScriptEditorPanel::RenderPresetItemCompact ( const ConditionPreset preset,
size_t  index 
)
private

Render a single preset item in compact horizontal format with index.

Definition at line 5473 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderProperties()

void Olympe::VisualScriptEditorPanel::RenderProperties ( )
private

◆ RenderRightPanelTabContent()

void Olympe::VisualScriptEditorPanel::RenderRightPanelTabContent ( )
private

Phase 26 — Tab system: Renders the content of the active tab Dispatches to appropriate render function based on m_rightPanelTabSelection.

Renders the content of the currently selected tab Dispatches to the appropriate render function based on m_rightPanelTabSelection

Definition at line 689 of file VisualScriptEditorPanel_Blackboard.cpp.

References m_rightPanelTabSelection, RenderGlobalVariablesPanel(), RenderLocalVariablesPanel(), and RenderPresetBankPanel().

+ Here is the call graph for this function:

◆ RenderRightPanelTabs()

void Olympe::VisualScriptEditorPanel::RenderRightPanelTabs ( )
private

Phase 26 — Tab system: Renders the tab bar for the 3-panel right section Displays tabs for Presets, Local Variables, and Global Variables.

Renders the tab bar for selecting between Presets, Local Variables, and Global Variables Uses a horizontal button group with visual feedback for the active tab

Definition at line 631 of file VisualScriptEditorPanel_Blackboard.cpp.

References GetComponentTypeID_Static(), and m_rightPanelTabSelection.

+ Here is the call graph for this function:

◆ RenderSaveAsDialog()

void Olympe::VisualScriptEditorPanel::RenderSaveAsDialog ( )
private

Definition at line 2216 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ RenderSubGraphNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderSubGraphNodeProperties ( )
private

◆ RenderSwitchNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderSwitchNodeProperties ( VSEditorNode eNode,
TaskNodeDefinition def 
)
private

Renders the Properties panel content for a selected Switch node (Phase 1).

Displays a blue header with the node name, then renders:

  • "Switch On:" dropdown to select the blackboard variable that controls the switch
  • Case count display
  • "Edit Switch Cases" button to open SwitchCaseEditorModal
  • Modal rendering with Apply integration (Phase 1 FIX: regenerates DynamicExecOutputPins)
  • Breakpoint checkbox

Phase 1 Key Fix: After modal Apply, regenerates DynamicExecOutputPins from switchCases to ensure canvas pins are synchronized with semantic data.

Parameters
eNodeReference to the selected editor node (modified when dirty).
defReference to the node's TaskNodeDefinition (modified when dirty).

Definition at line 207 of file VisualScriptEditorPanel_Properties.cpp.

References Olympe::TaskNodeDefinition::DynamicExecOutputPins, Olympe::PropertyValue::FromString(), Olympe::DebugController::Get(), GetComponentTypeID_Static(), Olympe::DebugController::HasBreakpoint(), Olympe::Int, Olympe::BBVariableRegistry::LoadFromTemplate(), m_dirty, m_selectedNodeID, m_switchCaseModal, m_template, m_undoStack, Olympe::TaskGraphTemplate::Name, Olympe::TaskNodeDefinition::NodeName, Olympe::TaskGraphTemplate::Nodes, Olympe::UndoRedoStack::PushCommand(), RenderVerificationPanel(), Olympe::TaskNodeDefinition::switchCases, Olympe::TaskNodeDefinition::switchVariable, and Olympe::DebugController::ToggleBreakpoint().

Referenced by RenderNodePropertiesPanelContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderToolbar()

void Olympe::VisualScriptEditorPanel::RenderToolbar ( )
private

Definition at line 2111 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ RenderValidationOverlay()

void Olympe::VisualScriptEditorPanel::RenderValidationOverlay ( )
private

Definition at line 4316 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ RenderVariableSelector()

void Olympe::VisualScriptEditorPanel::RenderVariableSelector ( std::string &  selectedVar,
const std::vector< BlackboardEntry > &  allVars,
VariableType  expectedType,
const char label 
)

Renders a type-filtered variable selector combo box.

Only variables whose Type matches expectedType are shown.

Parameters
selectedVarCurrently selected variable name (modified on change).
allVarsFull blackboard entry list to filter.
expectedTypeVariableType used to filter entries.
labelImGui widget label.

Definition at line 4720 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and Key.

+ Here is the call graph for this function:

◆ RenderVerificationLogsPanel()

void Olympe::VisualScriptEditorPanel::RenderVerificationLogsPanel ( )

Public render method for verification logs panel.

Called from BlueprintEditorGUI to display logs in the left panel.

Phase 24.3 — For integration into the main layout's verification logs section.

Definition at line 4477 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), and Olympe::VSVerificationIssue::message.

Referenced by Olympe::BlueprintEditorGUI::RenderFixedLayout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderVerificationPanel()

void Olympe::VisualScriptEditorPanel::RenderVerificationPanel ( )
private

Renders the verification results panel (Phase 21-B).

Definition at line 4394 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

Referenced by RenderSwitchNodeProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderWhileNodeProperties()

void Olympe::VisualScriptEditorPanel::RenderWhileNodeProperties ( )
private

Phase 24 — Property panel renderers for While, ForEach, and SubGraph nodes.

◆ ResetViewportBeforeSave()

void Olympe::VisualScriptEditorPanel::ResetViewportBeforeSave ( )

Resets the ImNodes canvas panning to (0,0) before saving node positions.

ResetViewportBeforeSave.

BUG-003 Fix: Saves current panning in m_lastViewportPanning for optional restoration after save. Node positions are stored in grid space (independent of viewport pan) via GetNodeGridSpacePos(), so this reset is a belt-and- suspenders safety measure rather than strictly required.

Save the current ImNodes viewport panning state and reset panning to (0, 0). This is part of BUG-003 fix to prevent viewport jump when saving.

Rationale:

  1. SyncNodePositionsFromImNodes() is called during Save() to capture the current canvas state before serialization.
  2. GetNodeGridSpacePos() is pan-independent, but stale ImNodes internal state could corrupt the capture if the viewport offset is non-zero.
  3. By resetting panning to (0, 0) before the capture, we ensure a clean state for position serialization.
  4. AfterSave() restores the original panning so the user's viewport position is preserved (canvas doesn't visually jump).

This is called at the very beginning of Save() / SaveAs().

Definition at line 1838 of file VisualScriptEditorPanel - backup.cpp.

References Vector::FromImVec2(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RunGraphSimulation()

void VisualScriptEditorPanel::RunGraphSimulation ( )
private

◆ RunGraphSimulationRecursive()

void Olympe::VisualScriptEditorPanel::RunGraphSimulationRecursive ( const TaskGraphTemplate tmpl,
std::map< std::string, TaskValue > &  blackboard,
std::unordered_set< std::string > &  visitedGraphs,
int  recursionDepth,
const std::string &  traceIndent 
)
private

Internal recursive simulation function with cycle detection.

Parameters
tmplThe graph template to simulate
blackboardCurrent execution blackboard (isolated per SubGraph)
visitedGraphsSet of visited graph file paths (for cycle detection)
recursionDepthCurrent recursion depth (0 for root call)
traceIndentIndentation prefix for trace messages

Phase 25: Tracks visited graph files and recursion depth to prevent infinite loops. Warns at depth > 10, stops at depth >= 20.

Definition at line 1708 of file VisualScriptEditorPanel_Verification.cpp.

References ADD_TRACE, Olympe::AtomicTask, Olympe::Branch, Olympe::EntryPoint, Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::Literal, Olympe::TaskGraphLoader::LoadFromFile(), Olympe::NODE_INDEX_NONE, Olympe::ExecutionToken::nodeID, RunGraphSimulationRecursive(), Olympe::SetBBValue, Olympe::SubGraph, Olympe::ExecPinConnection::TargetNodeID, and Olympe::VSSequence.

Referenced by RunGraphSimulation(), and RunGraphSimulationRecursive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RunVerification()

void Olympe::VisualScriptEditorPanel::RunVerification ( )
private

Runs VSGraphVerifier on the current graph and stores the result.

Definition at line 4359 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), Olympe::VSVerificationIssue::message, and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ Save()

bool Olympe::VisualScriptEditorPanel::Save ( )

◆ SaveAs()

bool Olympe::VisualScriptEditorPanel::SaveAs ( const std::string &  path)

Saves the current canvas state to a new JSON v4 file.

Parameters
pathDestination file path.
Returns
true on success.

Definition at line 1077 of file VisualScriptEditorPanel - backup.cpp.

References AfterSave(), CommitPendingBlackboardEdits(), GetComponentTypeID_Static(), Olympe::TaskGraphTemplate::GlobalVariableValues, m_currentPath, m_dirty, m_entityBlackboard, m_template, ResetViewportBeforeSave(), SerializeAndWrite(), SyncNodePositionsFromImNodes(), SyncPresetsFromRegistryToTemplate(), SYSTEM_LOG, and ValidateAndCleanBlackboardEntries().

Referenced by Olympe::VisualScriptRenderer::Save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScreenToCanvasPos()

ImVec2 Olympe::VisualScriptEditorPanel::ScreenToCanvasPos ( ImVec2  screenPos) const

Converts a screen-space position to canvas (editor) space.

ScreenToCanvasPos.

Parameters
screenPosPosition in absolute screen-pixel coordinates.
Returns
Position in ImNodes editor (canvas) space.

Correct conversion: removes canvas origin and viewport pan, then divides by zoom (ImNodes 0.4 has no zoom, zoom is always 1.0f).

Convert absolute screen-space coordinates to ImNodes editor (canvas) space. Used for context menu positioning, mouse hit testing, and UI interactions.

The transformation is: canvasX = screenX - windowPos.x - panning.x canvasY = screenY - windowPos.y - panning.y

where:

  • screenPos: absolute screen coordinate (e.g., from ImGui::GetMousePos())
  • windowPos: top-left corner of the ImGui window containing the canvas
  • panning: current ImNodes viewport pan offset
  • zoom: implicit 1.0f (ImNodes 0.4 does not expose zoom API)
Parameters
screenPosAbsolute screen-space coordinate
Returns
ImVec2 Editor-space coordinate for hit testing or node placement

Definition at line 1865 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ SerializeAndWrite()

bool Olympe::VisualScriptEditorPanel::SerializeAndWrite ( const std::string &  path)

Serializes the template to JSON v4 and writes to a file.

Definition at line 1190 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskValue::AsBool(), Olympe::AtomicTask, Olympe::TaskNodeDefinition::AtomicTaskID, Olympe::AtomicTaskID, Olympe::TaskNodeDefinition::BBKey, Olympe::TaskGraphTemplate::Blackboard, Olympe::Bool, Olympe::Branch, Olympe::ComparisonOp, Olympe::TaskNodeDefinition::ConditionID, Olympe::ConditionID, Olympe::TaskNodeDefinition::conditionOperandRefs, Olympe::TaskNodeDefinition::conditionRefs, Olympe::TaskNodeDefinition::conditions, Olympe::OperandRef::Const, Olympe::TaskGraphTemplate::DataConnections, Olympe::Delay, Olympe::TaskNodeDefinition::DelaySeconds, Olympe::TaskNodeDefinition::DynamicExecOutputPins, Olympe::EntityID, Olympe::TaskGraphTemplate::ExecConnections, Olympe::Float, GetComponentTypeID_Static(), Olympe::GetNodeTypeLabel(), Olympe::TaskGraphTemplate::GlobalVariableValues, Olympe::TaskNodeDefinition::InputParams, Olympe::Int, Olympe::Literal, Olympe::LocalVariable, m_dirty, m_editorNodes, m_template, Olympe::MathOp, Olympe::MathOpRef::mathOperator, Olympe::TaskNodeDefinition::MathOperator, Olympe::MathOperator, Olympe::TaskNodeDefinition::mathOpRef, Olympe::TaskGraphTemplate::Name, Olympe::TaskNodeDefinition::NodeID, Olympe::TaskNodeDefinition::NodeName, Olympe::TaskGraphTemplate::Nodes, Olympe::None, Olympe::TaskNodeDefinition::OutputParams, Olympe::TaskNodeDefinition::Parameters, Olympe::OperandRef::Pin, Olympe::TaskGraphTemplate::Presets, Olympe::String, Olympe::SubGraph, Olympe::TaskNodeDefinition::SubGraphPath, Olympe::SubGraphPath, Olympe::Switch, Olympe::TaskNodeDefinition::switchCases, Olympe::TaskNodeDefinition::switchVariable, SyncTemplateFromCanvas(), SYSTEM_LOG, Olympe::MathOpRef::ToJson(), Olympe::TaskNodeDefinition::Type, Olympe::OperandRef::Variable, Olympe::VariableTypeToString(), Olympe::Vector, Olympe::VSSequence, Olympe::While, and Vector::x.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetVisible()

void Olympe::VisualScriptEditorPanel::SetVisible ( bool  v)
inline

Show / hide the panel.

Definition at line 160 of file VisualScriptEditorPanel.h.

References GetComponentTypeID_Static(), and m_visible.

+ Here is the call graph for this function:

◆ Shutdown()

void Olympe::VisualScriptEditorPanel::Shutdown ( )

Shutdown the editor panel and release all resources.

Called when a blueprint editor tab is closed or the application exits. Performs cleanup in the correct order:

Phase 24 Notes:

  • DO NOT manually clear m_presetRegistry here; it is cleared by the destructor
  • UI helper reset() calls ensure no dangling callbacks or resource leaks
  • After Shutdown(), the panel can be re-initialized for a new graph
Note
Always call Shutdown() before destroying the panel instance.
See also
Initialize()
~VisualScriptEditorPanel()

Definition at line 140 of file VisualScriptEditorPanel - backup.cpp.

References m_branchRenderer, m_conditionsPanel, m_condPanelNodeID, m_editorLinks, m_editorNodes, m_getBBPanel, m_imnodesContext, m_libraryPanel, m_mathOpPanel, m_pinManager, m_positionedNodes, m_setBBPanel, and m_variablePanel.

Referenced by Olympe::BlueprintEditorGUI::Shutdown(), and Olympe::VisualScriptRenderer::~VisualScriptRenderer().

+ Here is the caller graph for this function:

◆ SyncCanvasFromTemplate()

void Olympe::VisualScriptEditorPanel::SyncCanvasFromTemplate ( )

Builds the editor canvas from the in-memory TaskGraphTemplate.

SyncCanvasFromTemplate.

Load all nodes from m_template into the editor canvas representation (m_editorNodes). This is the primary method for initializing the canvas from a loaded/pasted blueprint.

Process:

  1. Clear existing canvas state (m_editorNodes, m_positionedNodes, m_nextNodeID)
  2. For each node in m_template.Nodes: a. Create a VSEditorNode and copy TaskNodeDefinition b. Load position from JSON if available; validate against corruption c. Fall back to auto-layout if position is missing or invalid d. For Branch nodes: regenerate dynamic pins from conditions
  3. Rebuild links from template connections (RebuildLinks)
  4. Set m_needsPositionSync flag so RenderCanvas() will push positions to ImNodes

Position validation: Checks for finite values and ±100,000 bounds. This prevents crashes from corrupted JSON (e.g., NaN, ±Infinity). Garbage values are logged and replaced with auto-layout positions.

Phase 24 integration: Branch nodes' dynamic pins are regenerated from conditionRefs to ensure data-in connectors are available even if not explicitly saved.

Note
Called by LoadTemplate() and after blueprint paste operations.

Definition at line 457 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::Branch, Olympe::TaskNodeDefinition::conditionOperandRefs, Olympe::TaskNodeDefinition::conditionRefs, Olympe::TaskNodeDefinition::EditorPosX, Olympe::TaskNodeDefinition::EditorPosY, GetComponentTypeID_Static(), Olympe::TaskNodeDefinition::HasEditorPos, m_editorNodes, m_needsPositionSync, m_nextNodeID, m_pinManager, m_positionedNodes, m_template, Olympe::VSEditorNode::nodeID, Olympe::TaskNodeDefinition::NodeID, Olympe::TaskGraphTemplate::Nodes, RebuildLinks(), SYSTEM_LOG, and Olympe::TaskNodeDefinition::Type.

Referenced by LoadTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SyncEditorNodesFromTemplate()

void Olympe::VisualScriptEditorPanel::SyncEditorNodesFromTemplate ( )

Rebuilds m_editorNodes from m_template, preserving existing node positions.

SyncEditorNodesFromTemplate.

Called after Undo/Redo to synchronise the canvas with the template state.

Restore editor nodes (m_editorNodes) from m_template during undo/redo operations. This is more complex than SyncCanvasFromTemplate because it must:

  • Preserve canvas positions for nodes that still exist
  • Support MoveNodeCommand parameters (__posX, __posY) for undo/redo states
  • Fall back through multiple position sources (parameter -> saved -> loaded -> default)

Position fallback order:

  1. Parameters["__posX/__posY"] stored by MoveNodeCommand (undo/redo target)
  2. Previously known position (from m_editorNodes before clear)
  3. File-loaded position (m_template.EditorPosX/Y)
  4. Auto-layout default (grid spacing)

Process:

  1. Save current positions from m_editorNodes (for fallback)
  2. Clear m_editorNodes, m_positionedNodes, m_nodeDragStartPositions
  3. For each node in m_template, determine position using fallback order
  4. Validate all positions against corruption (NaN, ±100,000)
  5. Rebuild links to remove "ghost" links from deleted nodes
  6. Set m_needsPositionSync for the next render
Note
Called by PerformUndo() and PerformRedo() to restore graph state. Also called internally by LoadTemplate() on initial load.

Definition at line 689 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskNodeDefinition::EditorPosX, Olympe::TaskNodeDefinition::EditorPosY, GetComponentTypeID_Static(), Olympe::TaskNodeDefinition::HasEditorPos, Olympe::Literal, m_editorNodes, m_needsPositionSync, m_nextNodeID, m_nodeDragStartPositions, m_positionedNodes, m_template, Olympe::VSEditorNode::nodeID, Olympe::TaskNodeDefinition::NodeID, Olympe::TaskGraphTemplate::Nodes, Olympe::TaskNodeDefinition::Parameters, RebuildLinks(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ SyncNodePositionsFromImNodes()

void Olympe::VisualScriptEditorPanel::SyncNodePositionsFromImNodes ( )

Pulls the current node positions from ImNodes into m_editorNodes.

Only nodes that have been rendered at least once (present in m_positionedNodes) are updated to avoid ImNodes assertions. Must be called before serialization to capture user-moved positions.

Definition at line 1124 of file VisualScriptEditorPanel - backup.cpp.

References GetComponentTypeID_Static(), Olympe::Literal, m_editorNodes, m_positionedNodes, m_template, Olympe::TaskGraphTemplate::Nodes, and Olympe::ParameterBinding::Type.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SyncPresetsFromRegistryToTemplate()

void Olympe::VisualScriptEditorPanel::SyncPresetsFromRegistryToTemplate ( )

Syncs ALL presets from the registry to the template.

Phase 24 FIX: Ensures that presets created/modified via UI are included in save. Previously, only presets modified via operand editor were synced; newly created presets were missed. Now called before serialization to guarantee completeness.

Definition at line 1165 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::ConditionPresetRegistry::GetAllPresetIDs(), GetComponentTypeID_Static(), Olympe::ConditionPresetRegistry::GetPreset(), m_presetRegistry, m_template, Olympe::TaskGraphTemplate::Presets, and SYSTEM_LOG.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SyncTemplateFromCanvas()

void Olympe::VisualScriptEditorPanel::SyncTemplateFromCanvas ( )

Builds the in-memory TaskGraphTemplate from the editor nodes/links.

SyncTemplateFromCanvas.

Update m_template.Nodes with the current state of m_editorNodes. This is called before serialization (Save/SaveAs) to reflect user edits on the canvas.

Process:

  1. Clear m_template.Nodes
  2. Copy all TaskNodeDefinitions from m_editorNodes into m_template
  3. Rebuild template's lookup cache for fast node access by ID
Note
This method does NOT sync positions (that's done separately by SyncNodePositionsFromImNodes). It only syncs node definitions.

Definition at line 529 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskGraphTemplate::BuildLookupCache(), GetComponentTypeID_Static(), m_editorNodes, m_template, and Olympe::TaskGraphTemplate::Nodes.

Referenced by SerializeAndWrite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TraceUpstreamDataNodes()

void Olympe::VisualScriptEditorPanel::TraceUpstreamDataNodes ( int32_t  sourceNodeID,
const std::string &  indent,
std::unordered_set< int > &  visitedDataNodes 
)
private

Recursively traces all upstream pure data nodes in the graph.

Walks data connections backward to show complete data dependency chains.

Parameters
sourceNodeIDID of the node to trace upstream from
indentIndentation string prefix for logs
visitedDataNodesSet of visited node IDs (prevents cycles)

Definition at line 1500 of file VisualScriptEditorPanel_Verification.cpp.

References ADD_TRACE, Olympe::MathOpOperand::Const, Olympe::TaskGraphTemplate::DataConnections, Olympe::GetBBValue, GetComponentTypeID_Static(), m_template, Olympe::MathOp, Olympe::NODE_INDEX_NONE, Olympe::TaskGraphTemplate::Nodes, TraceUpstreamDataNodes(), and Olympe::MathOpOperand::Variable.

Referenced by RunGraphSimulation(), and TraceUpstreamDataNodes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateAndCleanBlackboardEntries()

void Olympe::VisualScriptEditorPanel::ValidateAndCleanBlackboardEntries ( )

Removes blackboard entries with empty keys or VariableType::None.

ValidateAndCleanBlackboardEntries.

Called before serialization (Fix #1) to guarantee the blackboard is clean. Logs each removed entry to SYSTEM_LOG.

Remove invalid blackboard entries from the template's blackboard list. Entries with empty keys or VariableType::None are considered invalid and are filtered out to prevent serialization crashes and UI inconsistencies.

Invalid entries can occur when:

  • User creates a variable entry but doesn't specify a name
  • Type deserialization failed due to malformed JSON
  • Legacy data migration left orphaned entries

This method is called before Save() and SaveAs() to ensure a clean state. Removed entries are logged for debugging; m_dirty is set to track changes.

Definition at line 1790 of file VisualScriptEditorPanel - backup.cpp.

References Olympe::TaskGraphTemplate::Blackboard, GetComponentTypeID_Static(), m_template, and Olympe::None.

Referenced by Save(), and SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateBlackboardEntry()

bool Olympe::VisualScriptEditorPanel::ValidateBlackboardEntry ( const BlackboardEntry entry)

Validates a complete blackboard entry.

ValidateBlackboardEntry.

Checks that the entry has a non-empty key and a valid type.

Parameters
entryThe entry to validate
Returns
true if entry is valid, false otherwise

Validates a complete blackboard entry for consistency. Checks that the entry has both a key and a valid type.

Parameters
entryThe entry to validate
Returns
true if entry is valid (non-empty key, Type != None)

Definition at line 305 of file VisualScriptEditorPanel_Utilities.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ ValidateBlackboardKey()

BlackboardValidationResult Olympe::VisualScriptEditorPanel::ValidateBlackboardKey ( const std::string &  key,
bool  isGlobal,
int  excludeIndex = -1 
)

Validates a blackboard key according to schema rules.

ValidateBlackboardKey.

Rules:

  1. Key must not be empty
  2. Key must not be a duplicate
  3. Global keys should follow "scope:key" format (warning)
Parameters
keyThe key to validate
isGlobalWhether this is a global variable
excludeIndexSkip duplicate check for entry at index (-1 = check all)
Returns
Validation result with IsValid flag and messages

Validates a blackboard entry key according to the following rules:

  1. Key must not be empty
  2. Key must not be a duplicate (checked against all other entries)
  3. Global keys should follow "scope:key" format (warning, not error)
Parameters
keyThe key string to validate
isGlobalWhether this is a global variable
excludeIndexSkip duplicate check for entry at this index (-1 = check all)
Returns
Validation result with error/warning messages

Definition at line 256 of file VisualScriptEditorPanel_Utilities.cpp.

References Olympe::BlackboardValidationResult::ErrorMessage, GetComponentTypeID_Static(), Olympe::BlackboardValidationResult::IsValid, and Olympe::BlackboardValidationResult::WarningMessage.

+ Here is the call graph for this function:

Member Data Documentation

◆ DOUBLE_CLICK_THRESHOLD

constexpr float Olympe::VisualScriptEditorPanel::DOUBLE_CLICK_THRESHOLD = 0.3f
staticconstexpr

Threshold for detecting double-click (300ms)

Definition at line 988 of file VisualScriptEditorPanel.h.

◆ m_branchRenderer

std::unique_ptr<NodeBranchRenderer> Olympe::VisualScriptEditorPanel::m_branchRenderer

Specialized renderer for Branch nodes (4-section layout with conditions).

Definition at line 902 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_canvasEditor

std::unique_ptr<ImNodesCanvasEditor> Olympe::VisualScriptEditorPanel::m_canvasEditor

Canvas editor adapter for minimap support (Phase 37) Abstracts imnodes minimap rendering through ICanvasEditor interface.

Definition at line 966 of file VisualScriptEditorPanel.h.

◆ m_conditionsPanel

std::unique_ptr<NodeConditionsPanel> Olympe::VisualScriptEditorPanel::m_conditionsPanel

Properties-panel sub-widget for the selected Branch node.

Definition at line 905 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), RenderNodePropertiesPanelContent(), Save(), and Shutdown().

◆ m_condPanelNodeID

int Olympe::VisualScriptEditorPanel::m_condPanelNodeID = -1

ID of the node currently loaded into m_conditionsPanel (-1 = none).

Definition at line 929 of file VisualScriptEditorPanel.h.

Referenced by RenderNodePropertiesPanelContent(), and Shutdown().

◆ m_contextLinkID

int Olympe::VisualScriptEditorPanel::m_contextLinkID = -1

Link ID captured at the moment a right-click context menu was opened on a link.

Definition at line 785 of file VisualScriptEditorPanel.h.

◆ m_contextMenuX

float Olympe::VisualScriptEditorPanel::m_contextMenuX = 0.0f

Right-click paste position.

Definition at line 778 of file VisualScriptEditorPanel.h.

◆ m_contextMenuY

float Olympe::VisualScriptEditorPanel::m_contextMenuY = 0.0f

Definition at line 779 of file VisualScriptEditorPanel.h.

◆ m_contextNodeID

int Olympe::VisualScriptEditorPanel::m_contextNodeID = -1

Node ID captured at the moment a right-click context menu was opened on a node.

Definition at line 782 of file VisualScriptEditorPanel.h.

◆ m_currentPath

std::string Olympe::VisualScriptEditorPanel::m_currentPath

Definition at line 722 of file VisualScriptEditorPanel.h.

Referenced by GetCurrentPath(), LoadTemplate(), Save(), and SaveAs().

◆ m_dirty

bool Olympe::VisualScriptEditorPanel::m_dirty = false

◆ m_editorLinks

std::vector<VSEditorLink> Olympe::VisualScriptEditorPanel::m_editorLinks

Editor links (exec + data)

Definition at line 731 of file VisualScriptEditorPanel.h.

Referenced by RebuildLinks(), RemoveLink(), and Shutdown().

◆ m_editorNodes

std::vector<VSEditorNode> Olympe::VisualScriptEditorPanel::m_editorNodes

◆ m_entityBlackboard

std::unique_ptr<EntityBlackboard> Olympe::VisualScriptEditorPanel::m_entityBlackboard

Per-entity blackboard instance (combines local + global variables) Created in Initialize() and manages scope-aware access to both local and global vars.

Definition at line 937 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), LoadTemplate(), Save(), and SaveAs().

◆ m_executionTokenStack

std::vector<ExecutionToken> Olympe::VisualScriptEditorPanel::m_executionTokenStack

Phase 24.4 — Execution token stack for multi-branch simulation Enables proper handling of Sequence nodes with multiple branches.

Definition at line 772 of file VisualScriptEditorPanel.h.

Referenced by RunGraphSimulation().

◆ m_focusNodeID

int Olympe::VisualScriptEditorPanel::m_focusNodeID = -1

Node ID to focus/scroll to on next RenderCanvas() frame (-1 = none)

Definition at line 775 of file VisualScriptEditorPanel.h.

◆ m_getBBPanel

std::unique_ptr<GetBBValuePropertyPanel> Olympe::VisualScriptEditorPanel::m_getBBPanel

Properties-panel sub-widget for the selected GetBBValue node.

Definition at line 911 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_imnodesContext

ImNodesEditorContext* Olympe::VisualScriptEditorPanel::m_imnodesContext = nullptr

Definition at line 706 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_justPerformedUndoRedo

bool Olympe::VisualScriptEditorPanel::m_justPerformedUndoRedo = false

Set to true immediately after Undo/Redo; blocks node movement tracking for 1 frame to allow ImNodes to render the new positions before resuming normal position sync.

Prevents stale drag-start positions.

Definition at line 720 of file VisualScriptEditorPanel.h.

◆ m_lastClickNodeID

int Olympe::VisualScriptEditorPanel::m_lastClickNodeID = -1

Node ID of the last left-click (for double-click detection)

Definition at line 982 of file VisualScriptEditorPanel.h.

◆ m_lastClickTime

float Olympe::VisualScriptEditorPanel::m_lastClickTime = 0.0f

Frame time of the last left-click (seconds, from ImGui::GetTime())

Definition at line 985 of file VisualScriptEditorPanel.h.

◆ m_lastViewportPanning

Vector Olympe::VisualScriptEditorPanel::m_lastViewportPanning = Vector(0.0f, 0.0f)

Canvas panning saved by ResetViewportBeforeSave() for restoration in AfterSave().

Definition at line 885 of file VisualScriptEditorPanel.h.

◆ m_libraryPanel

std::unique_ptr<ConditionPresetLibraryPanel> Olympe::VisualScriptEditorPanel::m_libraryPanel

Global condition preset library panel (UI for creating/editing/deleting presets).

Definition at line 920 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_mathOpPanel

std::unique_ptr<MathOpPropertyPanel> Olympe::VisualScriptEditorPanel::m_mathOpPanel

Properties-panel sub-widget for the selected MathOp node.

Definition at line 908 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_minimapPosition

int Olympe::VisualScriptEditorPanel::m_minimapPosition = 1

Minimap position (0=TopLeft, 1=TopRight, 2=BottomLeft, 3=BottomRight)

Definition at line 975 of file VisualScriptEditorPanel.h.

◆ m_minimapSize

float Olympe::VisualScriptEditorPanel::m_minimapSize = 0.15f

Minimap size ratio (0.05-0.5 of canvas)

Definition at line 972 of file VisualScriptEditorPanel.h.

◆ m_minimapVisible

bool Olympe::VisualScriptEditorPanel::m_minimapVisible = true

Minimap visibility flag for VisualScript canvas.

Definition at line 969 of file VisualScriptEditorPanel.h.

◆ m_needsPositionSync

bool Olympe::VisualScriptEditorPanel::m_needsPositionSync = false

◆ m_nextLinkID

int Olympe::VisualScriptEditorPanel::m_nextLinkID = 1

Next available ImNodes link ID.

Definition at line 740 of file VisualScriptEditorPanel.h.

Referenced by AllocLinkID().

◆ m_nextNodeID

int Olympe::VisualScriptEditorPanel::m_nextNodeID = 1

Next available node ID.

Definition at line 737 of file VisualScriptEditorPanel.h.

Referenced by AllocNodeID(), SyncCanvasFromTemplate(), and SyncEditorNodesFromTemplate().

◆ m_nodeDragStartPositions

std::unordered_map<int, std::pair<float, float> > Olympe::VisualScriptEditorPanel::m_nodeDragStartPositions

Per-node drag-start positions used to record a single MoveNodeCommand per drag gesture instead of one command per frame.

Key: nodeID Value: (posX, posY) at the moment the drag was detected.

Definition at line 824 of file VisualScriptEditorPanel.h.

Referenced by LoadTemplate(), and SyncEditorNodesFromTemplate().

◆ m_nodePropertiesPanelHeight

float Olympe::VisualScriptEditorPanel::m_nodePropertiesPanelHeight = 0.0f

Height of the Node Properties panel (Part A) in the right panel.

Adjusted by the drag-to-resize handle between Part A and Part B.

Definition at line 869 of file VisualScriptEditorPanel.h.

◆ m_paletteOpen

bool Olympe::VisualScriptEditorPanel::m_paletteOpen = false

Definition at line 700 of file VisualScriptEditorPanel.h.

◆ m_pendingAddPin

bool Olympe::VisualScriptEditorPanel::m_pendingAddPin = false

Pending dynamic pin addition (from [+] button clicked in canvas)

Definition at line 813 of file VisualScriptEditorPanel.h.

◆ m_pendingAddPinNodeID

int Olympe::VisualScriptEditorPanel::m_pendingAddPinNodeID = -1

Definition at line 814 of file VisualScriptEditorPanel.h.

◆ m_pendingBlackboardEdits

std::unordered_map<int, std::string> Olympe::VisualScriptEditorPanel::m_pendingBlackboardEdits

Deferred key-name edits for blackboard entries: index -> pending new key.

Committed in CommitPendingBlackboardEdits() before Save.

Definition at line 857 of file VisualScriptEditorPanel.h.

◆ m_pendingNodeDrop

bool Olympe::VisualScriptEditorPanel::m_pendingNodeDrop = false

True when a node drop is pending processing this frame.

Definition at line 833 of file VisualScriptEditorPanel.h.

◆ m_pendingNodeType

TaskNodeType Olympe::VisualScriptEditorPanel::m_pendingNodeType = TaskNodeType::EntryPoint

Definition at line 834 of file VisualScriptEditorPanel.h.

◆ m_pendingNodeX

float Olympe::VisualScriptEditorPanel::m_pendingNodeX = 0.0f

Definition at line 835 of file VisualScriptEditorPanel.h.

◆ m_pendingNodeY

float Olympe::VisualScriptEditorPanel::m_pendingNodeY = 0.0f

Definition at line 836 of file VisualScriptEditorPanel.h.

◆ m_pendingRemovePin

bool Olympe::VisualScriptEditorPanel::m_pendingRemovePin = false

Pending dynamic pin removal (from [-] button clicked in canvas)

Definition at line 817 of file VisualScriptEditorPanel.h.

◆ m_pendingRemovePinDynIdx

int Olympe::VisualScriptEditorPanel::m_pendingRemovePinDynIdx = -1

0-based index in DynamicExecOutputPins

Definition at line 819 of file VisualScriptEditorPanel.h.

◆ m_pendingRemovePinNodeID

int Olympe::VisualScriptEditorPanel::m_pendingRemovePinNodeID = -1

Definition at line 818 of file VisualScriptEditorPanel.h.

◆ m_pinManager

std::unique_ptr<DynamicDataPinManager> Olympe::VisualScriptEditorPanel::m_pinManager

Dynamic pin manager shared across all Branch nodes in this panel.

Definition at line 899 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), Shutdown(), and SyncCanvasFromTemplate().

◆ m_positionedNodes

std::unordered_set<int> Olympe::VisualScriptEditorPanel::m_positionedNodes

Nodes for which ImNodes has been given a position.

Definition at line 734 of file VisualScriptEditorPanel.h.

Referenced by Shutdown(), SyncCanvasFromTemplate(), SyncEditorNodesFromTemplate(), and SyncNodePositionsFromImNodes().

◆ m_presetBankPanelHeight

float Olympe::VisualScriptEditorPanel::m_presetBankPanelHeight = 0.0f

Height of the Preset Bank panel (Part B) in the right panel.

Adjusted by the drag-to-resize handle between Part B and Part C.

Definition at line 873 of file VisualScriptEditorPanel.h.

◆ m_presetRegistry

ConditionPresetRegistry Olympe::VisualScriptEditorPanel::m_presetRegistry

Global registry of ConditionPreset objects.

Loaded from Blueprints/Presets/condition_presets.json on Initialize().

Definition at line 896 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), LoadTemplate(), and SyncPresetsFromRegistryToTemplate().

◆ m_propEditNodeIDOnFocus

int Olympe::VisualScriptEditorPanel::m_propEditNodeIDOnFocus = -1

Node ID that was selected when RenderProperties() last entered focus.

Definition at line 794 of file VisualScriptEditorPanel.h.

◆ m_propEditOldBBKey

std::string Olympe::VisualScriptEditorPanel::m_propEditOldBBKey

Definition at line 800 of file VisualScriptEditorPanel.h.

◆ m_propEditOldConditionID

std::string Olympe::VisualScriptEditorPanel::m_propEditOldConditionID

Definition at line 799 of file VisualScriptEditorPanel.h.

◆ m_propEditOldDelay

float Olympe::VisualScriptEditorPanel::m_propEditOldDelay = 0.0f

Definition at line 803 of file VisualScriptEditorPanel.h.

◆ m_propEditOldMathOp

std::string Olympe::VisualScriptEditorPanel::m_propEditOldMathOp

Definition at line 801 of file VisualScriptEditorPanel.h.

◆ m_propEditOldName

std::string Olympe::VisualScriptEditorPanel::m_propEditOldName

Snapshot values captured at focus time for each editable field.

Definition at line 797 of file VisualScriptEditorPanel.h.

◆ m_propEditOldSubGraphPath

std::string Olympe::VisualScriptEditorPanel::m_propEditOldSubGraphPath

Definition at line 802 of file VisualScriptEditorPanel.h.

◆ m_propEditOldTaskID

std::string Olympe::VisualScriptEditorPanel::m_propEditOldTaskID

Definition at line 798 of file VisualScriptEditorPanel.h.

◆ m_propEditSwitchCases

std::vector<SwitchCaseDefinition> Olympe::VisualScriptEditorPanel::m_propEditSwitchCases

Per-case label edit buffers.

Definition at line 807 of file VisualScriptEditorPanel.h.

◆ m_propEditSwitchVar

std::string Olympe::VisualScriptEditorPanel::m_propEditSwitchVar

Live buffer for switchVariable field.

Definition at line 806 of file VisualScriptEditorPanel.h.

◆ m_propertiesPanelWidth

float Olympe::VisualScriptEditorPanel::m_propertiesPanelWidth = 0.0f

Width of the properties+blackboard panel on the right.

Adjusted by the drag-to-resize handle between the canvas and the panel.

Definition at line 865 of file VisualScriptEditorPanel.h.

◆ m_rightPanelTabSelection

int Olympe::VisualScriptEditorPanel::m_rightPanelTabSelection = 0

Phase 26 — Right panel tab selection 0 = Presets, 1 = Local Variables, 2 = Global Variables.

Definition at line 941 of file VisualScriptEditorPanel.h.

Referenced by RenderRightPanelTabContent(), and RenderRightPanelTabs().

◆ m_saveAsDirectory

std::string Olympe::VisualScriptEditorPanel::m_saveAsDirectory = "Blueprints/AI"

Currently selected destination directory.

Definition at line 847 of file VisualScriptEditorPanel.h.

◆ m_saveAsExtension

std::string Olympe::VisualScriptEditorPanel::m_saveAsExtension = ".ats"

Extension to append when saving (derived from m_currentPath; defaults to ".ats")

Definition at line 849 of file VisualScriptEditorPanel.h.

◆ m_saveAsFilename

char Olympe::VisualScriptEditorPanel::m_saveAsFilename[256]

Buffer for the user-entered filename (without extension)

Definition at line 845 of file VisualScriptEditorPanel.h.

Referenced by VisualScriptEditorPanel().

◆ m_selectedNodeID

int Olympe::VisualScriptEditorPanel::m_selectedNodeID = -1

◆ m_selectionRenderer

SelectionEffectRenderer Olympe::VisualScriptEditorPanel::m_selectionRenderer

Renders glow effect for selected nodes (cyan halo + thickened border).

Integrated into node rendering loop for correct scope and z-ordering. Provides unified selection UX across all canvas types.

Definition at line 958 of file VisualScriptEditorPanel.h.

◆ m_setBBPanel

std::unique_ptr<SetBBValuePropertyPanel> Olympe::VisualScriptEditorPanel::m_setBBPanel

Properties-panel sub-widget for the selected SetBBValue node.

Definition at line 914 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_showSaveAsDialog

bool Olympe::VisualScriptEditorPanel::m_showSaveAsDialog = false

True when the "Save As" modal should be opened next frame.

Definition at line 843 of file VisualScriptEditorPanel.h.

◆ m_simulationDone

bool Olympe::VisualScriptEditorPanel::m_simulationDone = false

True if simulation has been run.

Definition at line 768 of file VisualScriptEditorPanel.h.

Referenced by RunGraphSimulation().

◆ m_simulationTraces

std::vector<std::string> Olympe::VisualScriptEditorPanel::m_simulationTraces

Simulation execution traces (populated by RunGraphSimulation()) Phase 24.4 — added to verification logs for display.

Definition at line 765 of file VisualScriptEditorPanel.h.

Referenced by RunGraphSimulation().

◆ m_skipPositionSyncNextFrame

bool Olympe::VisualScriptEditorPanel::m_skipPositionSyncNextFrame = false

Set to true by Undo/Redo; causes next frame to skip SyncNodePositionsFromImNodes() so that the positions applied by SyncEditorNodesFromTemplate() are not overwritten by stale ImNodes state before the new positions have been rendered once.

Definition at line 715 of file VisualScriptEditorPanel.h.

◆ m_subGraphModal

std::unique_ptr<SubGraphFilePickerModal> Olympe::VisualScriptEditorPanel::m_subGraphModal

Phase 26 — SubGraph File Picker Modal.

Definition at line 926 of file VisualScriptEditorPanel.h.

Referenced by RenderSubGraphNodeProperties().

◆ m_switchCaseModal

std::unique_ptr<SwitchCaseEditorModal> Olympe::VisualScriptEditorPanel::m_switchCaseModal

Phase 26 — Switch Case Editor Modal.

Definition at line 923 of file VisualScriptEditorPanel.h.

Referenced by RenderSwitchNodeProperties().

◆ m_template

TaskGraphTemplate Olympe::VisualScriptEditorPanel::m_template

◆ m_topPanelTabSelection

int Olympe::VisualScriptEditorPanel::m_topPanelTabSelection = 0

Top panel tab selection (Part A of right panel) 0 = Properties, 1 = Nodes.

Definition at line 945 of file VisualScriptEditorPanel.h.

◆ m_undoStack

UndoRedoStack Olympe::VisualScriptEditorPanel::m_undoStack

Undo/Redo command stack for reversible graph editing operations.

Definition at line 810 of file VisualScriptEditorPanel.h.

Referenced by AddNode(), ConnectData(), ConnectExec(), RemoveLink(), RemoveNode(), RenderNodePropertiesPanelContent(), and RenderSwitchNodeProperties().

◆ m_validationErrors

std::vector<std::string> Olympe::VisualScriptEditorPanel::m_validationErrors

Definition at line 747 of file VisualScriptEditorPanel.h.

◆ m_validationWarnings

std::vector<std::string> Olympe::VisualScriptEditorPanel::m_validationWarnings

Validation messages (rebuilt each frame)

Definition at line 746 of file VisualScriptEditorPanel.h.

◆ m_variablePanel

std::unique_ptr<VariablePropertyPanel> Olympe::VisualScriptEditorPanel::m_variablePanel

Properties-panel sub-widget for the selected Variable node (data pure).

Definition at line 917 of file VisualScriptEditorPanel.h.

Referenced by Initialize(), and Shutdown().

◆ m_verificationDone

bool Olympe::VisualScriptEditorPanel::m_verificationDone = false

True once RunVerification() has been called at least once for the current graph.

Definition at line 757 of file VisualScriptEditorPanel.h.

Referenced by AddNode(), ConnectData(), ConnectExec(), LoadTemplate(), RemoveLink(), RemoveNode(), and RunGraphSimulation().

◆ m_verificationLogs

std::vector<std::string> Olympe::VisualScriptEditorPanel::m_verificationLogs

Verification log messages (populated by RunVerification()) Phase 24.3 — for display in the verification output panel.

Definition at line 761 of file VisualScriptEditorPanel.h.

Referenced by RunGraphSimulation().

◆ m_verificationLogsPanelHeight

float Olympe::VisualScriptEditorPanel::m_verificationLogsPanelHeight = 0.0f

Height of the Verification Logs panel in the left panel (Blueprint Files).

Adjusted by the drag-to-resize handle between Blueprint Files and Logs. Phase 24.3 — Added for verification output logging in left panel

Definition at line 878 of file VisualScriptEditorPanel.h.

◆ m_verificationResult

VSVerificationResult Olympe::VisualScriptEditorPanel::m_verificationResult

Latest verification result (produced by RunVerification())

Definition at line 754 of file VisualScriptEditorPanel.h.

◆ m_viewportResetDone

bool Olympe::VisualScriptEditorPanel::m_viewportResetDone = false

True after ResetViewportBeforeSave() has been called and before AfterSave().

Definition at line 888 of file VisualScriptEditorPanel.h.

◆ m_visible

bool Olympe::VisualScriptEditorPanel::m_visible = true

Definition at line 698 of file VisualScriptEditorPanel.h.

Referenced by IsVisible(), and SetVisible().


The documentation for this class was generated from the following files: