UndoSystemclass
A system that aims to wrap the main reusable functionality of an undo system
Constructors1
Showing 1 constructors
public UndoSystem()
No results match this filter.
Methods6
Showing 6 methods
public void Initialize()
Clear the history and take an initial snapshot. You should call this right after a load, or a new project.
void—public Sandbox.Helpers.UndoSystem.Entry Insert(string title, System.Action undo, System.Action redo = null)
Insert a new undo entry
| Parameter | Type | Description |
|---|---|---|
| title | string | — |
| undo | Action | — |
| redo = null | Action | — |
public bool Redo()
Instigate a redo, returns true if we found a successful undo
bool—public void SetSnapshotFunction(System.Func`1<System.Action> snapshot)
Obsolete: Auto Snapshotting is obsolete and no longer working. If you really want to use snapshotting for Undo, create/restore the snapshots manually in the undo/redo actions provided to UndoSystem.Insert
| Parameter | Type | Description |
|---|---|---|
| snapshot | Func<Action> | — |
void—public void Snapshot(string changeTitle)
Should be called after you make a change to your project. The snapshot system is good for self contained projects that can be serialized and deserialized quickly.
Obsolete: Auto Snapshotting is obsolete and no longer working. If you really want to use snapshotting for Undo, create/restore the snapshots manually in the undo/redo actions provided to UndoSystem.Insert
| Parameter | Type | Description |
|---|---|---|
| changeTitle | string | — |
void—public bool Undo()
Instigate an undo. Return true if we found a successful undo
bool—No results match this filter.
Properties2
Showing 2 properties
public System.Collections.Generic.Stack`1<Sandbox.Helpers.UndoSystem.Entry> Sandbox.Helpers.UndoSystem.Back { get; set; }
Backwards stack
public System.Collections.Generic.Stack`1<Sandbox.Helpers.UndoSystem.Entry> Sandbox.Helpers.UndoSystem.Forward { get; set; }
Forwards stack, gets cleared when a new undo is added
No results match this filter.