From 17f25690eb5405ac319c6e35c4e765a93c295b71 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 17 Apr 2020 17:34:02 +0100 Subject: [PATCH] Ctrl-click up/down in NewGRF window to move to top or bottom --- src/newgrf_gui.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 450a9adb9e..09968dedac 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -965,8 +965,14 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { GRFConfig *c = *pc; if (c->next == this->active_sel) { c->next = this->active_sel->next; - this->active_sel->next = c; - *pc = this->active_sel; + if (_ctrl_pressed) { + this->active_sel->next = this->actives; + this->actives = this->active_sel; + pos = 0; + } else { + this->active_sel->next = c; + *pc = this->active_sel; + } break; } } @@ -986,7 +992,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { *pc = c->next; c->next = c->next->next; (*pc)->next = c; - break; + if (!_ctrl_pressed || c->next == nullptr) break; } } this->vscroll->ScrollTowards(pos);