summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjj2012-09-28 18:55:13 +0200
committerjj2012-09-28 19:20:10 +0200
commit4a495c2c7fa9cef78628a3026a434322ca7418d1 (patch)
tree236b7f66b103c0dfa0ecfa24a53b77ac840ed921 /plugins
parentca0097b91089a7012b3aa3106721623545803dd4 (diff)
downloaddfhack-4a495c2c7fa9cef78628a3026a434322ca7418d1.tar.gz
dfhack-4a495c2c7fa9cef78628a3026a434322ca7418d1.tar.bz2
dfhack-4a495c2c7fa9cef78628a3026a434322ca7418d1.tar.xz
manipulator: make cursor_down_z go to beginning of next group
Diffstat (limited to 'plugins')
-rw-r--r--plugins/manipulator.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp
index 7451f137..b04c8079 100644
--- a/plugins/manipulator.cpp
+++ b/plugins/manipulator.cpp
@@ -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))
{
- // go to end of current column group; if already at the end, go to the end of the next one
- sel_column++;
+ // go to beginning of next group
int cur = columns[sel_column].group;
- while ((sel_column < NUM_COLUMNS - 1) && columns[sel_column + 1].group == cur)
- sel_column++;
+ int next = sel_column+1;
+ while ((next < NUM_COLUMNS) && (columns[next].group == cur))
+ next++;
+ if ((next < NUM_COLUMNS) && (columns[next].group != cur))
+ sel_column = next;
}
if (sel_column < 0)