Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
VisualScriptEditorPanel.h
Go to the documentation of this file.
1/**
2 * @file VisualScriptEditorPanel.h
3 * @brief ImNodes-based graph editor for ATS Visual Script graphs (Phase 5).
4 * @author Olympe Engine
5 * @date 2026-03-09
6 *
7 * @details
8 * VisualScriptEditorPanel renders an interactive graph canvas using ImNodes.
9 * It supports creating, connecting, editing and saving VS graph nodes (v4 schema).
10 * It is loaded in place of NodeGraphPanel when the active graph has
11 * graphType == "VisualScript".
12 *
13 * C++14 compliant — no std::optional, structured bindings, std::filesystem.
14 */
15
16#pragma once
17
18#include <string>
19#include <vector>
20#include <unordered_map>
21#include <unordered_set>
22#include <memory>
23
24#include "../third_party/imgui/imgui.h"
25#include "../TaskSystem/TaskGraphTemplate.h"
26#include "../TaskSystem/LocalBlackboard.h"
27#include "../TaskSystem/EntityBlackboard.h"
28#include "../NodeGraphCore/GlobalTemplateBlackboard.h"
31#include "UndoRedoStack.h"
33#include "VSGraphVerifier.h"
34
35// Phase 24 — Condition Preset UI
36#include "../Editor/ConditionPreset/ConditionPresetRegistry.h"
37#include "../Editor/ConditionPreset/DynamicDataPinManager.h"
38#include "../Editor/Panels/NodeConditionsPanel.h"
39#include "../Editor/Panels/MathOpPropertyPanel.h"
40#include "../Editor/Panels/GetBBValuePropertyPanel.h"
41#include "../Editor/Panels/SetBBValuePropertyPanel.h"
42#include "../Editor/Panels/VariablePropertyPanel.h"
43#include "../Editor/Panels/ConditionPresetLibraryPanel.h"
44#include "../Editor/Nodes/NodeBranchRenderer.h"
45
46// Phase 26 — Switch Case Editor Modal
47#include "../Editor/Modals/SwitchCaseEditorModal.h"
48
49// Phase 26 — SubGraph File Picker Modal
50#include "../Editor/Modals/SubGraphFilePickerModal.h"
51
52// Phase 37 — Minimap integration
54
55// Forward-declare ImNodes context type (defined in imnodes.h) in the global
56// namespace so it can be referenced from within the Olympe namespace below.
58
59namespace Olympe {
60
61/**
62 * @struct VSEditorNode
63 * @brief Editor-side representation of a node in the VS graph canvas.
64 *
65 * Holds position, selection state, and mirrors TaskNodeDefinition data for
66 * display purposes.
67 */
69 int nodeID = -1;
70 float posX = 0.0f;
71 float posY = 0.0f;
72 bool selected = false;
73 bool positionSet = false;
75};
76
77/**
78 * @struct VSEditorLink
79 * @brief Editor-side representation of an exec or data connection.
80 */
82 int linkID = -1; ///< ImNodes link UID
83 int srcAttrID = -1; ///< Source attribute UID
84 int dstAttrID = -1; ///< Destination attribute UID
85 bool isData = false; ///< false = exec link, true = data link
86};
87
88/**
89 * @struct ExecutionToken
90 * @brief Represents a single execution point in graph simulation (Phase 24).
91 * Used for stack-based simulation of branching nodes (Sequence, Branch, etc.).
92 * Allows multiple parallel execution paths to be tracked and resumed.
93 */
95 int32_t nodeID = NODE_INDEX_NONE; ///< Current node to execute
96 int depth = 0; ///< Nesting depth (for indentation)
97
98 ExecutionToken() = default;
99 ExecutionToken(int32_t id, int d) : nodeID(id), depth(d) {}
100};
101
102/**
103 * @struct BlackboardValidationResult
104 * @brief Result of blackboard key validation (Phase 26).
105 * Contains error/warning messages and validity flag.
106 */
108 bool IsValid = true;
109 std::string ErrorMessage = ""; ///< Set if validation failed
110 std::string WarningMessage = ""; ///< Set if validation succeeded but has warnings
111};
112
113// ============================================================================
114// VisualScriptEditorPanel
115// ============================================================================
116
117/**
118 * @class VisualScriptEditorPanel
119 * @brief ImNodes graph editor for ATS Visual Script v4 graphs.
120 *
121 * @details
122 * Typical usage:
123 * @code
124 * // Editor initialization
125 * VisualScriptEditorPanel panel;
126 * panel.Initialize();
127 *
128 * // Each frame
129 * if (panel.IsVisible())
130 * panel.Render();
131 *
132 * // Shutdown
133 * panel.Shutdown();
134 * @endcode
135 */
137public:
138
141
142 void Initialize();
143 void Shutdown();
144
145 /**
146 * @brief Renders the full panel window.
147 * Calls RenderToolbar(), RenderCanvas(), RenderProperties(), RenderBlackboard().
148 */
149 void Render();
150
151 /**
152 * @brief Renders panel content without window wrapper - for fixed layout.
153 */
154 void RenderContent();
155
156 /** @brief Returns true if the panel window is visible. */
157 bool IsVisible() const { return m_visible; }
158
159 /** @brief Show / hide the panel. */
160 void SetVisible(bool v) { m_visible = v; }
161
162 // -----------------------------------------------------------------------
163 // Graph management
164 // -----------------------------------------------------------------------
165
166 /**
167 * @brief Loads a VS graph template into the editor canvas.
168 * @param tmpl Non-null pointer to the template to load.
169 * @param path File path associated with the template (for Save).
170 */
171 void LoadTemplate(const TaskGraphTemplate* tmpl, const std::string& path);
172
173 /**
174 * @brief Saves the current canvas state to JSON v4 at the loaded path.
175 * @return true on success.
176 */
177 bool Save();
178
179 /**
180 * @brief Saves the current canvas state to a new JSON v4 file.
181 * @param path Destination file path.
182 * @return true on success.
183 */
184 bool SaveAs(const std::string& path);
185
186 /**
187 * @brief Returns the currently loaded file path (empty if unsaved).
188 */
189 const std::string& GetCurrentPath() const { return m_currentPath; }
190
191 /**
192 * @brief Returns true when there are unsaved modifications.
193 */
194 bool IsDirty() const { return m_dirty; }
195
196 // -----------------------------------------------------------------------
197 // Node management (called by palette / tests)
198 // -----------------------------------------------------------------------
199
200 /**
201 * @brief Creates a new node on the canvas.
202 * @param type Node type.
203 * @param x Canvas X position.
204 * @param y Canvas Y position.
205 * @return The new node's ID.
206 */
207 int AddNode(TaskNodeType type, float x, float y);
208
209 /**
210 * @brief Removes a node from the canvas.
211 * @param nodeID Node ID to remove.
212 */
213 void RemoveNode(int nodeID);
214
215 /**
216 * @brief Creates an exec connection between two nodes.
217 * @param srcNodeID Source node ID.
218 * @param srcPinName Source exec-out pin name (e.g. "Then").
219 * @param dstNodeID Destination node ID.
220 * @param dstPinName Destination exec-in pin name (usually "In").
221 */
222 void ConnectExec(int srcNodeID, const std::string& srcPinName,
223 int dstNodeID, const std::string& dstPinName);
224
225 /**
226 * @brief Creates a data connection between two nodes.
227 */
228 void ConnectData(int srcNodeID, const std::string& srcPinName,
229 int dstNodeID, const std::string& dstPinName);
230
231 /**
232 * @brief Returns a reference to the internal template being edited.
233 * Used by tests to inspect the state.
234 */
235 const TaskGraphTemplate& GetTemplate() const { return m_template; }
236
237 /**
238 * @brief Public render method for verification logs panel.
239 * Called from BlueprintEditorGUI to display logs in the left panel.
240 *
241 * Phase 24.3 — For integration into the main layout's verification logs section.
242 */
244
245private:
246
247 // -----------------------------------------------------------------------
248 // Undo/Redo wrappers
249 // -----------------------------------------------------------------------
250
251 /**
252 * @brief Undoes the last command and syncs the canvas (nodes + links).
253 * Calls SyncEditorNodesFromTemplate() + RebuildLinks() so that ghost
254 * links are eliminated and node positions are restored correctly.
255 */
256 void PerformUndo();
257
258 /**
259 * @brief Re-applies the last undone command and syncs the canvas.
260 */
261 void PerformRedo();
262
263 // -----------------------------------------------------------------------
264 // Rendering sub-sections
265 // -----------------------------------------------------------------------
266
267 void RenderToolbar();
268 void RenderSaveAsDialog();
269 void RenderCanvas();
270 void RenderNodePalette();
271
272 /**
273 * @brief Render node/link context menus opened by right-click detection.
274 * Must be called AFTER EndNodeEditor() so popups are in correct ImGui scope.
275 */
276 void RenderContextMenus();
277
278 void RenderProperties();
279
280 /**
281 * @brief Phase 24 Global Blackboard — Renders global variables panel.
282 * Shows variables from GlobalTemplateBlackboard with current entity values.
283 * Called from RenderContent() as part of tab-based blackboard UI.
284 */
286
287 /**
288 * @brief Renders the Properties panel content for a selected Branch (or While) node.
289 *
290 * @details
291 * Displays a blue header with the node name (matching the canvas Section 1 title
292 * bar styling), then delegates to NodeConditionsPanel::Render() for the compact
293 * structured-conditions list, and finishes with a Breakpoint checkbox.
294 *
295 * The caller (RenderProperties) must @c return immediately after this call to
296 * prevent the legacy condition UI from also rendering.
297 *
298 * @param eNode Reference to the selected editor node (modified when dirty).
299 * @param def Reference to the node's TaskNodeDefinition (modified when dirty).
300 */
302
303 /**
304 * @brief Renders the Properties panel content for a selected MathOp node.
305 *
306 * @details
307 * Displays a blue header with the node name, then delegates to MathOpPropertyPanel::Render()
308 * for operand and operator editing.
309 *
310 * The caller (RenderProperties) must @c return immediately after this call to
311 * prevent any legacy UI from also rendering.
312 *
313 * @param eNode Reference to the selected editor node (modified when dirty).
314 * @param def Reference to the node's TaskNodeDefinition (modified when dirty).
315 */
317
318 /**
319 * @brief Renders the Properties panel content for a selected Switch node (Phase 1).
320 *
321 * @details
322 * Displays a blue header with the node name, then renders:
323 * - "Switch On:" dropdown to select the blackboard variable that controls the switch
324 * - Case count display
325 * - "Edit Switch Cases" button to open SwitchCaseEditorModal
326 * - Modal rendering with Apply integration (Phase 1 FIX: regenerates DynamicExecOutputPins)
327 * - Breakpoint checkbox
328 *
329 * Phase 1 Key Fix: After modal Apply, regenerates DynamicExecOutputPins from switchCases
330 * to ensure canvas pins are synchronized with semantic data.
331 *
332 * @param eNode Reference to the selected editor node (modified when dirty).
333 * @param def Reference to the node's TaskNodeDefinition (modified when dirty).
334 */
336
337 /**
338 * @brief Renders node parameters for data nodes (GetBBValue, SetBBValue, MathOp).
339 *
340 * @details
341 * Displays a parameters section that allows editing generic parameters that can
342 * be stored and serialized alongside node-specific properties.
343 *
344 * @param def Reference to the node's TaskNodeDefinition (modified when dirty).
345 */
347
348 void RenderBlackboard();
351
352 /// Part A: Node Properties panel (top-left of right panel)
354
355 /// Phase 31 — Content of Properties tab in Part A
357
358 /// Phase 31 — Nodes list tab in Part A (available nodes for dragging to canvas)
360
361 /// Phase 24 — Property panel renderers for While, ForEach, and SubGraph nodes
365
366 /// Part B: Preset Bank panel (middle of right panel)
368
369 /// Render a single preset item in compact horizontal format with index
371
372 /// Phase 26 — Tab system: Renders the tab bar for the 3-panel right section
373 /// Displays tabs for Presets, Local Variables, and Global Variables
375
376 /// Phase 26 — Tab system: Renders the content of the active tab
377 /// Dispatches to appropriate render function based on m_rightPanelTabSelection
379
380 /// Render a single operand with dropdown for mode and value editor
381 /// Returns true if the operand was modified
383
384 /// Part C: Local Variables reference panel (bottom of right panel)
386
387 /** @brief Renders the verification results panel (Phase 21-B). */
389
390 /** @brief Runs VSGraphVerifier on the current graph and stores the result. */
391 void RunVerification();
392
393 /** @brief Simulates runtime execution of the current graph and logs traces. */
394 void RunGraphSimulation();
395
396private:
397 // Phase 25 — Recursive SubGraph execution helper
398 /**
399 * @brief Internal recursive simulation function with cycle detection.
400 *
401 * @param tmpl The graph template to simulate
402 * @param blackboard Current execution blackboard (isolated per SubGraph)
403 * @param visitedGraphs Set of visited graph file paths (for cycle detection)
404 * @param recursionDepth Current recursion depth (0 for root call)
405 * @param traceIndent Indentation prefix for trace messages
406 *
407 * Phase 25: Tracks visited graph files and recursion depth to prevent infinite loops.
408 * Warns at depth > 10, stops at depth >= 20.
409 */
411 const TaskGraphTemplate* tmpl,
412 std::map<std::string, TaskValue>& blackboard,
413 std::unordered_set<std::string>& visitedGraphs,
414 int recursionDepth,
415 const std::string& traceIndent);
416
417 // Phase 24 — Simulation helper methods
418
419 /**
420 * @brief Helper to recursively evaluate data nodes (MathOp, GetBBValue, etc.)
421 * and trace their execution. Used when data pins reference other nodes.
422 * @param nodeID ID of the data node to evaluate
423 * @param depth Current trace indentation depth
424 * @param indent Indentation string prefix for logs
425 */
426 void EvaluateDataNode(int32_t nodeID, int depth, const std::string& indent);
427
428 /**
429 * @brief Recursively traces all upstream pure data nodes in the graph.
430 * Walks data connections backward to show complete data dependency chains.
431 * @param sourceNodeID ID of the node to trace upstream from
432 * @param indent Indentation string prefix for logs
433 * @param visitedDataNodes Set of visited node IDs (prevents cycles)
434 */
436 const std::string& indent,
437 std::unordered_set<int>& visitedDataNodes);
438
439 /**
440 * @brief Gets a comprehensive property string for any node type.
441 * Returns all relevant properties formatted for display in traces.
442 * @param node The node definition to describe
443 * @return Formatted property string with all relevant fields
444 */
446
447 /**
448 * @brief Format task parameters into a readable string.
449 * Extracts parameter names and values for display in traces.
450 * @param parameters Parameter binding map from a task node
451 * @param indent Indentation string prefix for formatting
452 * @return Formatted parameter string
453 */
454 std::string FormatTaskParameters(const std::unordered_map<std::string, ParameterBinding>& parameters,
455 const std::string& indent);
456
457 public:
458
459 /**
460 * @brief Removes blackboard entries with empty keys or VariableType::None.
461 *
462 * Called before serialization (Fix #1) to guarantee the blackboard is clean.
463 * Logs each removed entry to SYSTEM_LOG.
464 */
466
467 /**
468 * @brief Commits any pending key-name edits stored in m_pendingBlackboardEdits.
469 *
470 * Flushes deferred InputText changes so that the template reflects the
471 * most recent user input before Save is attempted.
472 */
474
475 /**
476 * @brief Resets the ImNodes canvas panning to (0,0) before saving node positions.
477 *
478 * BUG-003 Fix: Saves current panning in m_lastViewportPanning for optional
479 * restoration after save. Node positions are stored in grid space (independent
480 * of viewport pan) via GetNodeGridSpacePos(), so this reset is a belt-and-
481 * suspenders safety measure rather than strictly required.
482 */
484
485 /**
486 * @brief Restores the ImNodes canvas panning saved by ResetViewportBeforeSave().
487 *
488 * BUG-003 Fix #5 (optional UX continuity): call after SerializeAndWrite()
489 * so the viewport does not visually jump for the user.
490 */
491 void AfterSave();
492
493 /**
494 * @brief Converts a screen-space position to canvas (editor) space.
495 *
496 * @param screenPos Position in absolute screen-pixel coordinates.
497 * @return Position in ImNodes editor (canvas) space.
498 *
499 * Correct conversion: removes canvas origin and viewport pan, then
500 * divides by zoom (ImNodes 0.4 has no zoom, zoom is always 1.0f).
501 */
503
504 /**
505 * @brief Returns a filtered subset of blackboard entries matching a type.
506 *
507 * UX Enhancement #3 — used by type-filtered variable dropdowns so that,
508 * e.g., a Switch node only shows Int variables in its combo box.
509 *
510 * @param allVars Full blackboard variable list to filter.
511 * @param expectedType The VariableType to keep.
512 * @return Vector containing only entries whose Type == expectedType.
513 */
514 static std::vector<BlackboardEntry> GetVariablesByType(
515 const std::vector<BlackboardEntry>& allVars,
516 VariableType expectedType);
517
518 // -----------------------------------------------------------------------
519 // Phase 26 — Blackboard Validation Helpers
520 // -----------------------------------------------------------------------
521
522 /**
523 * @brief Validates a blackboard key according to schema rules.
524 *
525 * Rules:
526 * 1. Key must not be empty
527 * 2. Key must not be a duplicate
528 * 3. Global keys should follow "scope:key" format (warning)
529 *
530 * @param key The key to validate
531 * @param isGlobal Whether this is a global variable
532 * @param excludeIndex Skip duplicate check for entry at index (-1 = check all)
533 * @return Validation result with IsValid flag and messages
534 */
536 const std::string& key,
537 bool isGlobal,
538 int excludeIndex = -1);
539
540 /**
541 * @brief Validates a complete blackboard entry.
542 *
543 * Checks that the entry has a non-empty key and a valid type.
544 *
545 * @param entry The entry to validate
546 * @return true if entry is valid, false otherwise
547 */
549
550 // -----------------------------------------------------------------------
551 // Phase 23-B.4 — Condition Editor UI helpers
552 // -----------------------------------------------------------------------
553
554 /**
555 * @brief Renders the full editor UI for one Condition entry on a Branch/While node.
556 *
557 * Shows left/right mode selectors (Pin | Variable | Const), value inputs,
558 * an operator combo, and a live preview line.
559 *
560 * @param condition Reference to the condition being edited (modified in place).
561 * @param conditionIndex 0-based index used for ImGui PushID uniqueness.
562 * @param allVars Full blackboard entry list for variable dropdowns.
563 * @param availablePins List of available pin references for Pin mode.
564 */
566 int conditionIndex,
567 const std::vector<BlackboardEntry>& allVars,
568 const std::vector<std::string>& availablePins);
569
570 /**
571 * @brief Renders a type-filtered variable selector combo box.
572 *
573 * Only variables whose Type matches expectedType are shown.
574 *
575 * @param selectedVar Currently selected variable name (modified on change).
576 * @param allVars Full blackboard entry list to filter.
577 * @param expectedType VariableType used to filter entries.
578 * @param label ImGui widget label.
579 */
580 void RenderVariableSelector(std::string& selectedVar,
581 const std::vector<BlackboardEntry>& allVars,
582 VariableType expectedType,
583 const char* label);
584
585 /**
586 * @brief Renders a type-aware const value input widget.
587 *
588 * Bool -> Checkbox, Int -> InputInt, Float -> InputFloat,
589 * String -> InputText, Vector -> InputFloat3.
590 *
591 * @param value TaskValue to edit (modified on change).
592 * @param varType Determines which widget to display.
593 * @param label ImGui widget label.
594 */
597 const char* label);
598
599 /**
600 * @brief Renders a pin selector combo box.
601 *
602 * @param selectedPin Currently selected pin reference (modified on change).
603 * @param availablePins List of available pin reference strings.
604 * @param label ImGui widget label.
605 */
606 void RenderPinSelector(std::string& selectedPin,
607 const std::vector<std::string>& availablePins,
608 const char* label);
609
610 /**
611 * @brief Builds a human-readable preview string for a condition.
612 *
613 * Format: "[Left] <op> [Right]", e.g. "[Var: health] > [Const: 50]".
614 *
615 * @param cond The condition to describe.
616 * @return Preview string.
617 */
618 static std::string BuildConditionPreview(const Condition& cond);
619
620 // -----------------------------------------------------------------------
621 // Canvas helpers
622 // -----------------------------------------------------------------------
623
624 int AllocNodeID();
625 int AllocLinkID();
626
627 /** Maps node ID -> ImNodes attribute UID for an exec-in pin. */
628 int ExecInAttrUID(int nodeID) const;
629 /** Maps node ID + pin index -> ImNodes attribute UID for exec-out pins. */
630 int ExecOutAttrUID(int nodeID, int pinIndex) const;
631 /** Maps node ID + data pin index -> ImNodes attribute UID for data-in pins. */
632 int DataInAttrUID(int nodeID, int pinIndex) const;
633 /** Maps node ID + data pin index -> ImNodes attribute UID for data-out pins. */
634 int DataOutAttrUID(int nodeID, int pinIndex) const;
635
636 /** Returns the exec-out pin names for a node type. */
637 static std::vector<std::string> GetExecOutputPins(TaskNodeType type);
638
639 /**
640 * @brief Returns exec-out pin names for a node definition,
641 * including any dynamically-added pins (VSSequence).
642 */
643 std::vector<std::string> GetExecOutputPinsForNode(const TaskNodeDefinition& def) const;
644
645 /** Returns the exec-in pin names for a node type. */
646 static std::vector<std::string> GetExecInputPins(TaskNodeType type);
647
648 /** Returns the data-in pin names for a node type. */
649 static std::vector<std::string> GetDataInputPins(TaskNodeType type);
650
651 /** Returns the data-out pin names for a node type. */
652 static std::vector<std::string> GetDataOutputPins(TaskNodeType type);
653
654 /** Builds the in-memory TaskGraphTemplate from the editor nodes/links. */
656
657 /** Builds the editor canvas from the in-memory TaskGraphTemplate. */
659
660 /** Rebuilds ImNodes exec/data link arrays from the template. */
661 void RebuildLinks();
662
663 /**
664 * @brief Rebuilds m_editorNodes from m_template, preserving existing node positions.
665 * Called after Undo/Redo to synchronise the canvas with the template state.
666 */
668
669 /**
670 * @brief Removes an ImNodes link (and its underlying template connection) by link ID.
671 * @param linkID The ImNodes link UID to remove.
672 */
673 void RemoveLink(int linkID);
674
675 /** Serializes the template to JSON v4 and writes to a file. */
676 bool SerializeAndWrite(const std::string& path);
677
678 /**
679 * @brief Pulls the current node positions from ImNodes into m_editorNodes.
680 * Only nodes that have been rendered at least once (present in
681 * m_positionedNodes) are updated to avoid ImNodes assertions.
682 * Must be called before serialization to capture user-moved positions.
683 */
685
686 /**
687 * @brief Syncs ALL presets from the registry to the template.
688 * Phase 24 FIX: Ensures that presets created/modified via UI are included in save.
689 * Previously, only presets modified via operand editor were synced; newly created
690 * presets were missed. Now called before serialization to guarantee completeness.
691 */
693
694 // -----------------------------------------------------------------------
695 // State
696 // -----------------------------------------------------------------------
697
698 bool m_visible = true;
699 bool m_dirty = false;
700 bool m_paletteOpen = false;
701
702 // Per-instance ImNodes editor context.
703 // Created in Initialize() and destroyed in Shutdown().
704 // Set as the active context at the start of every RenderCanvas() call so
705 // that node positions / panning are preserved independently per tab.
707
708 // True after LoadTemplate() until the first RenderCanvas() call that
709 // applies SetNodeEditorSpacePos for all loaded nodes.
711
712 /// Set to true by Undo/Redo; causes next frame to skip SyncNodePositionsFromImNodes()
713 /// so that the positions applied by SyncEditorNodesFromTemplate() are not overwritten
714 /// by stale ImNodes state before the new positions have been rendered once.
716
717 /// Set to true immediately after Undo/Redo; blocks node movement tracking
718 /// for 1 frame to allow ImNodes to render the new positions before resuming
719 /// normal position sync. Prevents stale drag-start positions.
721
722 std::string m_currentPath;
723
724 /// The template currently being edited
726
727 /// Editor nodes (mirrors m_template.Nodes + position/selection state)
728 std::vector<VSEditorNode> m_editorNodes;
729
730 /// Editor links (exec + data)
731 std::vector<VSEditorLink> m_editorLinks;
732
733 /// Nodes for which ImNodes has been given a position
734 std::unordered_set<int> m_positionedNodes;
735
736 /// Next available node ID
738
739 /// Next available ImNodes link ID
741
742 /// Currently selected node (for properties panel)
744
745 /// Validation messages (rebuilt each frame)
746 std::vector<std::string> m_validationWarnings;
747 std::vector<std::string> m_validationErrors;
748
749 // -----------------------------------------------------------------------
750 // Phase 21-B — Graph Verification
751 // -----------------------------------------------------------------------
752
753 /// Latest verification result (produced by RunVerification())
755
756 /// True once RunVerification() has been called at least once for the current graph
757 bool m_verificationDone = false;
758
759 /// Verification log messages (populated by RunVerification())
760 /// Phase 24.3 — for display in the verification output panel
761 std::vector<std::string> m_verificationLogs;
762
763 /// Simulation execution traces (populated by RunGraphSimulation())
764 /// Phase 24.4 — added to verification logs for display
765 std::vector<std::string> m_simulationTraces;
766
767 /// True if simulation has been run
768 bool m_simulationDone = false;
769
770 /// Phase 24.4 — Execution token stack for multi-branch simulation
771 /// Enables proper handling of Sequence nodes with multiple branches
772 std::vector<ExecutionToken> m_executionTokenStack;
773
774 /// Node ID to focus/scroll to on next RenderCanvas() frame (-1 = none)
776
777 /// Right-click paste position
778 float m_contextMenuX = 0.0f;
779 float m_contextMenuY = 0.0f;
780
781 /// Node ID captured at the moment a right-click context menu was opened on a node
783
784 /// Link ID captured at the moment a right-click context menu was opened on a link
786
787 // -----------------------------------------------------------------------
788 // Properties panel — undo snapshot state
789 // "commit on release" pattern: snapshot the field value when the widget
790 // receives focus (IsItemActivated), push undo only on IsItemDeactivatedAfterEdit.
791 // -----------------------------------------------------------------------
792
793 /// Node ID that was selected when RenderProperties() last entered focus
795
796 /// Snapshot values captured at focus time for each editable field
797 std::string m_propEditOldName;
803 float m_propEditOldDelay = 0.0f;
804
805 // Switch-specific edit state (Phase 22-A)
806 std::string m_propEditSwitchVar; ///< Live buffer for switchVariable field
807 std::vector<SwitchCaseDefinition> m_propEditSwitchCases; ///< Per-case label edit buffers
808
809 /// Undo/Redo command stack for reversible graph editing operations
811
812 /// Pending dynamic pin addition (from [+] button clicked in canvas)
813 bool m_pendingAddPin = false;
815
816 /// Pending dynamic pin removal (from [-] button clicked in canvas)
817 bool m_pendingRemovePin = false;
819 int m_pendingRemovePinDynIdx = -1; ///< 0-based index in DynamicExecOutputPins
820
821 /// Per-node drag-start positions used to record a single MoveNodeCommand
822 /// per drag gesture instead of one command per frame.
823 /// Key: nodeID Value: (posX, posY) at the moment the drag was detected.
824 std::unordered_map<int, std::pair<float, float> > m_nodeDragStartPositions;
825
826 // -----------------------------------------------------------------------
827 // Drag & drop pending state (two-phase node creation)
828 // Phase 1: detect drop inside BeginDragDropTarget, store params
829 // Phase 2: create node after EndNodeEditor (outside editor scope)
830 // -----------------------------------------------------------------------
831
832 /// True when a node drop is pending processing this frame
833 bool m_pendingNodeDrop = false;
835 float m_pendingNodeX = 0.0f;
836 float m_pendingNodeY = 0.0f;
837
838 // -----------------------------------------------------------------------
839 // Save As dialog state
840 // -----------------------------------------------------------------------
841
842 /// True when the "Save As" modal should be opened next frame
843 bool m_showSaveAsDialog = false;
844 /// Buffer for the user-entered filename (without extension)
846 /// Currently selected destination directory
847 std::string m_saveAsDirectory = "Blueprints/AI";
848 /// Extension to append when saving (derived from m_currentPath; defaults to ".ats")
849 std::string m_saveAsExtension = ".ats";
850
851 // -----------------------------------------------------------------------
852 // Blackboard edit state (BUG-002)
853 // -----------------------------------------------------------------------
854
855 /// Deferred key-name edits for blackboard entries: index -> pending new key.
856 /// Committed in CommitPendingBlackboardEdits() before Save.
857 std::unordered_map<int, std::string> m_pendingBlackboardEdits;
858
859 // -----------------------------------------------------------------------
860 // Layout state (UX — resizable properties panel)
861 // -----------------------------------------------------------------------
862
863 /// Width of the properties+blackboard panel on the right.
864 /// Adjusted by the drag-to-resize handle between the canvas and the panel.
866
867 /// Height of the Node Properties panel (Part A) in the right panel.
868 /// Adjusted by the drag-to-resize handle between Part A and Part B.
870
871 /// Height of the Preset Bank panel (Part B) in the right panel.
872 /// Adjusted by the drag-to-resize handle between Part B and Part C.
874
875 /// Height of the Verification Logs panel in the left panel (Blueprint Files).
876 /// Adjusted by the drag-to-resize handle between Blueprint Files and Logs.
877 /// Phase 24.3 — Added for verification output logging in left panel
879
880 // -----------------------------------------------------------------------
881 // Viewport save/restore state (BUG-003 Fix)
882 // -----------------------------------------------------------------------
883
884 /// Canvas panning saved by ResetViewportBeforeSave() for restoration in AfterSave().
886
887 /// True after ResetViewportBeforeSave() has been called and before AfterSave().
889
890 // -----------------------------------------------------------------------
891 // Phase 24 — Condition Preset UI (NodeConditionsPanel integration)
892 // -----------------------------------------------------------------------
893
894 /// Global registry of ConditionPreset objects. Loaded from
895 /// Blueprints/Presets/condition_presets.json on Initialize().
897
898 /// Dynamic pin manager shared across all Branch nodes in this panel.
899 std::unique_ptr<DynamicDataPinManager> m_pinManager;
900
901 /// Specialized renderer for Branch nodes (4-section layout with conditions).
902 std::unique_ptr<NodeBranchRenderer> m_branchRenderer;
903
904 /// Properties-panel sub-widget for the selected Branch node.
905 std::unique_ptr<NodeConditionsPanel> m_conditionsPanel;
906
907 /// Properties-panel sub-widget for the selected MathOp node.
908 std::unique_ptr<MathOpPropertyPanel> m_mathOpPanel;
909
910 /// Properties-panel sub-widget for the selected GetBBValue node.
911 std::unique_ptr<GetBBValuePropertyPanel> m_getBBPanel;
912
913 /// Properties-panel sub-widget for the selected SetBBValue node.
914 std::unique_ptr<SetBBValuePropertyPanel> m_setBBPanel;
915
916 /// Properties-panel sub-widget for the selected Variable node (data pure).
917 std::unique_ptr<VariablePropertyPanel> m_variablePanel;
918
919 /// Global condition preset library panel (UI for creating/editing/deleting presets).
920 std::unique_ptr<ConditionPresetLibraryPanel> m_libraryPanel;
921
922 /// Phase 26 — Switch Case Editor Modal
923 std::unique_ptr<SwitchCaseEditorModal> m_switchCaseModal;
924
925 /// Phase 26 — SubGraph File Picker Modal
926 std::unique_ptr<SubGraphFilePickerModal> m_subGraphModal;
927
928 /// ID of the node currently loaded into m_conditionsPanel (-1 = none).
930
931 // -----------------------------------------------------------------------
932 // Phase 24 Global Blackboard Integration
933 // -----------------------------------------------------------------------
934
935 /// Per-entity blackboard instance (combines local + global variables)
936 /// Created in Initialize() and manages scope-aware access to both local and global vars.
937 std::unique_ptr<EntityBlackboard> m_entityBlackboard;
938
939 /// Phase 26 — Right panel tab selection
940 /// 0 = Presets, 1 = Local Variables, 2 = Global Variables
942
943 /// Top panel tab selection (Part A of right panel)
944 /// 0 = Properties, 1 = Nodes
946
947 // -----------------------------------------------------------------------
948 // Phase 33 — Selection Effect Renderer (In-Loop Glow System)
949 // -----------------------------------------------------------------------
950
951 // -----------------------------------------------------------------------
952 // Phase 33 — Selection Effect Renderer (In-Loop Glow System)
953 // -----------------------------------------------------------------------
954
955 /// Renders glow effect for selected nodes (cyan halo + thickened border).
956 /// Integrated into node rendering loop for correct scope and z-ordering.
957 /// Provides unified selection UX across all canvas types.
959
960 // -----------------------------------------------------------------------
961 // Phase 37 — Canvas Editor Minimap Support
962 // -----------------------------------------------------------------------
963
964 /// Canvas editor adapter for minimap support (Phase 37)
965 /// Abstracts imnodes minimap rendering through ICanvasEditor interface
966 std::unique_ptr<ImNodesCanvasEditor> m_canvasEditor;
967
968 /// Minimap visibility flag for VisualScript canvas
969 bool m_minimapVisible = true;
970
971 /// Minimap size ratio (0.05-0.5 of canvas)
972 float m_minimapSize = 0.15f;
973
974 /// Minimap position (0=TopLeft, 1=TopRight, 2=BottomLeft, 3=BottomRight)
975 int m_minimapPosition = 1; // TopRight by default
976
977 // -----------------------------------------------------------------------
978 // Double-Click Detection (SubGraph / Node Navigation)
979 // -----------------------------------------------------------------------
980
981 /// Node ID of the last left-click (for double-click detection)
983
984 /// Frame time of the last left-click (seconds, from ImGui::GetTime())
985 float m_lastClickTime = 0.0f;
986
987 /// Threshold for detecting double-click (300ms)
988 static constexpr float DOUBLE_CLICK_THRESHOLD = 0.3f;
989
990 /**
991 * @brief Handles double-click on a node (opens SubGraph, etc).
992 * @param nodeID ID of the node that was double-clicked.
993 */
994 void OnNodeDoubleClicked(int nodeID);
995
996 /**
997 * @brief Extracts SubGraph file path from a node definition.
998 * @param def The node definition to check.
999 * @return The SubGraphPath if node is SubGraph type and path is set, else empty string.
1000 */
1001 std::string GetNodeSubGraphPath(const TaskNodeDefinition& def) const;
1002};
1003
1004} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
ICanvasEditor adapter for ImNodes-based editors (VisualScript)
Undo/Redo command stack for ATS Visual Scripting editor (Phase 6).
Stateless validator for exec connections in Visual Script graphs (Phase 20-B).
Global graph verifier for ATS Visual Script graphs (Phase 21-A).
Node style rendering helpers for VisualScriptEditorPanel (Phase 5).
Manages the global pool of ConditionPreset objects.
Encapsule l'effet de sélection des nodes (glow + bordure épaisse)
Immutable, shareable task graph asset.
C++14-compliant type-safe value container for task parameters.
Bounded stack of reversible editor commands.
ImNodes graph editor for ATS Visual Script v4 graphs.
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::vector< std::string > m_validationErrors
std::unique_ptr< DynamicDataPinManager > m_pinManager
Dynamic pin manager shared across all Branch nodes in this panel.
UndoRedoStack m_undoStack
Undo/Redo command stack for reversible graph editing operations.
float m_contextMenuX
Right-click paste position.
bool Save()
Saves the current canvas state to JSON v4 at the loaded path.
void OnNodeDoubleClicked(int nodeID)
Handles double-click on a node (opens SubGraph, etc).
void RunGraphSimulation()
Simulates runtime execution of the current graph and logs traces.
void RenderSwitchNodeProperties(VSEditorNode &eNode, TaskNodeDefinition &def)
Renders the Properties panel content for a selected Switch node (Phase 1).
void PerformRedo()
Re-applies the last undone command and syncs the canvas.
void RenderPresetItemCompact(const ConditionPreset &preset, size_t index)
Render a single preset item in compact horizontal format with index.
bool IsVisible() const
Returns true if the panel window is visible.
bool m_pendingRemovePin
Pending dynamic pin removal (from [-] button clicked in canvas)
char m_saveAsFilename[256]
Buffer for the user-entered filename (without extension)
std::vector< VSEditorLink > m_editorLinks
Editor links (exec + data)
std::unique_ptr< VariablePropertyPanel > m_variablePanel
Properties-panel sub-widget for the selected Variable node (data pure).
float m_verificationLogsPanelHeight
Height of the Verification Logs panel in the left panel (Blueprint Files).
VisualScriptEditorPanel()
VisualScriptEditorPanel Constructor.
int ExecOutAttrUID(int nodeID, int pinIndex) const
Maps node ID + pin index -> ImNodes attribute UID for exec-out pins.
TaskGraphTemplate m_template
The template currently being edited.
void Shutdown()
Shutdown the editor panel and release all resources.
float m_nodePropertiesPanelHeight
Height of the Node Properties panel (Part A) in the right panel.
void RenderAvailableNodesList()
Phase 31 — Nodes list tab in Part A (available nodes for dragging to canvas)
void CommitPendingBlackboardEdits()
Commits any pending key-name edits stored in m_pendingBlackboardEdits.
void RenderNodePropertiesPanelContent()
Phase 31 — Content of Properties tab in Part A.
void EvaluateDataNode(int32_t nodeID, int depth, const std::string &indent)
Helper to recursively evaluate data nodes (MathOp, GetBBValue, etc.) and trace their execution.
int m_lastClickNodeID
Node ID of the last left-click (for double-click detection)
std::unique_ptr< MathOpPropertyPanel > m_mathOpPanel
Properties-panel sub-widget for the selected MathOp node.
void RenderRightPanelTabs()
Phase 26 — Tab system: Renders the tab bar for the 3-panel right section Displays tabs for Presets,...
void Initialize()
Initialize the editor panel with ImNodes context and UI helpers.
void RemoveNode(int nodeID)
Removes a node from the canvas.
std::string FormatTaskParameters(const std::unordered_map< std::string, ParameterBinding > &parameters, const std::string &indent)
Format task parameters into a readable string.
std::unique_ptr< SwitchCaseEditorModal > m_switchCaseModal
Phase 26 — Switch Case Editor Modal.
std::unique_ptr< EntityBlackboard > m_entityBlackboard
Per-entity blackboard instance (combines local + global variables) Created in Initialize() and manage...
bool m_simulationDone
True if simulation has been run.
void RemoveLink(int linkID)
Removes an ImNodes link (and its underlying template connection) by link ID.
bool m_skipPositionSyncNextFrame
Set to true by Undo/Redo; causes next frame to skip SyncNodePositionsFromImNodes() so that the positi...
void PerformUndo()
Undoes the last command and syncs the canvas (nodes + links).
int m_condPanelNodeID
ID of the node currently loaded into m_conditionsPanel (-1 = none).
std::vector< std::string > m_verificationLogs
Verification log messages (populated by RunVerification()) Phase 24.3 — for display in the verificati...
void ConnectData(int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
Creates a data connection between two nodes.
static std::vector< std::string > GetExecInputPins(TaskNodeType type)
Returns the exec-in pin names for a node type.
std::string GetNodePropertyString(const TaskNodeDefinition &node)
Gets a comprehensive property string for any node type.
void Render()
Renders the full panel window.
static constexpr float DOUBLE_CLICK_THRESHOLD
Threshold for detecting double-click (300ms)
void RenderContent()
Renders panel content without window wrapper - for fixed layout.
void RenderVariableSelector(std::string &selectedVar, const std::vector< BlackboardEntry > &allVars, VariableType expectedType, const char *label)
Renders a type-filtered variable selector combo box.
std::unique_ptr< NodeConditionsPanel > m_conditionsPanel
Properties-panel sub-widget for the selected Branch node.
std::unique_ptr< NodeBranchRenderer > m_branchRenderer
Specialized renderer for Branch nodes (4-section layout with conditions).
int m_contextLinkID
Link ID captured at the moment a right-click context menu was opened on a link.
void ConnectExec(int srcNodeID, const std::string &srcPinName, int dstNodeID, const std::string &dstPinName)
Creates an exec connection between two nodes.
const std::string & GetCurrentPath() const
Returns the currently loaded file path (empty if unsaved).
void SyncCanvasFromTemplate()
Builds the editor canvas from the in-memory TaskGraphTemplate.
bool ValidateBlackboardEntry(const BlackboardEntry &entry)
Validates a complete blackboard entry.
void SyncTemplateFromCanvas()
Builds the in-memory TaskGraphTemplate from the editor nodes/links.
void RenderWhileNodeProperties()
Phase 24 — Property panel renderers for While, ForEach, and SubGraph nodes.
void AfterSave()
Restores the ImNodes canvas panning saved by ResetViewportBeforeSave().
std::unique_ptr< SubGraphFilePickerModal > m_subGraphModal
Phase 26 — SubGraph File Picker Modal.
static std::vector< std::string > GetDataOutputPins(TaskNodeType type)
Returns the data-out pin names for a node type.
Vector m_lastViewportPanning
Canvas panning saved by ResetViewportBeforeSave() for restoration in AfterSave().
std::vector< SwitchCaseDefinition > m_propEditSwitchCases
Per-case label edit buffers.
bool m_pendingNodeDrop
True when a node drop is pending processing this frame.
void RenderNodePropertiesPanel()
Part A: Node Properties panel (top-left of right panel)
void RenderContextMenus()
Render node/link context menus opened by right-click detection.
std::unordered_map< int, std::string > m_pendingBlackboardEdits
Deferred key-name edits for blackboard entries: index -> pending new key.
void RenderGlobalVariablesPanel()
Phase 24 Global Blackboard — Renders global variables panel.
std::vector< ExecutionToken > m_executionTokenStack
Phase 24.4 — Execution token stack for multi-branch simulation Enables proper handling of Sequence no...
void ValidateAndCleanBlackboardEntries()
Removes blackboard entries with empty keys or VariableType::None.
int AddNode(TaskNodeType type, float x, float y)
Creates a new node on the canvas.
bool IsDirty() const
Returns true when there are unsaved modifications.
std::vector< std::string > m_validationWarnings
Validation messages (rebuilt each frame)
VSVerificationResult m_verificationResult
Latest verification result (produced by RunVerification())
int m_pendingRemovePinDynIdx
0-based index in DynamicExecOutputPins
void RenderLocalVariablesPanel()
Part C: Local Variables reference panel (bottom of right panel)
void RenderPinSelector(std::string &selectedPin, const std::vector< std::string > &availablePins, const char *label)
Renders a pin selector combo box.
void RenderMathOpNodeProperties(VSEditorNode &eNode, TaskNodeDefinition &def)
Renders the Properties panel content for a selected MathOp node.
std::unique_ptr< GetBBValuePropertyPanel > m_getBBPanel
Properties-panel sub-widget for the selected GetBBValue node.
void SyncPresetsFromRegistryToTemplate()
Syncs ALL presets from the registry to the template.
void RunVerification()
Runs VSGraphVerifier on the current graph and stores the result.
bool m_viewportResetDone
True after ResetViewportBeforeSave() has been called and before AfterSave().
void RenderBranchNodeProperties(VSEditorNode &eNode, TaskNodeDefinition &def)
Renders the Properties panel content for a selected Branch (or While) node.
static std::vector< std::string > GetDataInputPins(TaskNodeType type)
Returns the data-in pin names for a node type.
void RenderConstValueInput(TaskValue &value, VariableType varType, const char *label)
Renders a type-aware const value input widget.
void ResetViewportBeforeSave()
Resets the ImNodes canvas panning to (0,0) before saving node positions.
std::unique_ptr< SetBBValuePropertyPanel > m_setBBPanel
Properties-panel sub-widget for the selected SetBBValue node.
static std::string BuildConditionPreview(const Condition &cond)
Builds a human-readable preview string for a condition.
std::unordered_set< int > m_positionedNodes
Nodes for which ImNodes has been given a position.
void RenderVerificationPanel()
Renders the verification results panel (Phase 21-B).
int m_topPanelTabSelection
Top panel tab selection (Part A of right panel) 0 = Properties, 1 = Nodes.
bool SaveAs(const std::string &path)
Saves the current canvas state to a new JSON v4 file.
bool m_showSaveAsDialog
True when the "Save As" modal should be opened next frame.
SelectionEffectRenderer m_selectionRenderer
Renders glow effect for selected nodes (cyan halo + thickened border).
std::unique_ptr< ImNodesCanvasEditor > m_canvasEditor
Canvas editor adapter for minimap support (Phase 37) Abstracts imnodes minimap rendering through ICan...
int DataInAttrUID(int nodeID, int pinIndex) const
Maps node ID + data pin index -> ImNodes attribute UID for data-in pins.
void RebuildLinks()
Rebuilds ImNodes exec/data link arrays from the template.
int m_focusNodeID
Node ID to focus/scroll to on next RenderCanvas() frame (-1 = none)
void SyncNodePositionsFromImNodes()
Pulls the current node positions from ImNodes into m_editorNodes.
int m_contextNodeID
Node ID captured at the moment a right-click context menu was opened on a node.
float m_presetBankPanelHeight
Height of the Preset Bank panel (Part B) in the right panel.
void RenderRightPanelTabContent()
Phase 26 — Tab system: Renders the content of the active tab Dispatches to appropriate render functio...
int m_minimapPosition
Minimap position (0=TopLeft, 1=TopRight, 2=BottomLeft, 3=BottomRight)
float m_propertiesPanelWidth
Width of the properties+blackboard panel on the right.
std::string GetNodeSubGraphPath(const TaskNodeDefinition &def) const
Extracts SubGraph file path from a node definition.
int m_nextNodeID
Next available node ID.
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.
bool m_justPerformedUndoRedo
Set to true immediately after Undo/Redo; blocks node movement tracking for 1 frame to allow ImNodes t...
bool SerializeAndWrite(const std::string &path)
Serializes the template to JSON v4 and writes to a file.
BlackboardValidationResult ValidateBlackboardKey(const std::string &key, bool isGlobal, int excludeIndex=-1)
Validates a blackboard key according to schema rules.
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...
float m_lastClickTime
Frame time of the last left-click (seconds, from ImGui::GetTime())
int DataOutAttrUID(int nodeID, int pinIndex) const
Maps node ID + data pin index -> ImNodes attribute UID for data-out pins.
bool RenderOperandEditor(Operand &operand, const char *labelSuffix)
Render a single operand with dropdown for mode and value editor Returns true if the operand was modif...
std::string m_saveAsDirectory
Currently selected destination directory.
int m_propEditNodeIDOnFocus
Node ID that was selected when RenderProperties() last entered focus.
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 SetVisible(bool v)
Show / hide the panel.
int ExecInAttrUID(int nodeID) const
Maps node ID -> ImNodes attribute UID for an exec-in pin.
int m_rightPanelTabSelection
Phase 26 — Right panel tab selection 0 = Presets, 1 = Local Variables, 2 = Global Variables.
std::vector< std::string > GetExecOutputPinsForNode(const TaskNodeDefinition &def) const
Returns exec-out pin names for a node definition, including any dynamically-added pins (VSSequence).
bool m_verificationDone
True once RunVerification() has been called at least once for the current graph.
const TaskGraphTemplate & GetTemplate() const
Returns a reference to the internal template being edited.
void RenderNodeDataParameters(TaskNodeDefinition &def)
Renders node parameters for data nodes (GetBBValue, SetBBValue, MathOp).
float m_minimapSize
Minimap size ratio (0.05-0.5 of canvas)
void RenderPresetBankPanel()
Part B: Preset Bank panel (middle of right panel)
bool m_pendingAddPin
Pending dynamic pin addition (from [+] button clicked in canvas)
static std::vector< BlackboardEntry > GetVariablesByType(const std::vector< BlackboardEntry > &allVars, VariableType expectedType)
Returns a filtered subset of blackboard entries matching a type.
std::vector< VSEditorNode > m_editorNodes
Editor nodes (mirrors m_template.Nodes + position/selection state)
bool m_minimapVisible
Minimap visibility flag for VisualScript canvas.
int m_selectedNodeID
Currently selected node (for properties panel)
void SyncEditorNodesFromTemplate()
Rebuilds m_editorNodes from m_template, preserving existing node positions.
~VisualScriptEditorPanel()
VisualScriptEditorPanel Destructor.
void RenderVerificationLogsPanel()
Public render method for verification logs panel.
std::string m_saveAsExtension
Extension to append when saving (derived from m_currentPath; defaults to ".ats")
int m_nextLinkID
Next available ImNodes link ID.
std::string m_propEditSwitchVar
Live buffer for switchVariable field.
ConditionPresetRegistry m_presetRegistry
Global registry of ConditionPreset objects.
std::vector< std::string > m_simulationTraces
Simulation execution traces (populated by RunGraphSimulation()) Phase 24.4 — added to verification lo...
std::unique_ptr< ConditionPresetLibraryPanel > m_libraryPanel
Global condition preset library panel (UI for creating/editing/deleting presets).
void LoadTemplate(const TaskGraphTemplate *tmpl, const std::string &path)
Loads a VS graph template into the editor canvas.
static std::vector< std::string > GetExecOutputPins(TaskNodeType type)
Returns the exec-out pin names for a node type.
std::string m_propEditOldName
Snapshot values captured at focus time for each editable field.
ImVec2 ScreenToCanvasPos(ImVec2 screenPos) const
Converts a screen-space position to canvas (editor) space.
< Provides AssetID and INVALID_ASSET_ID
VariableType
Type tags used by TaskValue to identify stored data.
@ Vector
3-component vector (Vector from vector.h)
TaskNodeType
Identifies the role of a node in the task graph.
@ EntryPoint
Unique entry node for VS graphs (replaces Root)
constexpr int32_t NODE_INDEX_NONE
Sentinel value for "no node" in node index / ID fields.
Single entry in the graph's declared blackboard schema (local or global).
Result of blackboard key validation (Phase 26).
std::string WarningMessage
Set if validation succeeded but has warnings.
std::string ErrorMessage
Set if validation failed.
A globally-stored, reusable condition expression.
Describes a single condition expression for Branch/While nodes.
Represents a single execution point in graph simulation (Phase 24).
int32_t nodeID
Current node to execute.
int depth
Nesting depth (for indentation)
ExecutionToken(int32_t id, int d)
One side of a ConditionPreset comparison expression.
Definition Operand.h:45
Full description of a single node in the task graph.
Editor-side representation of a node in the VS graph canvas.