From c037722cb555426e8fa286ab48d1af9c066924c4 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 10 May 2025 20:27:43 +0200 Subject: [PATCH] Fix 51a7edd: NewGRF debug sprite picker was broken. (#14246) --- src/window.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 38f60e74ea..a70c78f884 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3026,14 +3026,6 @@ void InputLoop() /* Process scheduled window deletion. */ Window::DeleteClosedWindows(); - /* Handle sprite picker before any GUI interaction */ - if (_newgrf_debug_sprite_picker.mode == SPM_REDRAW) { - /* We are done with the last draw-frame, so we know what sprites we - * clicked on. Reset the picker mode and invalidate the window. */ - _newgrf_debug_sprite_picker.mode = SPM_NONE; - InvalidateWindowData(WC_SPRITE_ALIGNER, 0, 1); - } - /* HandleMouseEvents was already called for this tick */ HandleMouseEvents(); } @@ -3117,6 +3109,13 @@ void UpdateWindows() NetworkDrawChatMessage(); /* Redraw mouse cursor in case it was hidden */ DrawMouseCursor(); + + if (_newgrf_debug_sprite_picker.mode == SPM_REDRAW) { + /* We are done with the last draw-frame, so we know what sprites we + * clicked on. Reset the picker mode and invalidate the window. */ + _newgrf_debug_sprite_picker.mode = SPM_NONE; + InvalidateWindowData(WC_SPRITE_ALIGNER, 0, 1); + } } /**