manipulator: make cursor_down_z go to beginning of next group

develop
jj 2012-09-28 18:55:13 +02:00
parent ca0097b910
commit 4a495c2c7f
1 changed files with 6 additions and 4 deletions

@ -648,11 +648,13 @@ void viewscreen_unitlaborsst::feed(set<df::interface_key> *events)
} }
if ((sel_column != NUM_COLUMNS - 1) && events->count(interface_key::CURSOR_DOWN_Z)) if ((sel_column != NUM_COLUMNS - 1) && events->count(interface_key::CURSOR_DOWN_Z))
{ {
// go to end of current column group; if already at the end, go to the end of the next one // go to beginning of next group
sel_column++;
int cur = columns[sel_column].group; int cur = columns[sel_column].group;
while ((sel_column < NUM_COLUMNS - 1) && columns[sel_column + 1].group == cur) int next = sel_column+1;
sel_column++; while ((next < NUM_COLUMNS) && (columns[next].group == cur))
next++;
if ((next < NUM_COLUMNS) && (columns[next].group != cur))
sel_column = next;
} }
if (sel_column < 0) if (sel_column < 0)