Skip to content

Add undo/redo support to settings menu - #1812

Merged
MewPurPur merged 1 commit into
MewPurPur:mainfrom
rekcilyssup:implement-settings-menu-undo-redo
Aug 19, 2026
Merged

Add undo/redo support to settings menu#1812
MewPurPur merged 1 commit into
MewPurPur:mainfrom
rekcilyssup:implement-settings-menu-undo-redo

Conversation

@rekcilyssup

Copy link
Copy Markdown
Contributor

Closes #1615.

Undo and redo (Ctrl+Z / Ctrl+Y) previously only worked in the shortcuts section of the settings menu. This change routes all setting changes through the menu's undo_redo so they can be undone/redone.

Changes:

  • UndoRedoRef now passes merge_mode/backward_undo_ops through to create_action(), and exposes is_committing_action().
  • settings_menu.gd passes its undo_redo to every SettingsContentGeneric instance.
  • settings_content_generic.gd wraps the setting setter in an undo/redo action:
    • MERGE_ENDS is used so continuous edits (e.g. dragging a color) merge into a single undo step.
    • Actions are only created when the value actually changes, since widget initialization during content rebuilds otherwise creates no-op actions that pollute the history.
    • The content rebuilds after undo/redo (but not during commits, checked via is_committing_action()) so widgets reflect reverted values.
    • The version_changed connection is cleaned up on tree_exiting.

Verified with Godot 4.6 stable (headless): checkbox/dropdown/numeric settings all set -> undo -> redo correctly, merged color edits undo in one step, and no stale UI state after reverting.

@MewPurPur

Copy link
Copy Markdown
Owner

Awesome! I set up the architecture a few weeks ago but didn't know if I'll get to this anytime soon. I'll test and review this posthaste.

@MewPurPur

Copy link
Copy Markdown
Owner

Thanks!

@MewPurPur
MewPurPur merged commit dc56ab8 into MewPurPur:main Aug 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No UndoRedo in settings menu

2 participants