diff options
Diffstat (limited to 'plugins/manipulator.cpp')
| -rw-r--r-- | plugins/manipulator.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp index b04c8079..953cf2ba 100644 --- a/plugins/manipulator.cpp +++ b/plugins/manipulator.cpp @@ -662,6 +662,17 @@ void viewscreen_unitlaborsst::feed(set<df::interface_key> *events) if (sel_column > NUM_COLUMNS - 1) sel_column = NUM_COLUMNS - 1; + if (events->count(interface_key::CURSOR_DOWN_Z) || events->count(interface_key::CURSOR_UP_Z)) + { + // when moving by group, ensure the whole group is shown onscreen + int endgroup_column = sel_column; + while ((endgroup_column < NUM_COLUMNS-1) && columns[endgroup_column+1].group == columns[sel_column].group) + endgroup_column++; + + if (first_column < endgroup_column - col_widths[DISP_COLUMN_LABORS] + 1) + first_column = endgroup_column - col_widths[DISP_COLUMN_LABORS] + 1; + } + if (sel_column < first_column) first_column = sel_column; if (first_column < sel_column - col_widths[DISP_COLUMN_LABORS] + 1) |
