Ctrl-click up/down in NewGRF window to move to top or bottom
This commit is contained in:
@@ -965,8 +965,14 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
|||||||
GRFConfig *c = *pc;
|
GRFConfig *c = *pc;
|
||||||
if (c->next == this->active_sel) {
|
if (c->next == this->active_sel) {
|
||||||
c->next = this->active_sel->next;
|
c->next = this->active_sel->next;
|
||||||
this->active_sel->next = c;
|
if (_ctrl_pressed) {
|
||||||
*pc = this->active_sel;
|
this->active_sel->next = this->actives;
|
||||||
|
this->actives = this->active_sel;
|
||||||
|
pos = 0;
|
||||||
|
} else {
|
||||||
|
this->active_sel->next = c;
|
||||||
|
*pc = this->active_sel;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -986,7 +992,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
|||||||
*pc = c->next;
|
*pc = c->next;
|
||||||
c->next = c->next->next;
|
c->next = c->next->next;
|
||||||
(*pc)->next = c;
|
(*pc)->next = c;
|
||||||
break;
|
if (!_ctrl_pressed || c->next == nullptr) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->vscroll->ScrollTowards(pos);
|
this->vscroll->ScrollTowards(pos);
|
||||||
|
Reference in New Issue
Block a user