Undo / Redo

An asset by Demoli
The page banner background of a mountain and forest
Undo / Redo hero image

Quick Information

0 ratings
Undo / Redo icon image
Demoli
Undo / Redo

Undo / Redo nodes based on Memento pattern

Supported Engine Version
4.0
Version String
0.2.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Undo / Redo node based on Memento pattern

https://medium.com/design-patterns-in-python/memento-pattern-eba610b3b59c

Usage

Add an Undoer node to your scene and set the target to the node you want to track (by default this is the current parent node).

To save state call call $Undoer.save_state with a dictionary of properties you want to save

To undo call $Undoer.undo this will apply the previous state to your target node

To redo call $Undoer.redo this will apply the next saved sate to your target node

To clear all state call $Undoer.clear

Events

The Undoer also emits undone and redone events with the state that has been applied.

Examples

There are 2 example scenes in res://addons/undoredo/Examples, these demonstrate some different approaches you can use.

Restrictions

This is currently intended to handle properties on the parent object, method calls or properties on child nodes won't work at this time, but may be added later.

Undo / Redo nodes based on Memento pattern

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Undo / Redo icon image
Demoli
Undo / Redo

Undo / Redo nodes based on Memento pattern

Supported Engine Version
4.0
Version String
0.2.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers