![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Records a property edit on a single node for undo/redo. More...
#include <UndoRedoStack.h>
Inheritance diagram for Olympe::EditNodePropertyCommand:
Collaboration diagram for Olympe::EditNodePropertyCommand:Public Member Functions | |
| EditNodePropertyCommand (int32_t nodeID, const std::string &propertyKey, const PropertyValue &oldValue, const PropertyValue &newValue) | |
| void | Execute (TaskGraphTemplate &graph) override |
| Applies the command to the graph. | |
| void | Undo (TaskGraphTemplate &graph) override |
| Reverses the command on the graph. | |
| std::string | GetDescription () const override |
| Returns a short human-readable description (e.g. | |
Public Member Functions inherited from Olympe::ICommand | |
| virtual | ~ICommand ()=default |
Static Private Member Functions | |
| static void | ApplyValue (TaskNodeDefinition &node, const std::string &key, const PropertyValue &value) |
Applies value to the named field of node. | |
Private Attributes | |
| int32_t | m_nodeID |
| std::string | m_propertyKey |
| PropertyValue | m_oldValue |
| PropertyValue | m_newValue |
Records a property edit on a single node for undo/redo.
Covers all editable fields exposed by the Properties panel: NodeName, AtomicTaskID, DelaySeconds, ConditionID, BBKey, MathOperator, SubGraphPath.
Uses the "commit on release" pattern: the command is pushed only when the ImGui widget loses focus after an edit (IsItemDeactivatedAfterEdit), so a single undo entry is created per editing session, not one per keystroke.
Definition at line 228 of file UndoRedoStack.h.
| Olympe::EditNodePropertyCommand::EditNodePropertyCommand | ( | int32_t | nodeID, |
| const std::string & | propertyKey, | ||
| const PropertyValue & | oldValue, | ||
| const PropertyValue & | newValue | ||
| ) |
Definition at line 323 of file UndoRedoStack.cpp.
|
staticprivate |
Applies value to the named field of node.
Definition at line 334 of file UndoRedoStack.cpp.
References Olympe::PropertyValue::floatVal, GetComponentTypeID_Static(), and Olympe::PropertyValue::strVal.
Referenced by Execute(), and Undo().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Applies the command to the graph.
Implements Olympe::ICommand.
Definition at line 354 of file UndoRedoStack.cpp.
References ApplyValue(), GetComponentTypeID_Static(), m_newValue, m_nodeID, and m_propertyKey.
Here is the call graph for this function:
|
overridevirtual |
Returns a short human-readable description (e.g.
"Add Node #3").
Implements Olympe::ICommand.
Definition at line 380 of file UndoRedoStack.cpp.
References GetComponentTypeID_Static(), m_nodeID, and m_propertyKey.
Here is the call graph for this function:
|
overridevirtual |
Reverses the command on the graph.
Implements Olympe::ICommand.
Definition at line 367 of file UndoRedoStack.cpp.
References ApplyValue(), GetComponentTypeID_Static(), m_nodeID, m_oldValue, and m_propertyKey.
Here is the call graph for this function:
|
private |
Definition at line 243 of file UndoRedoStack.h.
Referenced by Execute().
|
private |
Definition at line 240 of file UndoRedoStack.h.
Referenced by Execute(), GetDescription(), and Undo().
|
private |
Definition at line 242 of file UndoRedoStack.h.
Referenced by Undo().
|
private |
Definition at line 241 of file UndoRedoStack.h.
Referenced by Execute(), GetDescription(), and Undo().