s&box docs
API ReferenceSandbox.Helpers

public class Sandbox.Helpers.UndoSystem

A system that aims to wrap the main reusable functionality of an undo system

Constructors

Showing 1 constructors

Methods

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.

public Sandbox.Helpers.UndoSystem.Entry Insert(string title, System.Action undo, System.Action redo = null)

Insert a new undo entry

Parameters

  • redo: Default: null

public bool Redo()

Instigate a redo, returns true if we found a successful undo

public void SetSnapshotFunction(System.Func`1<System.Action> snapshot)Obsolete

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

public void Snapshot(string changeTitle)Obsolete

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

public bool Undo()

Instigate an undo. Return true if we found a successful undo

Properties

Showing 2 properties

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

Metadata

FieldValue
NamespaceSandbox.Helpers
Typeclass
AssemblySandbox.Tools
Doc IDT:Sandbox.Helpers.UndoSystem

On this page