From d2d6d502872aa4f227c8f7c6c74b0de13255fbb8 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 16 Oct 2024 11:18:43 +0200 Subject: [PATCH] change condition for wdg_undo --- src/src/game-gui.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/src/game-gui.cc b/src/src/game-gui.cc index 103b8d76..d10d70ef 100644 --- a/src/src/game-gui.cc +++ b/src/src/game-gui.cc @@ -2394,8 +2394,12 @@ game::refresh_widgets() case 0b011: G->wdg_layervis->s[0] = gui_spritesheet::get_sprite(S_LAYERVIS_2); break; default: case 0b111: G->wdg_layervis->s[0] = gui_spritesheet::get_sprite(S_LAYERVIS_3); break; } + } - this->wdg_undo->add(); // XXX griffi-gh: Is this the right place? + // XXX griffi-gh: Is this the right condition? + // Shouldn't we always show the undo button in sandbox mode? (even without advanced mode) + if (G->state.sandbox && W->is_paused() && G->state.advanced_mode) { + this->wdg_undo->add(); this->wdg_undo->faded = undo.amount() == 0; }