Undo/Redo addon for Godot.
Find a file
2025-08-17 14:33:41 -07:00
addons Update changelog for v2.0 and copy to addon folder 2025-08-17 14:33:41 -07:00
examples/creverter Add quickstart as example 2025-08-16 19:51:09 -07:00
images Update screenshots 2025-08-17 14:29:42 -07:00
tests Collapse CRSaver and CRLoader into CRMemento 2025-08-16 01:26:29 -07:00
.gitattributes Prepare gitattributes file for the asset library 2024-06-16 17:28:22 -07:00
.gitignore Initial commit 2024-06-16 23:38:16 +00:00
CHANGELOG.md Update changelog for v2.0 and copy to addon folder 2025-08-17 14:33:41 -07:00
icon.png Center icon 2024-06-17 14:01:20 -07:00
icon.png.import Center icon 2024-06-17 14:01:20 -07:00
LICENSE.txt Improve license file readability 2025-08-15 15:59:19 -07:00
project.godot Remove version in Project Settings 2025-08-14 23:22:00 -07:00
README.md Update readme and changelog 2025-08-16 19:50:27 -07:00

Composite Reverter

CReverter icon

The Composite Reverter (CReverter) is a memento-based undo/redo utility for Godot. It provides a clean interface to track the history of multiple objects and then to traverse that history via functions like undo and redo.

A unique feature is its support of composition, allowing objects to handle their own saving and loading independently of each other while still operating in unison. This enhances decoupling and encapsulation in your code.

How to Use

Requirements

Godot must be version 4.0 or later.

Install

  • Option 1: Get it from the Godot Asset Library through the Godot editor.
  • Option 2: Download it from the Releases page and put the creverter/ folder into the res://addons/ folder in your project.

Quickstart

# Initialize reverter in main script
func _ready() -> void:
    # These connections can also be set in the PackedScene
    %Reverter.saving.connect(%MyNode.on_reverter_saving)
    %Reverter.loading.connect(%MyNode.on_reverter_loading)
    %UndoButton.pressed.connect(%Reverter.undo)
    %RedoButton.pressed.connect(%Reverter.redo)

    # Initial commit
    %Reverter.commit()

    # Make changes and commit again to make buttons usable
    %MyNode.my_var -= 1
    %Reverter.commit()
    %Reverter.loaded.connect(_on_reverter_loaded)

func _on_reverter_loaded() -> void:
    print(%MyNode.my_var)
# Connect saving and loading functions in %MyNode script
var my_var = 100

func on_reverter_saving(memento: CRMemento) -> void:
    memento.add_submemento(name, {"my_var": my_var})

func on_reverter_loading(memento: CRMemento) -> void:
    my_var = memento.get_submemento(name).my_var

API Reference

To view the API reference from inside the Godot editor: Either press F1 or go to Script > Search Help, and then search for "CReverter".

Contributing

Contributions, bug reports, requests, and general feedback are welcome. Make a new issue to get started.

Origin

This is developed for use in Super Practica. You can see an example of its usage there.